dpctl.program.create_kernel_bundle_from_sycl_source¶
- dpctl.program.create_kernel_bundle_from_sycl_source(q, source, headers=None, registered_names=None, copts=None)¶
Creates an executable SYCL kernel_bundle from SYCL source code.
This uses the DPC++
kernel_compilerextension to create asycl::kernel_bundle<sycl::bundle_state::executable>object from SYCL source code.- Parameters:
q (
dpctl.SyclQueue) – Thedpctl.SyclQueuefor which theSyclKernelBundleis going to be built.source (unicode) – SYCL source code string.
headers (list, optional) – Optional list of virtual headers, where each entry in the list needs to be a tuple of header name and header content. See the documentation of the
include_filesproperty in the DPC++kernel_compilerextension for more information. Default:Noneregistered_names (list, optional) – Optional list of kernel names to register. See the documentation of the
registered_namesproperty in the DPC++kernel_compilerextension for more information. Default:Nonecopts (list, optional) – Optional list of compilation flags that will be used when compiling the program. Default:
None
- Returns:
- kernel_bundle (
SyclKernelBundle) A
SyclKernelBundleobject wrapping thesycl::kernel_bundle<sycl::bundle_state::executable>returned by the C API.
- kernel_bundle (
- Raises:
SyclKernelBundleCompilationError – If a SYCL kernel bundle could not be created. The exception message contains the build log for more details.