.. index:: pair: group; Kernel_bundle class C wrapper .. _doxid-d2/d0d/group___kernel_bundle_interface: Kernel_bundle class C wrapper ============================= .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block // global functions :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclKernelBundleRef` :ref:`DPCTLKernelBundle_Copy`(:ref:`__dpctl_keep` const :ref:`DPCTLSyclKernelBundleRef` KBRef); :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclKernelBundleRef` :ref:`DPCTLKernelBundle_CreateFromOCLSource`( :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` Ctx, :ref:`__dpctl_keep` const :ref:`DPCTLSyclDeviceRef` Dev, :ref:`__dpctl_keep` const char* Source, :ref:`__dpctl_keep` const char* CompileOpts ); :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclKernelBundleRef` :ref:`DPCTLKernelBundle_CreateFromSpirv`( :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` Ctx, :ref:`__dpctl_keep` const :ref:`DPCTLSyclDeviceRef` Dev, :ref:`__dpctl_keep` const void* IL, size_t Length, const char* CompileOpts ); :ref:`DPCTL_API` void :ref:`DPCTLKernelBundle_Delete`(:ref:`__dpctl_take` :ref:`DPCTLSyclKernelBundleRef` KBRef); :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclKernelRef` :ref:`DPCTLKernelBundle_GetKernel`( :ref:`__dpctl_keep` :ref:`DPCTLSyclKernelBundleRef` KBRef, :ref:`__dpctl_keep` const char* KernelName ); :ref:`DPCTL_API` bool :ref:`DPCTLKernelBundle_HasKernel`( :ref:`__dpctl_keep` :ref:`DPCTLSyclKernelBundleRef` KBRef, :ref:`__dpctl_keep` const char* KernelName ); .. _details-d2/d0d/group___kernel_bundle_interface: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global Functions ---------------- .. index:: pair: function; DPCTLKernelBundle_Copy .. _doxid-d2/d0d/group___kernel_bundle_interface_1gaf16f028b8fd7c1fa145768892fd1bfdb: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclKernelBundleRef` DPCTLKernelBundle_Copy(:ref:`__dpctl_keep` const :ref:`DPCTLSyclKernelBundleRef` KBRef) Returns a copy of the DPCTLSyclKernelBundleRef object. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - KBRef - DPCTLSyclKernelBundleRef object to be copied. .. rubric:: Returns: A new DPCTLSyclKernelBundleRef created by copying the passed in DPCTLSyclKernelBundleRef object. .. index:: pair: function; DPCTLKernelBundle_CreateFromOCLSource .. _doxid-d2/d0d/group___kernel_bundle_interface_1gaa753c9ba7f39524d2f87cb7caae74350: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclKernelBundleRef` DPCTLKernelBundle_CreateFromOCLSource( :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` Ctx, :ref:`__dpctl_keep` const :ref:`DPCTLSyclDeviceRef` Dev, :ref:`__dpctl_keep` const char* Source, :ref:`__dpctl_keep` const char* CompileOpts ) Create a Sycl kernel bundle from an OpenCL kernel source string. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Ctx - An opaque pointer to a sycl::context * - Dev - An opaque pointer to a sycl::device * - Source - OpenCL source string * - CompileOpts - Extra compiler flags (refer Sycl spec.) .. rubric:: Returns: A new SyclKernelBundleRef pointer if the program creation succeeded, else returns NULL. .. index:: pair: function; DPCTLKernelBundle_CreateFromSpirv .. _doxid-d2/d0d/group___kernel_bundle_interface_1ga6062cc6a4c81ca4f4079d792c9f135b8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclKernelBundleRef` DPCTLKernelBundle_CreateFromSpirv( :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` Ctx, :ref:`__dpctl_keep` const :ref:`DPCTLSyclDeviceRef` Dev, :ref:`__dpctl_keep` const void* IL, size_t Length, const char* CompileOpts ) Create a Sycl kernel_bundle from an OpenCL SPIR-V binary file. Uses SYCL2020 interoperability layer to create sycl::kernel_bundle object in executable state for OpenCL and Level-Zero backends from SPIR-V binary. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Ctx - An opaque pointer to a sycl::context * - Dev - An opaque pointer to a sycl::device * - IL - SPIR-V binary * - Length - The size of the IL binary in bytes. * - CompileOpts - Optional compiler flags used when compiling the SPIR-V binary. .. rubric:: Returns: A new SyclKernelBundleRef pointer if the kernel_bundle creation succeeded, else returns NULL. .. index:: pair: function; DPCTLKernelBundle_Delete .. _doxid-d2/d0d/group___kernel_bundle_interface_1ga0bf45ad7930bf8e973be31e48b0fde9d: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` void DPCTLKernelBundle_Delete(:ref:`__dpctl_take` :ref:`DPCTLSyclKernelBundleRef` KBRef) Frees the DPCTLSyclKernelBundleRef pointer. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - KBRef - Opaque pointer to a sycl::kernel_bundle .. index:: pair: function; DPCTLKernelBundle_GetKernel .. _doxid-d2/d0d/group___kernel_bundle_interface_1ga7826d57d69cf2d000ccd332541159e33: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclKernelRef` DPCTLKernelBundle_GetKernel( :ref:`__dpctl_keep` :ref:`DPCTLSyclKernelBundleRef` KBRef, :ref:`__dpctl_keep` const char* KernelName ) Returns the SyclKernel with given name from the program, if not found then return NULL. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - KBRef - Opaque pointer to a sycl::kernel_bundle * - KernelName - Name of kernel .. rubric:: Returns: A SyclKernel reference if the kernel exists, else NULL .. index:: pair: function; DPCTLKernelBundle_HasKernel .. _doxid-d2/d0d/group___kernel_bundle_interface_1gaec25b409112401cd5ca12edbc96d4dbf: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` bool DPCTLKernelBundle_HasKernel( :ref:`__dpctl_keep` :ref:`DPCTLSyclKernelBundleRef` KBRef, :ref:`__dpctl_keep` const char* KernelName ) Return True if a SyclKernel with given name exists in the program, if not found then returns False. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - KBRef - Opaque pointer to a sycl::kernel_bundle * - KernelName - Name of kernel .. rubric:: Returns: True if the kernel exists, else False