|
| 1 | +# Data Parallel Control (dpctl) |
| 2 | +# |
| 3 | +# Copyright 2020-2025 Intel Corporation |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +""" |
| 18 | +**Data Parallel Control Compiler** provides a way to create a SYCL kernel |
| 19 | +from either an OpenCL program represented as a string or a SPIR-V binary |
| 20 | +file. |
| 21 | +
|
| 22 | +""" |
| 23 | + |
| 24 | +from dpctl.compiler._program import ( |
| 25 | + SpecializationConstant, |
| 26 | + SyclKernel, |
| 27 | + SyclKernelBundle, |
| 28 | + SyclKernelBundleCompilationError, |
| 29 | + create_kernel_bundle_from_source, |
| 30 | + create_kernel_bundle_from_spirv, |
| 31 | + create_program_from_source, |
| 32 | + create_program_from_spirv, |
| 33 | +) |
| 34 | + |
| 35 | +__all__ = [ |
| 36 | + "create_kernel_bundle_from_source", |
| 37 | + "create_kernel_bundle_from_spirv", |
| 38 | + "create_program_from_source", |
| 39 | + "create_program_from_spirv", |
| 40 | + "SyclKernel", |
| 41 | + "SyclKernelBundle", |
| 42 | + "SyclKernelBundleCompilationError", |
| 43 | + "SyclProgram", |
| 44 | + "SyclProgramCompilationError", |
| 45 | + "SpecializationConstant", |
| 46 | +] |
| 47 | + |
| 48 | +# add submodules |
| 49 | +__all__ += [ |
| 50 | + "utils", |
| 51 | +] |
| 52 | + |
| 53 | + |
| 54 | +def __getattr__(name): |
| 55 | + if name == "SyclProgram": |
| 56 | + from warnings import warn |
| 57 | + |
| 58 | + warn( |
| 59 | + "dpctl.compiler.SyclProgram is deprecated and will be removed in a " |
| 60 | + "future release. Use dpctl.compiler.SyclKernelBundle instead.", |
| 61 | + DeprecationWarning, |
| 62 | + stacklevel=2, |
| 63 | + ) |
| 64 | + return SyclKernelBundle |
| 65 | + if name == "SyclProgramCompilationError": |
| 66 | + from warnings import warn |
| 67 | + |
| 68 | + warn( |
| 69 | + "dpctl.compiler.SyclProgramCompilationError is deprecated and will " |
| 70 | + "be removed in a future release. Use " |
| 71 | + "dpctl.compiler.SyclKernelBundleCompilationError instead.", |
| 72 | + DeprecationWarning, |
| 73 | + stacklevel=2, |
| 74 | + ) |
| 75 | + return SyclKernelBundleCompilationError |
| 76 | + raise AttributeError(f"module {__name__} has no attribute {name}") |
0 commit comments