Global Namespace

Overview

// namespaces

namespace dpctl;
    namespace dpctl::syclinterface;

// typedefs

typedef void error_handler_callback(int err_code);
typedef struct MDLocalAccessorTy MDLocalAccessor;
typedef  struct DPCTLOpaqueSyclContext* DPCTLSyclContextRef;
typedef struct DPCTLOpaqueSyclDevice* DPCTLSyclDeviceRef;
typedef struct DPCTLOpaqueSyclDeviceSelector* DPCTLSyclDeviceSelectorRef;
typedef struct DPCTLOpaqueSyclEvent* DPCTLSyclEventRef;
typedef struct DPCTLOpaqueSyclKernelBundle* DPCTLSyclKernelBundleRef;
typedef struct DPCTLOpaqueSyclKernel* DPCTLSyclKernelRef;
typedef struct DPCTLOpaqueSyclPlatform* DPCTLSyclPlatformRef;
typedef struct DPCTLOpaqueSyclQueue* DPCTLSyclQueueRef;
typedef struct DPCTLOpaqueSyclUSM* DPCTLSyclUSMRef;

// enums

enum DPCTLGlobalMemCacheType;
enum DPCTLKernelArgType;
enum DPCTLPartitionAffinityDomainType;
enum DPCTLQueuePropertyType;
enum DPCTLSyclAspectType;
enum DPCTLSyclBackendType;
enum DPCTLSyclDeviceType;
enum DPCTLSyclEventStatusType;
enum DPCTLSyclUSMType;

// structs

struct MDLocalAccessorTy;

// global functions

DPCTL_API uint32_t
DPCTLDevice_GetGlobalMemCacheLineSize(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API uint64_t
DPCTLDevice_GetGlobalMemCacheSize(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API DPCTLGlobalMemCacheType
DPCTLDevice_GetGlobalMemCacheType(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API size_t
DPCTLDevice_GetImage2dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API size_t
DPCTLDevice_GetImage2dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API size_t
DPCTLDevice_GetImage3dMaxDepth(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API size_t
DPCTLDevice_GetImage3dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API size_t
DPCTLDevice_GetImage3dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API uint32_t
DPCTLDevice_GetMaxClockFrequency(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API uint64_t
DPCTLDevice_GetMaxMemAllocSize(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API uint32_t
DPCTLDevice_GetMaxReadImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API uint32_t
DPCTLDevice_GetMaxWriteImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API __dpctl_give DPCTLSyclDeviceRef
DPCTLDevice_GetParentDevice(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API uint32_t
DPCTLDevice_GetPartitionMaxSubDevices(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API size_t
DPCTLDevice_GetProfilingTimerResolution(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API size_t
DPCTLDevice_Hash(__dpctl_keep const DPCTLSyclDeviceRef DRef);

DPCTL_API __dpctl_give DPCTLSyclEventRef
DPCTLQueue_SubmitBarrier(__dpctl_keep const DPCTLSyclQueueRef QRef);

DPCTL_API __dpctl_give DPCTLSyclEventRef
DPCTLQueue_SubmitBarrierForEvents(
    __dpctl_keep const DPCTLSyclQueueRef QRef,
    __dpctl_keep const DPCTLSyclEventRef* DepEvents,
    size_t NDepEvents
    );

DPCTL_C_EXTERN_C_BEGIN DPCTL_API void
DPCTLCString_Delete(__dpctl_take const char* str);

DPCTL_API void
DPCTLSize_t_Array_Delete(__dpctl_take size_t* arr);

// macros

#define DPCTL_C_EXTERN_C_BEGIN
#define DPCTL_C_EXTERN_C_END
#define DPCTL_DECLARE_VECTOR(EL)
#define DPCTL_DECLARE_VECTOR_FN(EL)
#define DPCTL_DECLARE_VECTOR_TYPE(EL)
#define DPCTL_DPCPP_VERSION
#define DPCTL_ENABLE_L0_PROGRAM_CREATION
#define DPCTL_LIBCL_LOADER_FILENAME
#define DPCTL_LIBZE_LOADER_FILENAME
#define HUGE_VALF
#define INT64_MAX
#define INT64_MIN
#define UINT64_MAX
#define __SYCL_COMPILER_VERSION_REQUIRED

Detailed Documentation

Typedefs

typedef void error_handler_callback(int err_code)

Type of function to be used in SYCL async error handler provide by DPCTL.

Parameters:

err_code

Error code extracted from an SYCL asynchronous error.

typedef struct MDLocalAccessorTy MDLocalAccessor

Structure to be used to specify dimensionality and type of local_accessor kernel type argument.

typedef  struct DPCTLOpaqueSyclContext* DPCTLSyclContextRef

Opaque pointer to a sycl::context

typedef struct DPCTLOpaqueSyclDevice* DPCTLSyclDeviceRef

Opaque pointer to a sycl::device

typedef struct DPCTLOpaqueSyclDeviceSelector* DPCTLSyclDeviceSelectorRef

Opaque pointer to a sycl::device_selector

typedef struct DPCTLOpaqueSyclEvent* DPCTLSyclEventRef

Opaque pointer to a sycl::event

typedef struct DPCTLOpaqueSyclKernelBundle* DPCTLSyclKernelBundleRef

Opaque pointer to a sycl::kernel_bundle<sycl::bundle_state::executable>

typedef struct DPCTLOpaqueSyclKernel* DPCTLSyclKernelRef

Opaque pointer to a sycl::kernel

typedef struct DPCTLOpaqueSyclPlatform* DPCTLSyclPlatformRef

Opaque pointer to a sycl::platform

typedef struct DPCTLOpaqueSyclQueue* DPCTLSyclQueueRef

Opaque pointer to a sycl::queue

typedef struct DPCTLOpaqueSyclUSM* DPCTLSyclUSMRef

Used to pass a sycl::usm memory opaquely through DPCTL interfaces.

Global Functions

DPCTL_API uint32_t
DPCTLDevice_GetGlobalMemCacheLineSize(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::global_mem_cache_line_size>

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the size of global memory cache line in bytes as uint32_t.

DPCTL_API uint64_t
DPCTLDevice_GetGlobalMemCacheSize(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::global_mem_cache_size>

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the size of global memory cache in bytes as uint64_t.

DPCTL_API DPCTLGlobalMemCacheType
DPCTLDevice_GetGlobalMemCacheType(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::global_mem_cache_type>

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the type of global memory cache supported.

DPCTL_API size_t
DPCTLDevice_GetImage2dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::image2d_max_height>().

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum height of a 2D image or 1D image in pixels. The minimum value is 8192 if the SYCL device has aspect::image.

DPCTL_API size_t
DPCTLDevice_GetImage2dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::image2d_max_width>().

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum width of a 2D image or 1D image in pixels. The minimum value is 8192 if the SYCL device has aspect::image.

DPCTL_API size_t
DPCTLDevice_GetImage3dMaxDepth(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::image3d_max_depth>().

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum depth of a 3D image The minimum value is 2048 if the SYCL device has aspect::image.

DPCTL_API size_t
DPCTLDevice_GetImage3dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::image3d_max_height>().

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum height of a 3D image The minimum value is 2048 if the SYCL device has aspect::image.

DPCTL_API size_t
DPCTLDevice_GetImage3dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::image3d_max_width>().

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum width of a 3D image in pixels. The minimum value is 2048 if the SYCL device has aspect::image.

DPCTL_API uint32_t
DPCTLDevice_GetMaxClockFrequency(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::max_clock_frequency>

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum clock frequency in MHz as uint32_t.

DPCTL_API uint64_t
DPCTLDevice_GetMaxMemAllocSize(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::max_mem_alloc_size>

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum size of memory object in bytes as uint64_t.

DPCTL_API uint32_t
DPCTLDevice_GetMaxReadImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::max_read_image_args>().

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum number of simultaneous image objects that can be read from by a kernel. The minimum value is 128 if the SYCL device has aspect::image.

DPCTL_API uint32_t
DPCTLDevice_GetMaxWriteImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::max_write_image_args>().

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum number of simultaneous image objects that can be written to by a kernel. The minimum value is 8 if the SYCL device has aspect::image.

DPCTL_API __dpctl_give DPCTLSyclDeviceRef
DPCTLDevice_GetParentDevice(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::parent_device>

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns an opaque pointer to the parent device for a sub-device, or nullptr otherwise.

DPCTL_API uint32_t
DPCTLDevice_GetPartitionMaxSubDevices(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::partition_max_sub_devices>

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the maximum number of sub-devices that can be created when this device is partitioned.

DPCTL_API size_t
DPCTLDevice_GetProfilingTimerResolution(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over device.get_info<info::device::profiling_timer_resolution>

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns the resolution of device timer in nanoseconds.

DPCTL_API size_t
DPCTLDevice_Hash(__dpctl_keep const DPCTLSyclDeviceRef DRef)

Wrapper over std::hash<sycl::device>’s operator()

Parameters:

DRef

Opaque pointer to a sycl::device

Returns:

Returns hash value.

DPCTL_API __dpctl_give DPCTLSyclEventRef
DPCTLQueue_SubmitBarrier(__dpctl_keep const DPCTLSyclQueueRef QRef)

C-API wrapper for sycl::queue::submit_barrier().

Parameters:

QRef

An opaque pointer to the sycl::queue.

Returns:

An opaque pointer to the sycl::event returned by the sycl::queue::submit_barrier() function.

DPCTL_API __dpctl_give DPCTLSyclEventRef
DPCTLQueue_SubmitBarrierForEvents(
    __dpctl_keep const DPCTLSyclQueueRef QRef,
    __dpctl_keep const DPCTLSyclEventRef* DepEvents,
    size_t NDepEvents
    )

C-API wrapper for sycl::queue::submit_barrier(event_vector).

Parameters:

QRef

An opaque pointer to the sycl::queue.

DepEvents

List of dependent DPCTLSyclEventRef objects (events) for the barrier. We call sycl::handler.depends_on for each of the provided events.

NDepEvents

Size of the DepEvents list.

Returns:

An opaque pointer to the sycl::event returned by the sycl::queue::submit_barrier() function.

DPCTL_C_EXTERN_C_BEGIN DPCTL_API void
DPCTLCString_Delete(__dpctl_take const char* str)

Deletes the C String argument.

Parameters:

str

C string to be deleted

DPCTL_API void
DPCTLSize_t_Array_Delete(__dpctl_take size_t* arr)

Deletes an array of size_t elements.

Parameters:

arr

Array to be deleted.

Macros

#define DPCTL_DECLARE_VECTOR_TYPE(EL)

Declare an opaque pointer type for a std::vector of opaque pointers wrapping SYCL data types.

#define HUGE_VALF

Represents a positive expression of type float.

#define INT64_MAX

Represents the largest possible value of a 64 bit signed integer.

#define INT64_MIN

Represents the smallest possible value of a 64 bit signed integer.

#define UINT64_MAX

Represents the largest possible value of a 64bit unsigned integer.