dpctl.compiler.create_kernel_bundle_from_source¶
- dpctl.compiler.create_kernel_bundle_from_source(q, src, copts='')¶
Creates a Sycl interoperability kernel bundle from an OpenCL source string.
We use the
DPCTLKernelBundle_CreateFromOCLSource()C API function to create asycl::kernel_bundle<sycl::bundle_state::executable>from an OpenCL source program that can contain multiple kernels. Note: This function is currently only supported for the OpenCL backend.- Parameters:
q (
dpctl.SyclQueue) – Thedpctl.SyclQueuefor which theSyclKernelBundleis going to be built.src (str) – Source string for an OpenCL program.
copts (str, optional) – Optional compilation flags that will be used when compiling the kernel bundle. Default:
"".
- 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.