numba_dpex.dpctl_iface.dpctl_capi_fn_builder module

This module provides a set of wrapper functions to insert dpctl C API function declarations into an LLVM module.

class numba_dpex.dpctl_iface.dpctl_capi_fn_builder.DpctlCAPIFnBuilder

Bases: object

Defines a set of static functions to add declarations for dpctl C API library function into an LLVM module.

static get_dpctl_event_delete(builder, context)

Inserts an LLVM Function for DPCTLEvent_Delete.

The DPCTLEvent_Delete function deletes a DPCTLSyclEventRef opaque pointer.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Returns: A Python object wrapping an LLVM Function for

DPCTLEvent_Delete.

static get_dpctl_event_wait(builder, context)

Inserts an LLVM Function for DPCTLEvent_Wait.

The DPCTLEvent_Wait function is a wrapper over the sycl::event class’ wait() function.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Return: A Python object wrapping an LLVM Function for

DPCTLEvent_Wait.

static get_dpctl_free_with_queue(builder, context)

Inserts an LLVM Function for DPCTLfree_with_queue.

The DPCTLfree_with_queue function is a wrapper over sycl::free(void*, queue) function. All the opaque pointers arguments to the DPCTLfree_with_queue are passed as void pointers.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Return: A Python object wrapping an LLVM Function for

DPCTLfree_with_queue.

static get_dpctl_malloc_shared(builder, context)

Inserts an LLVM Function for DPCTLmalloc_shared.

DPCTLmalloc_shared is a wrapper over the sycl::malloc_shared function to allocate USM shared memory.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Return: A Python object wrapping an LLVM Function for

DPCTLmalloc_shared.

static get_dpctl_queue_delete(builder, context)

Inserts an LLVM Function for the DPCTLQueue_Delete.

The DPCTLQueue_Delete deletes a DPCTLSyclQueueRef opaque pointer.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Return: A Python object wrapping an LLVM Function for

DPCTLQueue_Delete.

static get_dpctl_queue_memcpy(builder, context)

Inserts an LLVM Function for the DPCTLQueue_Memcpy.

The DPCTLQueue_Memcpy function is a wrapper over sycl::queue class’ event memcpy(void* dest, const void* src, size_t numBytes) function. Currently, the DPCTLQueue_Memcpy does not return an event reference, but in future will return an opaque pointer to a sycl::event. All the opaque pointers arguments to the DPCTLQueue_Memcpy are passed as void pointers.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Return: A Python object wrapping an LLVM Function for

DPCTLQueue_Memcpy.

static get_dpctl_queue_submit_range(builder, context)

Inserts an LLVM Function for DPCTLQueue_SubmitRange.

The DPCTLQueue_SubmitRange function is a wrapper over the sycl::queue class’ event parallel_for(range<dimensions> numWorkItems, Rest&&... rest) function. All the opaque pointers arguments to the DPCTLQueue_SubmitRange function are passed as void pointers.

Note: The DPCTLQueue_SubmitRange calls returns an opaque pointer to a sycl::event that needs to be destroyed properly.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Return: A Python object wrapping an LLVM Function for

DPCTLQueue_SubmitRange.

static get_dpctl_queue_wait(builder, context)

Inserts an LLVM Function for DPCTLQueue_Wait.

The DPCTLQueue_Wait is a wrapper over sycl::queue class’ wait() function.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Returns: A Python object wrapping an LLVM Function for

DPCTLQueue_Wait.

static get_dpctl_queuemgr_get_current_queue(builder, context)

Inserts an LLVM Function for DPCTLQueueMgr_GetCurrentQueue.

The DPCTLQueueMgr_GetCurrentQueue function returns the current top-of-the-stack SYCL queue that is stored in dpclt’s queue manager.

Args:

builder: The LLVM IR builder to be used for code generation. context: The LLVM IR builder context.

Return: A Python object wrapping an LLVM Function for

DPCTLQueueMgr_GetCurrentQueue.