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_compiler extension to create a sycl::kernel_bundle<sycl::bundle_state::executable> object from SYCL source code.

Parameters:
  • q (dpctl.SyclQueue) – The dpctl.SyclQueue for which the SyclKernelBundle is 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_files property in the DPC++ kernel_compiler extension for more information. Default: None

  • registered_names (list, optional) – Optional list of kernel names to register. See the documentation of the registered_names property in the DPC++ kernel_compiler extension for more information. Default: None

  • copts (list, optional) – Optional list of compilation flags that will be used when compiling the program. Default: None

Returns:

kernel_bundle (SyclKernelBundle)

A SyclKernelBundle object wrapping the sycl::kernel_bundle<sycl::bundle_state::executable> returned by the C API.

Raises:

SyclKernelBundleCompilationError – If a SYCL kernel bundle could not be created. The exception message contains the build log for more details.