Core API
oneAPI Level Zero Specification - Version 1.4.3
Common
Enumerations
Structures
Common Enums
ze_result_t
-
enum ze_result_t
Defines Return/Error codes.
Values:
-
enumerator ZE_RESULT_SUCCESS
[Core] success
-
enumerator ZE_RESULT_NOT_READY
[Core] synchronization primitive not signaled
-
enumerator ZE_RESULT_ERROR_DEVICE_LOST
[Core] device hung, reset, was removed, or driver update occurred
-
enumerator ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
[Core] insufficient host memory to satisfy call
-
enumerator ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
[Core] insufficient device memory to satisfy call
-
enumerator ZE_RESULT_ERROR_MODULE_BUILD_FAILURE
[Core] error occurred when building module, see build log for details
-
enumerator ZE_RESULT_ERROR_MODULE_LINK_FAILURE
[Core] error occurred when linking modules, see build log for details
-
enumerator ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
[Core] device requires a reset
-
enumerator ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
[Core] device currently in low power state
-
enumerator ZE_RESULT_EXP_ERROR_DEVICE_IS_NOT_VERTEX
[Core, Expoerimental] device is not represented by a fabric vertex
-
enumerator ZE_RESULT_EXP_ERROR_VERTEX_IS_NOT_DEVICE
[Core, Experimental] fabric vertex does not represent a device
-
enumerator ZE_RESULT_EXP_ERROR_REMOTE_DEVICE
[Core, Expoerimental] fabric vertex represents a remote device or subdevice
-
enumerator ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
[Sysman] access denied due to permission level
-
enumerator ZE_RESULT_ERROR_NOT_AVAILABLE
[Sysman] resource already in use and simultaneous access not allowed or resource was removed
-
enumerator ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
[Tools] external required dependency is unavailable or missing
-
enumerator ZE_RESULT_WARNING_DROPPED_DATA
[Tools] data may have been dropped
-
enumerator ZE_RESULT_ERROR_UNINITIALIZED
[Validation] driver is not initialized
-
enumerator ZE_RESULT_ERROR_UNSUPPORTED_VERSION
[Validation] generic error code for unsupported versions
-
enumerator ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
[Validation] generic error code for unsupported features
-
enumerator ZE_RESULT_ERROR_INVALID_ARGUMENT
[Validation] generic error code for invalid arguments
-
enumerator ZE_RESULT_ERROR_INVALID_NULL_HANDLE
[Validation] handle argument is not valid
-
enumerator ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE
[Validation] object pointed to by handle still in-use by device
-
enumerator ZE_RESULT_ERROR_INVALID_NULL_POINTER
[Validation] pointer argument may not be nullptr
-
enumerator ZE_RESULT_ERROR_INVALID_SIZE
[Validation] size argument is invalid (e.g., must not be zero)
-
enumerator ZE_RESULT_ERROR_UNSUPPORTED_SIZE
[Validation] size argument is not supported by the device (e.g., too large)
-
enumerator ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT
too small)
[Validation] alignment argument is not supported by the device (e.g.,
-
enumerator ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
[Validation] synchronization object in invalid state
-
enumerator ZE_RESULT_ERROR_INVALID_ENUMERATION
[Validation] enumerator argument is not valid
-
enumerator ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
[Validation] enumerator argument is not supported by the device
-
enumerator ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT
[Validation] image format is not supported by the device
-
enumerator ZE_RESULT_ERROR_INVALID_NATIVE_BINARY
[Validation] native binary is not supported by the device
-
enumerator ZE_RESULT_ERROR_INVALID_GLOBAL_NAME
[Validation] global variable is not found in the module
-
enumerator ZE_RESULT_ERROR_INVALID_KERNEL_NAME
[Validation] kernel name is not found in the module
-
enumerator ZE_RESULT_ERROR_INVALID_FUNCTION_NAME
[Validation] function name is not found in the module
-
enumerator ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION
device
[Validation] group size dimension is not valid for the kernel or
-
enumerator ZE_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION
device
[Validation] global width dimension is not valid for the kernel or
-
enumerator ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX
[Validation] kernel argument index is not valid for kernel
-
enumerator ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE
[Validation] kernel argument size does not match kernel
-
enumerator ZE_RESULT_ERROR_INVALID_KERNEL_ATTRIBUTE_VALUE
device
[Validation] value of kernel attribute is not valid for the kernel or
-
enumerator ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED
be created from it.
[Validation] module with imports needs to be linked before kernels can
-
enumerator ZE_RESULT_ERROR_INVALID_COMMAND_LIST_TYPE
[Validation] command list type does not match command queue type
-
enumerator ZE_RESULT_ERROR_OVERLAPPING_REGIONS
memory
[Validation] copy operations do not support overlapping regions of
-
enumerator ZE_RESULT_WARNING_ACTION_REQUIRED
[Sysman] an action is required to complete the desired operation
-
enumerator ZE_RESULT_ERROR_UNKNOWN
[Core] unknown or internal error
-
enumerator ZE_RESULT_FORCE_UINT32
-
enumerator ZE_RESULT_SUCCESS
ze_structure_type_t
-
enum ze_structure_type_t
Defines structure types.
Values:
-
enumerator ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DRIVER_IPC_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_COMPUTE_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_COMMAND_QUEUE_GROUP_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_MEMORY_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_MEMORY_ACCESS_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_CACHE_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_IMAGE_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_P2P_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_EXTERNAL_MEMORY_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_CONTEXT_DESC
-
enumerator ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC
-
enumerator ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC
-
enumerator ZE_STRUCTURE_TYPE_EVENT_POOL_DESC
-
enumerator ZE_STRUCTURE_TYPE_EVENT_DESC
-
enumerator ZE_STRUCTURE_TYPE_FENCE_DESC
-
enumerator ZE_STRUCTURE_TYPE_IMAGE_DESC
-
enumerator ZE_STRUCTURE_TYPE_IMAGE_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC
-
enumerator ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC
-
enumerator ZE_STRUCTURE_TYPE_MEMORY_ALLOCATION_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_EXPORT_DESC
-
enumerator ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_FD
-
enumerator ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_EXPORT_FD
-
enumerator ZE_STRUCTURE_TYPE_MODULE_DESC
-
enumerator ZE_STRUCTURE_TYPE_MODULE_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_KERNEL_DESC
-
enumerator ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_SAMPLER_DESC
-
enumerator ZE_STRUCTURE_TYPE_PHYSICAL_MEM_DESC
-
enumerator ZE_STRUCTURE_TYPE_KERNEL_PREFERRED_GROUP_SIZE_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_WIN32
-
enumerator ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_EXPORT_WIN32
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_RAYTRACING_EXT_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_RAYTRACING_MEM_ALLOC_EXT_DESC
-
enumerator ZE_STRUCTURE_TYPE_FLOAT_ATOMIC_EXT_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_CACHE_RESERVATION_EXT_DESC
-
enumerator ZE_STRUCTURE_TYPE_EU_COUNT_EXT
-
enumerator ZE_STRUCTURE_TYPE_SRGB_EXT_DESC
-
enumerator ZE_STRUCTURE_TYPE_LINKAGE_INSPECTION_EXT_DESC
-
enumerator ZE_STRUCTURE_TYPE_PCI_EXT_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DRIVER_MEMORY_FREE_EXT_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_MEMORY_FREE_EXT_DESC
-
enumerator ZE_STRUCTURE_TYPE_MEMORY_COMPRESSION_HINTS_EXT_DESC
-
enumerator ZE_STRUCTURE_TYPE_IMAGE_ALLOCATION_EXT_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_LUID_EXT_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_MEMORY_EXT_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC
-
enumerator ZE_STRUCTURE_TYPE_MODULE_PROGRAM_EXP_DESC
-
enumerator ZE_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_DESC
-
enumerator ZE_STRUCTURE_TYPE_IMAGE_VIEW_PLANAR_EXP_DESC
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2
-
enumerator ZE_STRUCTURE_TYPE_IMAGE_MEMORY_EXP_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_POWER_SAVING_HINT_EXP_DESC
-
enumerator ZE_STRUCTURE_TYPE_COPY_BANDWIDTH_EXP_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_DEVICE_P2P_BANDWIDTH_EXP_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_FABRIC_VERTEX_EXP_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_FABRIC_EDGE_EXP_PROPERTIES
-
enumerator ZE_STRUCTURE_TYPE_FORCE_UINT32
-
enumerator ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES
ze_external_memory_type_flags_t
-
enum ze_external_memory_type_flag_t
Values:
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_FD
an opaque POSIX file descriptor handle
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF
a file descriptor handle for a Linux dma_buf
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32
an NT handle
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT
a global share (KMT) handle
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE
an NT handle referring to a Direct3D 10 or 11 texture resource
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE_KMT
resource
a global share (KMT) handle referring to a Direct3D 10 or 11 texture
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP
an NT handle referring to a Direct3D 12 heap resource
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE
an NT handle referring to a Direct3D 12 committed resource
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32
-
enumerator ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_FD
ze_bandwidth_unit_t
-
enum ze_bandwidth_unit_t
Bandwidth unit.
Values:
-
enumerator ZE_BANDWIDTH_UNIT_UNKNOWN
The unit used for bandwidth is unknown.
-
enumerator ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC
Bandwidth is provided in bytes/nanosec.
-
enumerator ZE_BANDWIDTH_UNIT_BYTES_PER_CLOCK
Bandwidth is provided in bytes/clock.
-
enumerator ZE_BANDWIDTH_UNIT_FORCE_UINT32
-
enumerator ZE_BANDWIDTH_UNIT_UNKNOWN
ze_latency_unit_t
-
enum ze_latency_unit_t
Latency unit.
Values:
-
enumerator ZE_LATENCY_UNIT_UNKNOWN
The unit used for latency is unknown.
-
enumerator ZE_LATENCY_UNIT_NANOSEC
Latency is provided in nanosecs.
-
enumerator ZE_LATENCY_UNIT_CLOCK
Latency is provided in clocks.
-
enumerator ZE_LATENCY_UNIT_HOP
Latency is provided in hops (normalized so that the lowest latency link has a latency of 1 hop)
-
enumerator ZE_LATENCY_UNIT_FORCE_UINT32
-
enumerator ZE_LATENCY_UNIT_UNKNOWN
Common Structures
ze_ipc_mem_handle_t
ze_ipc_event_pool_handle_t
ze_uuid_t
ze_base_properties_t
-
struct ze_base_properties_t
Base for all properties types.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_structure_type_t stype
ze_base_desc_t
-
struct ze_base_desc_t
Base for all descriptor types.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_structure_type_t stype
Driver
Functions
Enumerations
Structures
Driver Functions
zeInit
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeInit(ze_init_flags_t flags)
Initialize the ‘oneAPI’ driver(s)
The application must call this function before calling any other function.
If this function is not called then all other functions will return ZE_RESULT_ERROR_UNINITIALIZED.
Only one instance of each driver will be initialized per process.
The application may call this function multiple times with different flags or environment variables enabled.
The application must call this function after forking new processes. Each forked process must call this function.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe for scenarios where multiple libraries may initialize the driver(s) simultaneously.
- Parameters
flags – [in] initialization flags. must be 0 (default) or a combination of ze_init_flag_t.
- Returns
zeDriverGet
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGet(uint32_t *pCount, ze_driver_handle_t *phDrivers)
Retrieves driver instances.
A driver represents a collection of physical devices.
Multiple calls to this function will return identical driver handles, in the same order.
The application may pass nullptr for pDrivers when only querying the number of drivers.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clGetPlatformIDs
- Parameters
pCount – [in,out] pointer to the number of driver instances. if count is zero, then the loader shall update the value with the total number of drivers available. if count is greater than the number of drivers available, then the loader shall update the value with the correct number of drivers available.
phDrivers – [in,out][optional][range(0, *pCount)] array of driver instance handles. if count is less than the number of drivers available, then the loader shall only retrieve that number of drivers.
- Returns
zeDriverGetApiVersion
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetApiVersion(ze_driver_handle_t hDriver, ze_api_version_t *version)
Returns the API version supported by the specified driver.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDriver – [in] handle of the driver instance
version – [out] api version
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDriver
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == version
zeDriverGetProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetProperties(ze_driver_handle_t hDriver, ze_driver_properties_t *pDriverProperties)
Retrieves properties of the driver.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clGetPlatformInfo
- Parameters
hDriver – [in] handle of the driver instance
pDriverProperties – [in,out] query result for driver properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDriver
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pDriverProperties
zeDriverGetIpcProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetIpcProperties(ze_driver_handle_t hDriver, ze_driver_ipc_properties_t *pIpcProperties)
Retrieves IPC attributes of the driver.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDriver – [in] handle of the driver instance
pIpcProperties – [in,out] query result for IPC properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDriver
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pIpcProperties
zeDriverGetExtensionProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetExtensionProperties(ze_driver_handle_t hDriver, uint32_t *pCount, ze_driver_extension_properties_t *pExtensionProperties)
Retrieves extension properties.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkEnumerateInstanceExtensionProperties
- Parameters
hDriver – [in] handle of the driver instance
pCount – [in,out] pointer to the number of extension properties. if count is zero, then the driver shall update the value with the total number of extension properties available. if count is greater than the number of extension properties available, then the driver shall update the value with the correct number of extension properties available.
pExtensionProperties – [in,out][optional][range(0, *pCount)] array of query results for extension properties. if count is less than the number of extension properties available, then driver shall only retrieve that number of extension properties.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDriver
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pCount
zeDriverGetExtensionFunctionAddress
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetExtensionFunctionAddress(ze_driver_handle_t hDriver, const char *name, void **ppFunctionAddress)
Retrieves function pointer for vendor-specific or experimental extensions.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDriver – [in] handle of the driver instance
name – [in] extension function name
ppFunctionAddress – [out] pointer to function pointer
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDriver
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == name
nullptr == ppFunctionAddress
Driver Enums
ze_init_flags_t
ze_api_version_t
-
enum ze_api_version_t
Supported API versions.
API versions contain major and minor attributes, use ZE_MAJOR_VERSION and ZE_MINOR_VERSION
Values:
-
enumerator ZE_API_VERSION_1_0
version 1.0
-
enumerator ZE_API_VERSION_1_1
version 1.1
-
enumerator ZE_API_VERSION_1_2
version 1.2
-
enumerator ZE_API_VERSION_1_3
version 1.3
-
enumerator ZE_API_VERSION_1_4
version 1.4
-
enumerator ZE_API_VERSION_CURRENT
latest known version
-
enumerator ZE_API_VERSION_FORCE_UINT32
ze_ipc_property_flags_t
-
enum ze_ipc_property_flag_t
Values:
-
enumerator ZE_IPC_PROPERTY_FLAG_MEMORY
Supports passing memory allocations between processes. See zeMemGetIpcHandle.
-
enumerator ZE_IPC_PROPERTY_FLAG_EVENT_POOL
Supports passing event pools between processes. See zeEventPoolGetIpcHandle.
-
enumerator ZE_IPC_PROPERTY_FLAG_FORCE_UINT32
-
enumerator ZE_IPC_PROPERTY_FLAG_MEMORY
Driver Structures
ze_driver_uuid_t
ze_driver_properties_t
-
struct ze_driver_properties_t
Driver properties queried using zeDriverGetProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_driver_uuid_t uuid
[out] universal unique identifier.
-
uint32_t driverVersion
[out] driver version The driver version is a non-zero, monotonically increasing value where higher values always indicate a more recent version.
-
ze_structure_type_t stype
ze_driver_ipc_properties_t
-
struct ze_driver_ipc_properties_t
IPC properties queried using zeDriverGetIpcProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_ipc_property_flags_t flags
[out] 0 (none) or a valid combination of ze_ipc_property_flag_t
-
ze_structure_type_t stype
ze_driver_extension_properties_t
-
struct ze_driver_extension_properties_t
Extension properties queried using zeDriverGetExtensionProperties.
Device
Functions
Enumerations
Structures
Device Functions
zeDeviceGet
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGet(ze_driver_handle_t hDriver, uint32_t *pCount, ze_device_handle_t *phDevices)
Retrieves devices within a driver.
Multiple calls to this function will return identical device handles, in the same order.
The number and order of handles returned from this function is affected by the ::ZE_AFFINITY_MASK and ::ZE_ENABLE_PCI_ID_DEVICE_ORDER environment variables.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDriver – [in] handle of the driver instance
pCount – [in,out] pointer to the number of devices. if count is zero, then the driver shall update the value with the total number of devices available. if count is greater than the number of devices available, then the driver shall update the value with the correct number of devices available.
phDevices – [in,out][optional][range(0, *pCount)] array of handle of devices. if count is less than the number of devices available, then driver shall only retrieve that number of devices.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDriver
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pCount
zeDeviceGetSubDevices
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetSubDevices(ze_device_handle_t hDevice, uint32_t *pCount, ze_device_handle_t *phSubdevices)
Retrieves a sub-device from a device.
Multiple calls to this function will return identical device handles, in the same order.
The number of handles returned from this function is affected by the ::ZE_AFFINITY_MASK environment variable.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clCreateSubDevices
- Parameters
hDevice – [in] handle of the device object
pCount – [in,out] pointer to the number of sub-devices. if count is zero, then the driver shall update the value with the total number of sub-devices available. if count is greater than the number of sub-devices available, then the driver shall update the value with the correct number of sub-devices available.
phSubdevices – [in,out][optional][range(0, *pCount)] array of handle of sub-devices. if count is less than the number of sub-devices available, then driver shall only retrieve that number of sub-devices.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pCount
zeDeviceGetProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetProperties(ze_device_handle_t hDevice, ze_device_properties_t *pDeviceProperties)
Retrieves properties of the device.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clGetDeviceInfo
- Parameters
hDevice – [in] handle of the device
pDeviceProperties – [in,out] query result for device properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pDeviceProperties
zeDeviceGetComputeProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetComputeProperties(ze_device_handle_t hDevice, ze_device_compute_properties_t *pComputeProperties)
Retrieves compute properties of the device.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clGetDeviceInfo
- Parameters
hDevice – [in] handle of the device
pComputeProperties – [in,out] query result for compute properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pComputeProperties
zeDeviceGetModuleProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetModuleProperties(ze_device_handle_t hDevice, ze_device_module_properties_t *pModuleProperties)
Retrieves module properties of the device.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDevice – [in] handle of the device
pModuleProperties – [in,out] query result for module properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pModuleProperties
zeDeviceGetCommandQueueGroupProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetCommandQueueGroupProperties(ze_device_handle_t hDevice, uint32_t *pCount, ze_command_queue_group_properties_t *pCommandQueueGroupProperties)
Retrieves command queue group properties of the device.
Properties are reported for each physical command queue type supported by the device.
Multiple calls to this function will return properties in the same order.
The order in which the properties are returned defines the command queue group’s ordinal.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkGetPhysicalDeviceQueueFamilyProperties
- Parameters
hDevice – [in] handle of the device
pCount – [in,out] pointer to the number of command queue group properties. if count is zero, then the driver shall update the value with the total number of command queue group properties available. if count is greater than the number of command queue group properties available, then the driver shall update the value with the correct number of command queue group properties available.
pCommandQueueGroupProperties – [in,out][optional][range(0, *pCount)] array of query results for command queue group properties. if count is less than the number of command queue group properties available, then driver shall only retrieve that number of command queue group properties.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pCount
zeDeviceGetMemoryProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetMemoryProperties(ze_device_handle_t hDevice, uint32_t *pCount, ze_device_memory_properties_t *pMemProperties)
Retrieves local memory properties of the device.
Properties are reported for each physical memory type supported by the device.
Multiple calls to this function will return properties in the same order.
The order in which the properties are returned defines the device’s local memory ordinal.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clGetDeviceInfo
- Parameters
hDevice – [in] handle of the device
pCount – [in,out] pointer to the number of memory properties. if count is zero, then the driver shall update the value with the total number of memory properties available. if count is greater than the number of memory properties available, then the driver shall update the value with the correct number of memory properties available.
pMemProperties – [in,out][optional][range(0, *pCount)] array of query results for memory properties. if count is less than the number of memory properties available, then driver shall only retrieve that number of memory properties.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pCount
zeDeviceGetMemoryAccessProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetMemoryAccessProperties(ze_device_handle_t hDevice, ze_device_memory_access_properties_t *pMemAccessProperties)
Retrieves memory access properties of the device.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clGetDeviceInfo
- Parameters
hDevice – [in] handle of the device
pMemAccessProperties – [in,out] query result for memory access properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pMemAccessProperties
zeDeviceGetCacheProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetCacheProperties(ze_device_handle_t hDevice, uint32_t *pCount, ze_device_cache_properties_t *pCacheProperties)
Retrieves cache properties of the device.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clGetDeviceInfo
- Parameters
hDevice – [in] handle of the device
pCount – [in,out] pointer to the number of cache properties. if count is zero, then the driver shall update the value with the total number of cache properties available. if count is greater than the number of cache properties available, then the driver shall update the value with the correct number of cache properties available.
pCacheProperties – [in,out][optional][range(0, *pCount)] array of query results for cache properties. if count is less than the number of cache properties available, then driver shall only retrieve that number of cache properties.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pCount
zeDeviceGetImageProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetImageProperties(ze_device_handle_t hDevice, ze_device_image_properties_t *pImageProperties)
Retrieves image properties of the device.
See zeImageGetProperties for format-specific capabilities.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDevice – [in] handle of the device
pImageProperties – [in,out] query result for image properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pImageProperties
zeDeviceGetExternalMemoryProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetExternalMemoryProperties(ze_device_handle_t hDevice, ze_device_external_memory_properties_t *pExternalMemoryProperties)
Retrieves external memory import and export of the device.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDevice – [in] handle of the device
pExternalMemoryProperties – [in,out] query result for external memory properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pExternalMemoryProperties
zeDeviceGetP2PProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetP2PProperties(ze_device_handle_t hDevice, ze_device_handle_t hPeerDevice, ze_device_p2p_properties_t *pP2PProperties)
Retrieves peer-to-peer properties between one device and a peer devices.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDevice – [in] handle of the device performing the access
hPeerDevice – [in] handle of the peer device with the allocation
pP2PProperties – [in,out] Peer-to-Peer properties between source and peer device
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
nullptr == hPeerDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pP2PProperties
zeDeviceCanAccessPeer
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceCanAccessPeer(ze_device_handle_t hDevice, ze_device_handle_t hPeerDevice, ze_bool_t *value)
Queries if one device can directly access peer device allocations.
Any device can access any other device within a node through a scale-up fabric.
The following are conditions for CanAccessPeer query.
If both device and peer device are the same then return true.
If both sub-device and peer sub-device are the same then return true.
If both are sub-devices and share the same parent device then return true.
If both device and remote device are connected by a direct or indirect scale-up fabric or over PCIe (same root complex or shared PCIe switch) then true.
If both sub-device and remote parent device (and vice-versa) are connected by a direct or indirect scale-up fabric or over PCIe (same root complex or shared PCIe switch) then true.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDevice – [in] handle of the device performing the access
hPeerDevice – [in] handle of the peer device with the allocation
value – [out] returned access capability
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
nullptr == hPeerDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == value
zeDeviceGetStatus
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetStatus(ze_device_handle_t hDevice)
Returns current status of the device.
Once a device is reset, this call will update the OS handle attached to the device handle.
The application may call this function from simultaneous threads with the same device handle.
The implementation of this function must be thread-safe.
- Parameters
hDevice – [in] handle of the device
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
Device is available for use.
Device is lost; must be reset for use.
zeDeviceGetGlobalTimestamps
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps(ze_device_handle_t hDevice, uint64_t *hostTimestamp, uint64_t *deviceTimestamp)
Returns synchronized Host and device global timestamps.
The application may call this function from simultaneous threads with the same device handle.
The implementation of this function must be thread-safe.
- Parameters
hDevice – [in] handle of the device
hostTimestamp – [out] value of the Host’s global timestamp that correlates with the Device’s global timestamp value
deviceTimestamp – [out] value of the Device’s global timestamp that correlates with the Host’s global timestamp value
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == hostTimestamp
nullptr == deviceTimestamp
Device Enums
ze_device_type_t
-
enum ze_device_type_t
Supported device types.
Values:
-
enumerator ZE_DEVICE_TYPE_GPU
Graphics Processing Unit.
-
enumerator ZE_DEVICE_TYPE_CPU
Central Processing Unit.
-
enumerator ZE_DEVICE_TYPE_FPGA
Field Programmable Gate Array.
-
enumerator ZE_DEVICE_TYPE_MCA
Memory Copy Accelerator.
-
enumerator ZE_DEVICE_TYPE_VPU
Vision Processing Unit.
-
enumerator ZE_DEVICE_TYPE_FORCE_UINT32
-
enumerator ZE_DEVICE_TYPE_GPU
ze_device_property_flags_t
-
enum ze_device_property_flag_t
Values:
-
enumerator ZE_DEVICE_PROPERTY_FLAG_INTEGRATED
Device is integrated with the Host.
-
enumerator ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE
Device handle used for query represents a sub-device.
-
enumerator ZE_DEVICE_PROPERTY_FLAG_ECC
Device supports error correction memory access.
-
enumerator ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING
Device supports on-demand page-faulting.
-
enumerator ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32
-
enumerator ZE_DEVICE_PROPERTY_FLAG_INTEGRATED
ze_device_module_flags_t
-
enum ze_device_module_flag_t
Values:
-
enumerator ZE_DEVICE_MODULE_FLAG_FP16
Device supports 16-bit floating-point operations.
-
enumerator ZE_DEVICE_MODULE_FLAG_FP64
Device supports 64-bit floating-point operations.
-
enumerator ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS
Device supports 64-bit atomic operations.
-
enumerator ZE_DEVICE_MODULE_FLAG_DP4A
Device supports four component dot product and accumulate operations.
-
enumerator ZE_DEVICE_MODULE_FLAG_FORCE_UINT32
-
enumerator ZE_DEVICE_MODULE_FLAG_FP16
ze_device_fp_flags_t
-
enum ze_device_fp_flag_t
Values:
-
enumerator ZE_DEVICE_FP_FLAG_DENORM
Supports denorms.
-
enumerator ZE_DEVICE_FP_FLAG_INF_NAN
Supports INF and quiet NaNs.
-
enumerator ZE_DEVICE_FP_FLAG_ROUND_TO_NEAREST
Supports rounding to nearest even rounding mode.
-
enumerator ZE_DEVICE_FP_FLAG_ROUND_TO_ZERO
Supports rounding to zero.
-
enumerator ZE_DEVICE_FP_FLAG_ROUND_TO_INF
Supports rounding to both positive and negative INF.
-
enumerator ZE_DEVICE_FP_FLAG_FMA
Supports IEEE754-2008 fused multiply-add.
-
enumerator ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT
operations.
Supports rounding as defined by IEEE754 for divide and sqrt
-
enumerator ZE_DEVICE_FP_FLAG_SOFT_FLOAT
Uses software implementation for basic floating-point operations.
-
enumerator ZE_DEVICE_FP_FLAG_FORCE_UINT32
-
enumerator ZE_DEVICE_FP_FLAG_DENORM
ze_command_queue_group_property_flags_t
-
enum ze_command_queue_group_property_flag_t
Values:
-
enumerator ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE
Command queue group supports enqueing compute commands.
-
enumerator ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY
Command queue group supports enqueing copy commands.
-
enumerator ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS
See zeCommandListAppendLaunchCooperativeKernel for more details.
Command queue group supports cooperative kernels.
-
enumerator ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS
Command queue groups supports metric queries.
-
enumerator ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32
-
enumerator ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE
ze_device_memory_property_flags_t
ze_memory_access_cap_flags_t
-
enum ze_memory_access_cap_flag_t
Values:
-
enumerator ZE_MEMORY_ACCESS_CAP_FLAG_RW
Supports load/store access.
-
enumerator ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC
Supports atomic access.
-
enumerator ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT
Supports concurrent access.
-
enumerator ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC
Supports concurrent atomic access.
-
enumerator ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32
-
enumerator ZE_MEMORY_ACCESS_CAP_FLAG_RW
ze_device_cache_property_flags_t
ze_device_p2p_property_flags_t
Device Structures
ze_device_uuid_t
ze_device_properties_t
-
struct ze_device_properties_t
Device properties queried using zeDeviceGetProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_device_type_t type
[out] generic device type
-
uint32_t vendorId
[out] vendor id from PCI configuration
-
uint32_t deviceId
[out] device id from PCI configuration
-
ze_device_property_flags_t flags
[out] 0 (none) or a valid combination of ze_device_property_flag_t
-
uint32_t subdeviceId
[out] sub-device id. Only valid if ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE is set.
-
uint32_t coreClockRate
[out] Clock rate for device core.
-
uint64_t maxMemAllocSize
[out] Maximum memory allocation size.
-
uint32_t maxHardwareContexts
[out] Maximum number of logical hardware contexts.
-
uint32_t maxCommandQueuePriority
[out] Maximum priority for command queues. Higher value is higher priority.
-
uint32_t numThreadsPerEU
[out] Maximum number of threads per EU.
-
uint32_t physicalEUSimdWidth
[out] The physical EU simd width.
-
uint32_t numEUsPerSubslice
[out] Maximum number of EUs per sub-slice.
-
uint32_t numSubslicesPerSlice
[out] Maximum number of sub-slices per slice.
-
uint32_t numSlices
[out] Maximum number of slices.
-
uint64_t timerResolution
[out] Returns the resolution of device timer used for profiling, timestamps, etc. When stype==ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES the units are in nanoseconds. When stype==ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 units are in cycles/sec
-
uint32_t timestampValidBits
[out] Returns the number of valid bits in the timestamp value.
-
uint32_t kernelTimestampValidBits
[out] Returns the number of valid bits in the kernel timestamp values
-
ze_device_uuid_t uuid
[out] universal unique identifier. Note: Subdevices will have their own uuid.
-
char name[ZE_MAX_DEVICE_NAME]
[out] Device name
-
ze_structure_type_t stype
ze_device_thread_t
-
struct ze_device_thread_t
Device thread identifier.
Public Members
-
uint32_t slice
[in,out] the slice number. Must be UINT32_MAX (all) or less than ze_device_properties_t.numSlices.
-
uint32_t subslice
[in,out] the sub-slice number within its slice. Must be UINT32_MAX (all) or less than ze_device_properties_t.numSubslicesPerSlice.
-
uint32_t eu
[in,out] the EU number within its sub-slice. Must be UINT32_MAX (all) or less than ze_device_properties_t.numEUsPerSubslice.
-
uint32_t thread
[in,out] the thread number within its EU. Must be UINT32_MAX (all) or less than ze_device_properties_t.numThreadsPerEU.
-
uint32_t slice
ze_device_compute_properties_t
-
struct ze_device_compute_properties_t
Device compute properties queried using zeDeviceGetComputeProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
uint32_t maxTotalGroupSize
[out] Maximum items per compute group. (groupSizeX * groupSizeY * groupSizeZ) <= maxTotalGroupSize
-
uint32_t maxGroupSizeX
[out] Maximum items for X dimension in group
-
uint32_t maxGroupSizeY
[out] Maximum items for Y dimension in group
-
uint32_t maxGroupSizeZ
[out] Maximum items for Z dimension in group
-
uint32_t maxGroupCountX
[out] Maximum groups that can be launched for x dimension
-
uint32_t maxGroupCountY
[out] Maximum groups that can be launched for y dimension
-
uint32_t maxGroupCountZ
[out] Maximum groups that can be launched for z dimension
[out] Maximum shared local memory per group.
-
uint32_t numSubGroupSizes
[out] Number of subgroup sizes supported. This indicates number of entries in subGroupSizes.
-
uint32_t subGroupSizes[ZE_SUBGROUPSIZE_COUNT]
[out] Size group sizes supported.
-
ze_structure_type_t stype
ze_native_kernel_uuid_t
ze_device_module_properties_t
-
struct ze_device_module_properties_t
Device module properties queried using zeDeviceGetModuleProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
uint32_t spirvVersionSupported
[out] Maximum supported SPIR-V version. Returns zero if SPIR-V is not supported. Contains major and minor attributes, use ZE_MAJOR_VERSION and ZE_MINOR_VERSION.
-
ze_device_module_flags_t flags
[out] 0 or a valid combination of ze_device_module_flag_t
-
ze_device_fp_flags_t fp16flags
[out] Capabilities for half-precision floating-point operations. returns 0 (if ZE_DEVICE_MODULE_FLAG_FP16 is not set) or a combination of ze_device_fp_flag_t.
-
ze_device_fp_flags_t fp32flags
[out] Capabilities for single-precision floating-point operations. returns a combination of ze_device_fp_flag_t.
-
ze_device_fp_flags_t fp64flags
[out] Capabilities for double-precision floating-point operations. returns 0 (if ZE_DEVICE_MODULE_FLAG_FP64 is not set) or a combination of ze_device_fp_flag_t.
-
uint32_t maxArgumentsSize
[out] Maximum kernel argument size that is supported.
-
uint32_t printfBufferSize
[out] Maximum size of internal buffer that holds output of printf calls from kernel.
-
ze_native_kernel_uuid_t nativeKernelSupported
[out] Compatibility UUID of supported native kernel. UUID may or may not be the same across driver release, devices, or operating systems. Application is responsible for ensuring UUID matches before creating module using previously created native kernel.
-
ze_structure_type_t stype
ze_command_queue_group_properties_t
-
struct ze_command_queue_group_properties_t
Command queue group properties queried using zeDeviceGetCommandQueueGroupProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_command_queue_group_property_flags_t flags
[out] 0 (none) or a valid combination of ze_command_queue_group_property_flag_t
-
size_t maxMemoryFillPatternSize
[out] maximum
pattern_size
supported by command queue group. See zeCommandListAppendMemoryFill for more details.
-
uint32_t numQueues
[out] the number of physical engines within the group.
-
ze_structure_type_t stype
ze_device_memory_properties_t
-
struct ze_device_memory_properties_t
Device local memory properties queried using zeDeviceGetMemoryProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_device_memory_property_flags_t flags
[out] 0 (none) or a valid combination of ze_device_memory_property_flag_t
-
uint32_t maxClockRate
[out] Maximum clock rate for device memory.
-
uint32_t maxBusWidth
[out] Maximum bus width between device and memory.
-
uint64_t totalSize
[out] Total memory size in bytes that is available to the device.
-
char name[ZE_MAX_DEVICE_NAME]
[out] Memory name
-
ze_structure_type_t stype
ze_device_memory_access_properties_t
-
struct ze_device_memory_access_properties_t
Device memory access properties queried using zeDeviceGetMemoryAccessProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_memory_access_cap_flags_t hostAllocCapabilities
returns 0 (unsupported) or a combination of ze_memory_access_cap_flag_t.
[out] host memory capabilities.
-
ze_memory_access_cap_flags_t deviceAllocCapabilities
returns 0 (unsupported) or a combination of ze_memory_access_cap_flag_t.
[out] device memory capabilities.
returns 0 (unsupported) or a combination of ze_memory_access_cap_flag_t.
[out] shared, single-device memory capabilities.
returns 0 (unsupported) or a combination of ze_memory_access_cap_flag_t.
[out] shared, cross-device memory capabilities.
returns 0 (unsupported) or a combination of ze_memory_access_cap_flag_t.
[out] shared, system memory capabilities.
-
ze_structure_type_t stype
ze_device_cache_properties_t
-
struct ze_device_cache_properties_t
Device cache properties queried using zeDeviceGetCacheProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_device_cache_property_flags_t flags
[out] 0 (none) or a valid combination of ze_device_cache_property_flag_t
-
size_t cacheSize
[out] Per-cache size, in bytes
-
ze_structure_type_t stype
ze_device_image_properties_t
-
struct ze_device_image_properties_t
Device image properties queried using zeDeviceGetImageProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
uint32_t maxImageDims1D
[out] Maximum image dimensions for 1D resources. if 0, then 1D images are unsupported.
-
uint32_t maxImageDims2D
[out] Maximum image dimensions for 2D resources. if 0, then 2D images are unsupported.
-
uint32_t maxImageDims3D
[out] Maximum image dimensions for 3D resources. if 0, then 3D images are unsupported.
-
uint64_t maxImageBufferSize
[out] Maximum image buffer size in bytes. if 0, then buffer images are unsupported.
-
uint32_t maxImageArraySlices
[out] Maximum image array slices. if 0, then image arrays are unsupported.
-
uint32_t maxSamplers
[out] Max samplers that can be used in kernel. if 0, then sampling is unsupported.
-
uint32_t maxReadImageArgs
[out] Returns the maximum number of simultaneous image objects that can be read from by a kernel. if 0, then reading images is unsupported.
-
uint32_t maxWriteImageArgs
[out] Returns the maximum number of simultaneous image objects that can be written to by a kernel. if 0, then writing images is unsupported.
-
ze_structure_type_t stype
ze_device_external_memory_properties_t
-
struct ze_device_external_memory_properties_t
Device external memory import and export properties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_external_memory_type_flags_t memoryAllocationImportTypes
[out] Supported external memory import types for memory allocations.
-
ze_external_memory_type_flags_t memoryAllocationExportTypes
[out] Supported external memory export types for memory allocations.
-
ze_external_memory_type_flags_t imageImportTypes
[out] Supported external memory import types for images.
-
ze_external_memory_type_flags_t imageExportTypes
[out] Supported external memory export types for images.
-
ze_structure_type_t stype
ze_device_p2p_properties_t
-
struct ze_device_p2p_properties_t
Device peer-to-peer properties queried using zeDeviceGetP2PProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_device_p2p_property_flags_t flags
[out] 0 (none) or a valid combination of ze_device_p2p_property_flag_t
-
ze_structure_type_t stype
Context
Functions
Enumerations
Structures
Context Functions
zeContextCreate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextCreate(ze_driver_handle_t hDriver, const ze_context_desc_t *desc, ze_context_handle_t *phContext)
Creates a context for the driver.
The application must only use the context for the driver which was provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hDriver – [in] handle of the driver object
desc – [in] pointer to context descriptor
phContext – [out] pointer to handle of context object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDriver
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == phContext
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x1 < desc->flags
zeContextCreateEx
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextCreateEx(ze_driver_handle_t hDriver, const ze_context_desc_t *desc, uint32_t numDevices, ze_device_handle_t *phDevices, ze_context_handle_t *phContext)
Creates a context for the driver.
The application must only use the context for the driver which was provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hDriver – [in] handle of the driver object
desc – [in] pointer to context descriptor
numDevices – [in][optional] number of device handles; must be 0 if `nullptr == phDevices`
phDevices – [in][optional][range(0, numDevices)] array of device handles which context has visibility. if nullptr, then all devices supported by the driver instance are visible to the context. otherwise, context only has visibility to devices in this array.
phContext – [out] pointer to handle of context object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDriver
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == phContext
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x1 < desc->flags
(nullptr == phDevices) && (0 < numDevices)
zeContextDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextDestroy(ze_context_handle_t hContext)
Destroys a context.
The application must ensure the device is not currently referencing the context before it is deleted.
The implementation of this function may immediately free all Host and Device allocations associated with this context.
The application must not call this function from simultaneous threads with the same context handle.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in][release] handle of context object to destroy
- Returns
zeContextGetStatus
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextGetStatus(ze_context_handle_t hContext)
Returns current status of the context.
The application may call this function from simultaneous threads with the same context handle.
The implementation of this function should be lock-free.
- Parameters
hContext – [in] handle of context object
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
Context is available for use.
Context is invalid; due to device lost or reset.
Context Enums
Context Structures
ze_context_desc_t
-
struct ze_context_desc_t
Context descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_context_flags_t flags
[in] creation flags. must be 0 (default) or a valid combination of ze_context_flag_t; default behavior may use implicit driver-based heuristics.
-
ze_structure_type_t stype
Cmdqueue
Functions
Enumerations
Structures
Cmdqueue Functions
zeCommandQueueCreate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_queue_desc_t *desc, ze_command_queue_handle_t *phCommandQueue)
Creates a command queue on the context.
A command queue represents a logical input stream to the device, tied to a physical input stream.
The application must only use the command queue for the device, or its sub-devices, which was provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
Remark
Analogues
clCreateCommandQueue
- Parameters
hContext – [in] handle of the context object
hDevice – [in] handle of the device object
desc – [in] pointer to command queue descriptor
phCommandQueue – [out] pointer to handle of command queue object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == phCommandQueue
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x1 < desc->flags
ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < desc->mode
ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < desc->priority
zeCommandQueueDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueDestroy(ze_command_queue_handle_t hCommandQueue)
Destroys a command queue.
The application must destroy all fence handles created from the command queue before destroying the command queue itself
The application must ensure the device is not currently referencing the command queue before it is deleted
The implementation of this function may immediately free all Host and Device allocations associated with this command queue
The application must not call this function from simultaneous threads with the same command queue handle.
The implementation of this function must be thread-safe.
Remark
Analogues
clReleaseCommandQueue
- Parameters
hCommandQueue – [in][release] handle of command queue object to destroy
- Returns
zeCommandQueueExecuteCommandLists
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueExecuteCommandLists(ze_command_queue_handle_t hCommandQueue, uint32_t numCommandLists, ze_command_list_handle_t *phCommandLists, ze_fence_handle_t hFence)
Executes a command list in a command queue.
The command lists are submitted to the device in the order they are received, whether from multiple calls (on the same or different threads) or a single call with multiple command lists.
The application must ensure the command lists are accessible by the device on which the command queue was created.
The application must ensure the device is not currently referencing the command list since the implementation is allowed to modify the contents of the command list for submission.
The application must only execute command lists created with an identical command queue group ordinal to the command queue.
The application must use a fence created using the same command queue.
The application must ensure the command queue, command list and fence were created on the same context.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkQueueSubmit
- Parameters
hCommandQueue – [in] handle of the command queue
numCommandLists – [in] number of command lists to execute
phCommandLists – [in][range(0, numCommandLists)] list of handles of the command lists to execute
hFence – [in][optional] handle of the fence to signal on completion
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandQueue
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == phCommandLists
0 == numCommandLists
zeCommandQueueSynchronize
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueSynchronize(ze_command_queue_handle_t hCommandQueue, uint64_t timeout)
Synchronizes a command queue by waiting on the host.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hCommandQueue – [in] handle of the command queue
timeout – [in] if non-zero, then indicates the maximum time (in nanoseconds) to yield before returning ZE_RESULT_SUCCESS or ZE_RESULT_NOT_READY; if zero, then immediately returns the status of the command queue; if UINT64_MAX, then function will not return until complete or device is lost. Due to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandQueue
timeout expired
Cmdqueue Enums
ze_command_queue_flags_t
-
enum ze_command_queue_flag_t
Values:
-
enumerator ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY
command queue should be optimized for submission to a single device engine. driver must disable any implicit optimizations for distributing work across multiple engines. this flag should be used when applications want full control over multi-engine submission and scheduling.
-
enumerator ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32
-
enumerator ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY
ze_command_queue_mode_t
-
enum ze_command_queue_mode_t
Supported command queue modes.
Values:
-
enumerator ZE_COMMAND_QUEUE_MODE_DEFAULT
implicit default behavior; uses driver-based heuristics
-
enumerator ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS
Device execution always completes immediately on execute; Host thread is blocked using wait on implicit synchronization object
-
enumerator ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS
Device execution is scheduled and will complete in future; explicit synchronization object must be used to determine completeness
-
enumerator ZE_COMMAND_QUEUE_MODE_FORCE_UINT32
-
enumerator ZE_COMMAND_QUEUE_MODE_DEFAULT
ze_command_queue_priority_t
-
enum ze_command_queue_priority_t
Supported command queue priorities.
Values:
-
enumerator ZE_COMMAND_QUEUE_PRIORITY_NORMAL
[default] normal priority
-
enumerator ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW
lower priority than normal
-
enumerator ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH
higher priority than normal
-
enumerator ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32
-
enumerator ZE_COMMAND_QUEUE_PRIORITY_NORMAL
Cmdqueue Structures
ze_command_queue_desc_t
-
struct ze_command_queue_desc_t
Command Queue descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
uint32_t ordinal
[in] command queue group ordinal
-
uint32_t index
[in] command queue index within the group; must be zero if ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set
-
ze_command_queue_flags_t flags
[in] usage flags. must be 0 (default) or a valid combination of ze_command_queue_flag_t; default behavior may use implicit driver-based heuristics to balance latency and throughput.
-
ze_command_queue_mode_t mode
[in] operation mode
-
ze_command_queue_priority_t priority
[in] priority
-
ze_structure_type_t stype
Cmdlist
Functions
Enumerations
Structures
Cmdlist Functions
zeCommandListCreate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_list_desc_t *desc, ze_command_list_handle_t *phCommandList)
Creates a command list on the context.
A command list represents a sequence of commands for execution on a command queue.
The command list is created in the ‘open’ state.
The application must only use the command list for the device, or its sub-devices, which was provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
hDevice – [in] handle of the device object
desc – [in] pointer to command list descriptor
phCommandList – [out] pointer to handle of command list object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == phCommandList
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x7 < desc->flags
zeCommandListCreateImmediate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListCreateImmediate(ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_queue_desc_t *altdesc, ze_command_list_handle_t *phCommandList)
Creates an immediate command list on the context.
An immediate command list is used for low-latency submission of commands.
An immediate command list creates an implicit command queue.
The command list is created in the ‘open’ state and never needs to be closed.
The application must only use the command list for the device, or its sub-devices, which was provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
hDevice – [in] handle of the device object
altdesc – [in] pointer to command queue descriptor
phCommandList – [out] pointer to handle of command list object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == altdesc
nullptr == phCommandList
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x1 < altdesc->flags
ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < altdesc->mode
ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < altdesc->priority
zeCommandListDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListDestroy(ze_command_list_handle_t hCommandList)
Destroys a command list.
The application must ensure the device is not currently referencing the command list before it is deleted.
The implementation of this function may immediately free all Host and Device allocations associated with this command list.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function must be thread-safe.
- Parameters
hCommandList – [in][release] handle of command list object to destroy
- Returns
zeCommandListClose
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListClose(ze_command_list_handle_t hCommandList)
Closes a command list; ready to be executed by a command queue.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of command list object to close
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
zeCommandListReset
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListReset(ze_command_list_handle_t hCommandList)
Reset a command list to initial (empty) state; ready for appending commands.
The application must ensure the device is not currently referencing the command list before it is reset
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of command list object to reset
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
zeCommandListAppendWriteGlobalTimestamp
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendWriteGlobalTimestamp(ze_command_list_handle_t hCommandList, uint64_t *dstptr, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Appends a memory write of the device’s global timestamp value into a command list.
The application must ensure the events are accessible by the device on which the command list was created.
The timestamp frequency can be queried from ze_device_properties_t.timerResolution.
The number of valid bits in the timestamp value can be queried from ze_device_properties_t.timestampValidBits.
The application must ensure the memory pointed to by dstptr is accessible by the device on which the command list was created.
The application must ensure the command list and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of the command list
dstptr – [in,out] pointer to memory where timestamp value will be written; must be 8byte-aligned.
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before executing query; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before executing query
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == dstptr
(nullptr == phWaitEvents) && (0 < numWaitEvents)
Cmdlist Enums
ze_command_list_flags_t
-
enum ze_command_list_flag_t
Values:
-
enumerator ZE_COMMAND_LIST_FLAG_RELAXED_ORDERING
driver may reorder commands (e.g., kernels, copies) between barriers and synchronization primitives. using this flag may increase Host overhead of zeCommandListClose. therefore, this flag should not be set for low-latency usage-models.
-
enumerator ZE_COMMAND_LIST_FLAG_MAXIMIZE_THROUGHPUT
driver may perform additional optimizations that increase execution throughput. using this flag may increase Host overhead of zeCommandListClose and zeCommandQueueExecuteCommandLists. therefore, this flag should not be set for low-latency usage-models.
-
enumerator ZE_COMMAND_LIST_FLAG_EXPLICIT_ONLY
command list should be optimized for submission to a single command queue and device engine. driver must disable any implicit optimizations for distributing work across multiple engines. this flag should be used when applications want full control over multi-engine submission and scheduling.
-
enumerator ZE_COMMAND_LIST_FLAG_FORCE_UINT32
-
enumerator ZE_COMMAND_LIST_FLAG_RELAXED_ORDERING
Cmdlist Structures
ze_command_list_desc_t
-
struct ze_command_list_desc_t
Command List descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
uint32_t commandQueueGroupOrdinal
[in] command queue group ordinal to which this command list will be submitted
-
ze_command_list_flags_t flags
[in] usage flags. must be 0 (default) or a valid combination of ze_command_list_flag_t; default behavior may use implicit driver-based heuristics to balance latency and throughput.
-
ze_structure_type_t stype
Barrier
Functions
Barrier Functions
zeCommandListAppendBarrier
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendBarrier(ze_command_list_handle_t hCommandList, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Appends an execution and global memory barrier into a command list.
The application must ensure the events are accessible by the device on which the command list was created.
If numWaitEvents is zero, then all previous commands, enqueued on same command queue, must complete prior to the execution of the barrier. This is not the case when numWaitEvents is non-zero.
If numWaitEvents is non-zero, then only all phWaitEvents must be signaled prior to the execution of the barrier.
This command blocks all following commands from beginning until the execution of the barrier completes.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
vkCmdPipelineBarrier
clEnqueueBarrierWithWaitList
- Parameters
hCommandList – [in] handle of the command list
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before executing barrier; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before executing barrier
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendMemoryRangesBarrier
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryRangesBarrier(ze_command_list_handle_t hCommandList, uint32_t numRanges, const size_t *pRangeSizes, const void **pRanges, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Appends a global memory ranges barrier into a command list.
The application must ensure the events are accessible by the device on which the command list was created.
If numWaitEvents is zero, then all previous commands are completed prior to the execution of the barrier.
If numWaitEvents is non-zero, then then all phWaitEvents must be signaled prior to the execution of the barrier.
This command blocks all following commands from beginning until the execution of the barrier completes.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of the command list
numRanges – [in] number of memory ranges
pRangeSizes – [in][range(0, numRanges)] array of sizes of memory range
pRanges – [in][range(0, numRanges)] array of memory ranges
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before executing barrier; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before executing barrier
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pRangeSizes
nullptr == pRanges
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeContextSystemBarrier
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextSystemBarrier(ze_context_handle_t hContext, ze_device_handle_t hDevice)
Ensures in-bound writes to the device are globally observable.
This is a special-case system level barrier that can be used to ensure global observability of writes; typically needed after a producer (e.g., NIC) performs direct writes to the device’s memory (e.g., Direct RDMA writes). This is typically required when the memory corresponding to the writes is subsequently accessed from a remote device.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hContext – [in] handle of context object
hDevice – [in] handle of the device
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
nullptr == hDevice
Copy
Functions
Enumerations
Structures
Copy Functions
zeCommandListAppendMemoryCopy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryCopy(ze_command_list_handle_t hCommandList, void *dstptr, const void *srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Copies host, device, or shared memory.
The application must ensure the memory pointed to by dstptr and srcptr is accessible by the device on which the command list was created.
The implementation must not access the memory pointed to by dstptr and srcptr as they are free to be modified by either the Host or device up until execution.
The application must ensure the events are accessible by the device on which the command list was created.
The application must ensure the command list and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
clEnqueueCopyBuffer
clEnqueueReadBuffer
clEnqueueWriteBuffer
clEnqueueSVMMemcpy
- Parameters
hCommandList – [in] handle of command list
dstptr – [in] pointer to destination memory to copy to
srcptr – [in] pointer to source memory to copy from
size – [in] size in bytes to copy
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == dstptr
nullptr == srcptr
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendMemoryFill
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryFill(ze_command_list_handle_t hCommandList, void *ptr, const void *pattern, size_t pattern_size, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Initializes host, device, or shared memory.
The application must ensure the memory pointed to by dstptr is accessible by the device on which the command list was created.
The implementation must not access the memory pointed to by dstptr as it is free to be modified by either the Host or device up until execution.
The value to initialize memory to is described by the pattern and the pattern size.
The pattern size must be a power-of-two and less than or equal to ze_command_queue_group_properties_t.maxMemoryFillPatternSize.
The application must ensure the events are accessible by the device on which the command list was created.
The application must ensure the command list and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
clEnqueueFillBuffer
clEnqueueSVMMemFill
- Parameters
hCommandList – [in] handle of command list
ptr – [in] pointer to memory to initialize
pattern – [in] pointer to value to initialize memory to
pattern_size – [in] size in bytes of the value to initialize memory to
size – [in] size in bytes to initialize
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == ptr
nullptr == pattern
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendMemoryCopyRegion
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryCopyRegion(ze_command_list_handle_t hCommandList, void *dstptr, const ze_copy_region_t *dstRegion, uint32_t dstPitch, uint32_t dstSlicePitch, const void *srcptr, const ze_copy_region_t *srcRegion, uint32_t srcPitch, uint32_t srcSlicePitch, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Copies a region from a 2D or 3D array of host, device, or shared memory.
The application must ensure the memory pointed to by dstptr and srcptr is accessible by the device on which the command list was created.
The implementation must not access the memory pointed to by dstptr and srcptr as they are free to be modified by either the Host or device up until execution.
The region width, height, and depth for both src and dst must be same. The origins can be different.
The src and dst regions cannot be overlapping.
The application must ensure the events are accessible by the device on which the command list was created.
The application must ensure the command list and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of command list
dstptr – [in] pointer to destination memory to copy to
dstRegion – [in] pointer to destination region to copy to
dstPitch – [in] destination pitch in bytes
dstSlicePitch – [in] destination slice pitch in bytes. This is required for 3D region copies where ze_copy_region_t.depth is not 0, otherwise it’s ignored.
srcptr – [in] pointer to source memory to copy from
srcRegion – [in] pointer to source region to copy from
srcPitch – [in] source pitch in bytes
srcSlicePitch – [in] source slice pitch in bytes. This is required for 3D region copies where ze_copy_region_t.depth is not 0, otherwise it’s ignored.
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == dstptr
nullptr == dstRegion
nullptr == srcptr
nullptr == srcRegion
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendMemoryCopyFromContext
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryCopyFromContext(ze_command_list_handle_t hCommandList, void *dstptr, ze_context_handle_t hContextSrc, const void *srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Copies host, device, or shared memory from another context.
The current active and source context must be from the same driver.
The application must ensure the memory pointed to by dstptr and srcptr is accessible by the device on which the command list was created.
The implementation must not access the memory pointed to by dstptr and srcptr as they are free to be modified by either the Host or device up until execution.
The application must ensure the events are accessible by the device on which the command list was created.
The application must ensure the command list and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of command list
dstptr – [in] pointer to destination memory to copy to
hContextSrc – [in] handle of source context object
srcptr – [in] pointer to source memory to copy from
size – [in] size in bytes to copy
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
nullptr == hContextSrc
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == dstptr
nullptr == srcptr
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendImageCopy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendImageCopy(ze_command_list_handle_t hCommandList, ze_image_handle_t hDstImage, ze_image_handle_t hSrcImage, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Copies an image.
The application must ensure the image and events are accessible by the device on which the command list was created.
The application must ensure the image format descriptors for both source and destination images are the same.
The application must ensure the command list, images and events were created on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
clEnqueueCopyImage
- Parameters
hCommandList – [in] handle of command list
hDstImage – [in] handle of destination image to copy to
hSrcImage – [in] handle of source image to copy from
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
nullptr == hDstImage
nullptr == hSrcImage
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendImageCopyRegion
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendImageCopyRegion(ze_command_list_handle_t hCommandList, ze_image_handle_t hDstImage, ze_image_handle_t hSrcImage, const ze_image_region_t *pDstRegion, const ze_image_region_t *pSrcRegion, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Copies a region of an image to another image.
The application must ensure the image and events are accessible by the device on which the command list was created.
The region width and height for both src and dst must be same. The origins can be different.
The src and dst regions cannot be overlapping.
The application must ensure the image format descriptors for both source and destination images are the same.
The application must ensure the command list, images and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of command list
hDstImage – [in] handle of destination image to copy to
hSrcImage – [in] handle of source image to copy from
pDstRegion – [in][optional] destination region descriptor
pSrcRegion – [in][optional] source region descriptor
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
nullptr == hDstImage
nullptr == hSrcImage
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendImageCopyToMemory
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendImageCopyToMemory(ze_command_list_handle_t hCommandList, void *dstptr, ze_image_handle_t hSrcImage, const ze_image_region_t *pSrcRegion, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Copies from an image to device or shared memory.
The application must ensure the memory pointed to by dstptr is accessible by the device on which the command list was created.
The implementation must not access the memory pointed to by dstptr as it is free to be modified by either the Host or device up until execution.
The application must ensure the image and events are accessible by the device on which the command list was created.
The application must ensure the image format descriptor for the source image is a single-planar format.
The application must ensure the command list, image and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
clEnqueueReadImage
- Parameters
hCommandList – [in] handle of command list
dstptr – [in] pointer to destination memory to copy to
hSrcImage – [in] handle of source image to copy from
pSrcRegion – [in][optional] source region descriptor
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
nullptr == hSrcImage
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == dstptr
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendImageCopyFromMemory
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendImageCopyFromMemory(ze_command_list_handle_t hCommandList, ze_image_handle_t hDstImage, const void *srcptr, const ze_image_region_t *pDstRegion, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Copies to an image from device or shared memory.
The application must ensure the memory pointed to by srcptr is accessible by the device on which the command list was created.
The implementation must not access the memory pointed to by srcptr as it is free to be modified by either the Host or device up until execution.
The application must ensure the image and events are accessible by the device on which the command list was created.
The application must ensure the image format descriptor for the destination image is a single-planar format.
The application must ensure the command list, image and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
clEnqueueWriteImage
- Parameters
hCommandList – [in] handle of command list
hDstImage – [in] handle of destination image to copy to
srcptr – [in] pointer to source memory to copy from
pDstRegion – [in][optional] destination region descriptor
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
nullptr == hDstImage
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == srcptr
(nullptr == phWaitEvents) && (0 < numWaitEvents)
zeCommandListAppendMemoryPrefetch
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryPrefetch(ze_command_list_handle_t hCommandList, const void *ptr, size_t size)
Asynchronously prefetches shared memory to the device associated with the specified command list.
This is a hint to improve performance only and is not required for correctness.
Only prefetching to the device associated with the specified command list is supported. Prefetching to the host or to a peer device is not supported.
Prefetching may not be supported for all allocation types for all devices. If memory prefetching is not supported for the specified memory range the prefetch hint may be ignored.
Prefetching may only be supported at a device-specific granularity, such as at a page boundary. In this case, the memory range may be expanded such that the start and end of the range satisfy granularity requirements.
The application must ensure the memory pointed to by ptr is accessible by the device on which the command list was created.
The application must ensure the command list was created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
clEnqueueSVMMigrateMem
- Parameters
hCommandList – [in] handle of command list
ptr – [in] pointer to start of the memory range to prefetch
size – [in] size in bytes of the memory range to prefetch
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == ptr
zeCommandListAppendMemAdvise
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemAdvise(ze_command_list_handle_t hCommandList, ze_device_handle_t hDevice, const void *ptr, size_t size, ze_memory_advice_t advice)
Provides advice about the use of a shared memory range.
Memory advice is a performance hint only and is not required for functional correctness.
Memory advice can be used to override driver heuristics to explicitly control shared memory behavior.
Not all memory advice hints may be supported for all allocation types for all devices. If a memory advice hint is not supported by the device it will be ignored.
Memory advice may only be supported at a device-specific granularity, such as at a page boundary. In this case, the memory range may be expanded such that the start and end of the range satisfy granularity requirements.
The application must ensure the memory pointed to by ptr is accessible by the device on which the command list was created.
The application must ensure the command list was created, and memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle, and the memory was allocated.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of command list
hDevice – [in] device associated with the memory advice
ptr – [in] Pointer to the start of the memory range
size – [in] Size in bytes of the memory range
advice – [in] Memory advice for the memory range
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == ptr
ZE_RESULT_ERROR_INVALID_ENUMERATION
ZE_MEMORY_ADVICE_BIAS_UNCACHED < advice
Copy Enums
ze_memory_advice_t
-
enum ze_memory_advice_t
Supported memory advice hints.
Values:
-
enumerator ZE_MEMORY_ADVICE_SET_READ_MOSTLY
hint that memory will be read from frequently and written to rarely
-
enumerator ZE_MEMORY_ADVICE_CLEAR_READ_MOSTLY
removes the affect of ZE_MEMORY_ADVICE_SET_READ_MOSTLY
-
enumerator ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION
hint that the preferred memory location is the specified device
-
enumerator ZE_MEMORY_ADVICE_CLEAR_PREFERRED_LOCATION
removes the affect of ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION
-
enumerator ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY
hints that memory will mostly be accessed non-atomically
-
enumerator ZE_MEMORY_ADVICE_CLEAR_NON_ATOMIC_MOSTLY
removes the affect of ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY
-
enumerator ZE_MEMORY_ADVICE_BIAS_CACHED
hints that memory should be cached
-
enumerator ZE_MEMORY_ADVICE_BIAS_UNCACHED
hints that memory should be not be cached
-
enumerator ZE_MEMORY_ADVICE_FORCE_UINT32
-
enumerator ZE_MEMORY_ADVICE_SET_READ_MOSTLY
Copy Structures
ze_copy_region_t
-
struct ze_copy_region_t
Copy region descriptor.
Public Members
-
uint32_t originX
[in] The origin x offset for region in bytes
-
uint32_t originY
[in] The origin y offset for region in rows
-
uint32_t originZ
[in] The origin z offset for region in slices
-
uint32_t width
[in] The region width relative to origin in bytes
-
uint32_t height
[in] The region height relative to origin in rows
-
uint32_t depth
[in] The region depth relative to origin in slices. Set this to 0 for 2D copy.
-
uint32_t originX
ze_image_region_t
-
struct ze_image_region_t
Region descriptor.
Public Members
-
uint32_t originX
[in] The origin x offset for region in pixels
-
uint32_t originY
[in] The origin y offset for region in pixels
-
uint32_t originZ
[in] The origin z offset for region in pixels
-
uint32_t width
[in] The region width relative to origin in pixels
-
uint32_t height
[in] The region height relative to origin in pixels
-
uint32_t depth
[in] The region depth relative to origin. For 1D or 2D images, set this to 1.
-
uint32_t originX
Event
Functions
Enumerations
Structures
Event Functions
zeEventPoolCreate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolCreate(ze_context_handle_t hContext, const ze_event_pool_desc_t *desc, uint32_t numDevices, ze_device_handle_t *phDevices, ze_event_pool_handle_t *phEventPool)
Creates a pool of events on the context.
The application must only use events within the pool for the device(s), or their sub-devices, which were provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
desc – [in] pointer to event pool descriptor
numDevices – [in][optional] number of device handles; must be 0 if `nullptr == phDevices`
phDevices – [in][optional][range(0, numDevices)] array of device handles which have visibility to the event pool. if nullptr, then event pool is visible to all devices supported by the driver instance.
phEventPool – [out] pointer handle of event pool object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == phEventPool
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x7 < desc->flags
0 == desc->count
(nullptr == phDevices) && (0 < numDevices)
zeEventPoolDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolDestroy(ze_event_pool_handle_t hEventPool)
Deletes an event pool object.
The application must destroy all event handles created from the pool before destroying the pool itself.
The application must ensure the device is not currently referencing the any event within the pool before it is deleted.
The implementation of this function may immediately free all Host and Device allocations associated with this event pool.
The application must not call this function from simultaneous threads with the same event pool handle.
The implementation of this function must be thread-safe.
- Parameters
hEventPool – [in][release] handle of event pool object to destroy
- Returns
zeEventCreate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventCreate(ze_event_pool_handle_t hEventPool, const ze_event_desc_t *desc, ze_event_handle_t *phEvent)
Creates an event from the pool.
An event is used to communicate fine-grain host-to-device, device-to-host or device-to-device dependencies have completed.
The application must ensure the location in the pool is not being used by another event.
The application must not call this function from simultaneous threads with the same event pool handle.
The implementation of this function should be lock-free.
Remark
Analogues
clCreateUserEvent
vkCreateEvent
- Parameters
hEventPool – [in] handle of the event pool
desc – [in] pointer to event descriptor
phEvent – [out] pointer to handle of event object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hEventPool
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == phEvent
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x7 < desc->signal
0x7 < desc->wait
zeEventDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventDestroy(ze_event_handle_t hEvent)
Deletes an event object.
The application must ensure the device is not currently referencing the event before it is deleted.
The implementation of this function may immediately free all Host and Device allocations associated with this event.
The application must not call this function from simultaneous threads with the same event handle.
The implementation of this function should be lock-free.
Remark
Analogues
clReleaseEvent
vkDestroyEvent
- Parameters
hEvent – [in][release] handle of event object to destroy
- Returns
zeEventPoolGetIpcHandle
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolGetIpcHandle(ze_event_pool_handle_t hEventPool, ze_ipc_event_pool_handle_t *phIpc)
Gets an IPC event pool handle for the specified event handle that can be shared with another process.
Event pool must have been created with ZE_EVENT_POOL_FLAG_IPC.
The application may call this function from simultaneous threads.
- Parameters
hEventPool – [in] handle of event pool object
phIpc – [out] Returned IPC event handle
- Returns
zeEventPoolOpenIpcHandle
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolOpenIpcHandle(ze_context_handle_t hContext, ze_ipc_event_pool_handle_t hIpc, ze_event_pool_handle_t *phEventPool)
Opens an IPC event pool handle to retrieve an event pool handle from another process.
Multiple calls to this function with the same IPC handle will return unique event pool handles.
The event handle in this process should not be freed with zeEventPoolDestroy, but rather with zeEventPoolCloseIpcHandle.
The application may call this function from simultaneous threads.
- Parameters
hContext – [in] handle of the context object to associate with the IPC event pool handle
hIpc – [in] IPC event pool handle
phEventPool – [out] pointer handle of event pool object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == phEventPool
zeEventPoolCloseIpcHandle
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolCloseIpcHandle(ze_event_pool_handle_t hEventPool)
Closes an IPC event handle in the current process.
Closes an IPC event handle by destroying events that were opened in this process using zeEventPoolOpenIpcHandle.
The application must not call this function from simultaneous threads with the same event pool handle.
- Parameters
hEventPool – [in][release] handle of event pool object
- Returns
zeCommandListAppendSignalEvent
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendSignalEvent(ze_command_list_handle_t hCommandList, ze_event_handle_t hEvent)
Appends a signal of the event from the device into a command list.
The application must ensure the events are accessible by the device on which the command list was created.
The duration of an event created from an event pool that was created using ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. However, for consistency and orthogonality the event will report correctly as signaled when used by other event API functionality.
The application must ensure the command list and events were created on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
clSetUserEventStatus
vkCmdSetEvent
- Parameters
hCommandList – [in] handle of the command list
hEvent – [in] handle of the event
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
nullptr == hEvent
zeCommandListAppendWaitOnEvents
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendWaitOnEvents(ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t *phEvents)
Appends wait on event(s) on the device into a command list.
The application must ensure the events are accessible by the device on which the command list was created.
The application must ensure the command list and events were created on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of the command list
numEvents – [in] number of events to wait on before continuing
phEvents – [in][range(0, numEvents)] handles of the events to wait on before continuing
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == phEvents
zeEventHostSignal
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventHostSignal(ze_event_handle_t hEvent)
Signals a event from host.
The duration of an event created from an event pool that was created using ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. However, for consistency and orthogonality the event will report correctly as signaled when used by other event API functionality.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clSetUserEventStatus
- Parameters
hEvent – [in] handle of the event
- Returns
zeEventHostSynchronize
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventHostSynchronize(ze_event_handle_t hEvent, uint64_t timeout)
The current host thread waits on an event to be signaled.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clWaitForEvents
- Parameters
hEvent – [in] handle of the event
timeout – [in] if non-zero, then indicates the maximum time (in nanoseconds) to yield before returning ZE_RESULT_SUCCESS or ZE_RESULT_NOT_READY; if zero, then operates exactly like zeEventQueryStatus; if UINT64_MAX, then function will not return until complete or device is lost. Due to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.
- Returns
zeEventQueryStatus
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventQueryStatus(ze_event_handle_t hEvent)
Queries an event object’s status on the host.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
clGetEventInfo
vkGetEventStatus
- Parameters
hEvent – [in] handle of the event
- Returns
zeCommandListAppendEventReset
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendEventReset(ze_command_list_handle_t hCommandList, ze_event_handle_t hEvent)
Appends a reset of an event back to not signaled state into a command list.
The application must ensure the events are accessible by the device on which the command list was created.
The application must ensure the command list and events were created on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
Remark
Analogues
vkResetEvent
- Parameters
hCommandList – [in] handle of the command list
hEvent – [in] handle of the event
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
nullptr == hEvent
zeEventHostReset
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventHostReset(ze_event_handle_t hEvent)
The current host thread resets an event back to not signaled state.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkResetEvent
- Parameters
hEvent – [in] handle of the event
- Returns
zeEventQueryKernelTimestamp
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventQueryKernelTimestamp(ze_event_handle_t hEvent, ze_kernel_timestamp_result_t *dstptr)
Queries an event’s timestamp value on the host.
The application must ensure the event was created from an event pool that was created using ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag.
The destination memory will be unmodified if the event has not been signaled.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hEvent – [in] handle of the event
dstptr – [in,out] pointer to memory for where timestamp result will be written.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hEvent
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == dstptr
not signaled
zeCommandListAppendQueryKernelTimestamps
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendQueryKernelTimestamps(ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t *phEvents, void *dstptr, const size_t *pOffsets, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
Appends a query of an events’ timestamp value(s) into a command list.
The application must ensure the events are accessible by the device on which the command list was created.
The application must ensure the events were created from an event pool that was created using ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag.
The application must ensure the memory pointed to by both dstptr and pOffsets is accessible by the device on which the command list was created.
The value(s) written to the destination buffer are undefined if any timestamp event has not been signaled.
If pOffsets is nullptr, then multiple results will be appended sequentially into memory in the same order as phEvents.
The application must ensure the command list and events were created, and the memory was allocated, on the same context.
The application must not call this function from simultaneous threads with the same command list handle.
The implementation of this function should be lock-free.
- Parameters
hCommandList – [in] handle of the command list
numEvents – [in] the number of timestamp events to query
phEvents – [in][range(0, numEvents)] handles of timestamp events to query
dstptr – [in,out] pointer to memory where ze_kernel_timestamp_result_t will be written; must be size-aligned.
pOffsets – [in][optional][range(0, numEvents)] offset, in bytes, to write results; address must be 4byte-aligned and offsets must be size-aligned.
hSignalEvent – [in][optional] handle of the event to signal on completion
numWaitEvents – [in][optional] number of events to wait on before executing query; must be 0 if `nullptr == phWaitEvents`
phWaitEvents – [in][optional][range(0, numWaitEvents)] handle of the events to wait on before executing query
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandList
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == phEvents
nullptr == dstptr
(nullptr == phWaitEvents) && (0 < numWaitEvents)
Event Enums
ze_event_pool_flags_t
-
enum ze_event_pool_flag_t
Values:
-
enumerator ZE_EVENT_POOL_FLAG_HOST_VISIBLE
signals and waits are also visible to host
-
enumerator ZE_EVENT_POOL_FLAG_IPC
signals and waits may be shared across processes
-
enumerator ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP
Indicates all events in pool will contain kernel timestamps; cannot be combined with ZE_EVENT_POOL_FLAG_IPC
-
enumerator ZE_EVENT_POOL_FLAG_FORCE_UINT32
-
enumerator ZE_EVENT_POOL_FLAG_HOST_VISIBLE
ze_event_scope_flags_t
-
enum ze_event_scope_flag_t
Values:
-
enumerator ZE_EVENT_SCOPE_FLAG_SUBDEVICE
cache hierarchies are flushed or invalidated sufficient for local sub-device access
-
enumerator ZE_EVENT_SCOPE_FLAG_DEVICE
cache hierarchies are flushed or invalidated sufficient for global device access and peer device access
-
enumerator ZE_EVENT_SCOPE_FLAG_HOST
cache hierarchies are flushed or invalidated sufficient for device and host access
-
enumerator ZE_EVENT_SCOPE_FLAG_FORCE_UINT32
-
enumerator ZE_EVENT_SCOPE_FLAG_SUBDEVICE
Event Structures
ze_event_pool_desc_t
-
struct ze_event_pool_desc_t
Event pool descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_event_pool_flags_t flags
[in] creation flags. must be 0 (default) or a valid combination of ze_event_pool_flag_t; default behavior is signals and waits are visible to the entire device and peer devices.
-
uint32_t count
[in] number of events within the pool; must be greater than 0
-
ze_structure_type_t stype
ze_event_desc_t
-
struct ze_event_desc_t
Event descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
uint32_t index
[in] index of the event within the pool; must be less-than the count specified during pool creation
-
ze_event_scope_flags_t signal
[in] defines the scope of relevant cache hierarchies to flush on a signal action before the event is triggered. must be 0 (default) or a valid combination of ze_event_scope_flag_t; default behavior is synchronization within the command list only, no additional cache hierarchies are flushed.
-
ze_event_scope_flags_t wait
[in] defines the scope of relevant cache hierarchies to invalidate on a wait action after the event is complete. must be 0 (default) or a valid combination of ze_event_scope_flag_t; default behavior is synchronization within the command list only, no additional cache hierarchies are invalidated.
-
ze_structure_type_t stype
ze_kernel_timestamp_data_t
-
struct ze_kernel_timestamp_data_t
Kernel timestamp clock data.
The timestamp frequency can be queried from ze_device_properties_t.timerResolution.
The number of valid bits in the timestamp value can be queried from ze_device_properties_t.kernelTimestampValidBits.
ze_kernel_timestamp_result_t
-
struct ze_kernel_timestamp_result_t
Kernel timestamp result.
Public Members
-
ze_kernel_timestamp_data_t global
[out] wall-clock data
-
ze_kernel_timestamp_data_t context
[out] context-active data; only includes clocks while device context was actively executing.
-
ze_kernel_timestamp_data_t global
Fence
Functions
Enumerations
Structures
Fence Functions
zeFenceCreate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceCreate(ze_command_queue_handle_t hCommandQueue, const ze_fence_desc_t *desc, ze_fence_handle_t *phFence)
Creates a fence for the command queue.
A fence is a heavyweight synchronization primitive used to communicate to the host that command list execution has completed.
The application must only use the fence for the command queue which was provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
Remark
Analogues
vkCreateFence
- Parameters
hCommandQueue – [in] handle of command queue
desc – [in] pointer to fence descriptor
phFence – [out] pointer to handle of fence object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hCommandQueue
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == phFence
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x1 < desc->flags
zeFenceDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceDestroy(ze_fence_handle_t hFence)
Deletes a fence object.
The application must ensure the device is not currently referencing the fence before it is deleted.
The implementation of this function may immediately free all Host and Device allocations associated with this fence.
The application must not call this function from simultaneous threads with the same fence handle.
The implementation of this function must be thread-safe.
Remark
Analogues
vkDestroyFence
- Parameters
hFence – [in][release] handle of fence object to destroy
- Returns
zeFenceHostSynchronize
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceHostSynchronize(ze_fence_handle_t hFence, uint64_t timeout)
The current host thread waits on a fence to be signaled.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkWaitForFences
- Parameters
hFence – [in] handle of the fence
timeout – [in] if non-zero, then indicates the maximum time (in nanoseconds) to yield before returning ZE_RESULT_SUCCESS or ZE_RESULT_NOT_READY; if zero, then operates exactly like zeFenceQueryStatus; if UINT64_MAX, then function will not return until complete or device is lost. Due to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.
- Returns
zeFenceQueryStatus
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceQueryStatus(ze_fence_handle_t hFence)
Queries a fence object’s status.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkGetFenceStatus
- Parameters
hFence – [in] handle of the fence
- Returns
zeFenceReset
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceReset(ze_fence_handle_t hFence)
Reset a fence back to the not signaled state.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
Remark
Analogues
vkResetFences
- Parameters
hFence – [in] handle of the fence
- Returns
Fence Enums
Fence Structures
ze_fence_desc_t
-
struct ze_fence_desc_t
Fence descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_fence_flags_t flags
[in] creation flags. must be 0 (default) or a valid combination of ze_fence_flag_t.
-
ze_structure_type_t stype
Image
Functions
Enumerations
Structures
Image Functions
zeImageGetProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeImageGetProperties(ze_device_handle_t hDevice, const ze_image_desc_t *desc, ze_image_properties_t *pImageProperties)
Retrieves supported properties of an image.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hDevice – [in] handle of the device
desc – [in] pointer to image descriptor
pImageProperties – [out] pointer to image properties
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == pImageProperties
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x3 < desc->flags
ZE_IMAGE_TYPE_BUFFER < desc->type
zeImageCreate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeImageCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_image_desc_t *desc, ze_image_handle_t *phImage)
Creates an image on the context.
The application must only use the image for the device, or its sub-devices, which was provided during creation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
Remark
Analogues
clCreateImage
- Parameters
hContext – [in] handle of the context object
hDevice – [in] handle of the device
desc – [in] pointer to image descriptor
phImage – [out] pointer to handle of image object created
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == phImage
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x3 < desc->flags
ZE_IMAGE_TYPE_BUFFER < desc->type
zeImageDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeImageDestroy(ze_image_handle_t hImage)
Deletes an image object.
The application must ensure the device is not currently referencing the image before it is deleted.
The implementation of this function may immediately free all Host and Device allocations associated with this image.
The application must not call this function from simultaneous threads with the same image handle.
The implementation of this function must be thread-safe.
- Parameters
hImage – [in][release] handle of image object to destroy
- Returns
Image Enums
ze_image_flags_t
ze_image_type_t
-
enum ze_image_type_t
Supported image types.
Values:
-
enumerator ZE_IMAGE_TYPE_1D
1D
-
enumerator ZE_IMAGE_TYPE_1DARRAY
1D array
-
enumerator ZE_IMAGE_TYPE_2D
2D
-
enumerator ZE_IMAGE_TYPE_2DARRAY
2D array
-
enumerator ZE_IMAGE_TYPE_3D
3D
-
enumerator ZE_IMAGE_TYPE_BUFFER
Buffer.
-
enumerator ZE_IMAGE_TYPE_FORCE_UINT32
-
enumerator ZE_IMAGE_TYPE_1D
ze_image_format_layout_t
-
enum ze_image_format_layout_t
Supported image format layouts.
Values:
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_8
8-bit single component layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_16
16-bit single component layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_32
32-bit single component layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_8_8
2-component 8-bit layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_8_8_8_8
4-component 8-bit layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_16_16
2-component 16-bit layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_16_16_16_16
4-component 16-bit layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_32_32
2-component 32-bit layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32
4-component 32-bit layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_10_10_10_2
4-component 10_10_10_2 layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_11_11_10
3-component 11_11_10 layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_5_6_5
3-component 5_6_5 layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_5_5_5_1
4-component 5_5_5_1 layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_4_4_4_4
4-component 4_4_4_4 layout
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_Y8
Media Format: Y8. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_NV12
Media Format: NV12. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_YUYV
Media Format: YUYV. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_VYUY
Media Format: VYUY. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_YVYU
Media Format: YVYU. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_UYVY
Media Format: UYVY. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_AYUV
Media Format: AYUV. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_P010
Media Format: P010. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_Y410
Media Format: Y410. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_P012
Media Format: P012. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_Y16
Media Format: Y16. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_P016
Media Format: P016. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_Y216
Media Format: Y216. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_P216
Media Format: P216. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_P8
Media Format: P8. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_YUY2
Media Format: YUY2. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_A8P8
Media Format: A8P8. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_IA44
Media Format: IA44. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_AI44
Media Format: AI44. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_Y416
Media Format: Y416. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_Y210
Media Format: Y210. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_I420
Media Format: I420. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_YV12
Media Format: YV12. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_400P
Media Format: 400P. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_422H
Media Format: 422H. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_422V
Media Format: 422V. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_444P
Media Format: 444P. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_RGBP
Media Format: RGBP. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_BRGP
Media Format: BRGP. Format type and swizzle is ignored for this.
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32
-
enumerator ZE_IMAGE_FORMAT_LAYOUT_8
ze_image_format_type_t
-
enum ze_image_format_type_t
Supported image format types.
Values:
-
enumerator ZE_IMAGE_FORMAT_TYPE_UINT
Unsigned integer.
-
enumerator ZE_IMAGE_FORMAT_TYPE_SINT
Signed integer.
-
enumerator ZE_IMAGE_FORMAT_TYPE_UNORM
Unsigned normalized integer.
-
enumerator ZE_IMAGE_FORMAT_TYPE_SNORM
Signed normalized integer.
-
enumerator ZE_IMAGE_FORMAT_TYPE_FLOAT
Float.
-
enumerator ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32
-
enumerator ZE_IMAGE_FORMAT_TYPE_UINT
ze_image_format_swizzle_t
-
enum ze_image_format_swizzle_t
Supported image format component swizzle into channel.
Values:
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_R
Red component.
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_G
Green component.
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_B
Blue component.
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_A
Alpha component.
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_0
Zero.
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_1
One.
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_X
Don’t care.
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32
-
enumerator ZE_IMAGE_FORMAT_SWIZZLE_R
Image Structures
ze_image_format_t
-
struct ze_image_format_t
Image format.
Public Members
-
ze_image_format_layout_t layout
[in] image format component layout
-
ze_image_format_type_t type
[in] image format type. Media formats can’t be used for ZE_IMAGE_TYPE_BUFFER.
-
ze_image_format_swizzle_t x
[in] image component swizzle into channel x
-
ze_image_format_swizzle_t y
[in] image component swizzle into channel y
-
ze_image_format_swizzle_t z
[in] image component swizzle into channel z
-
ze_image_format_swizzle_t w
[in] image component swizzle into channel w
-
ze_image_format_layout_t layout
ze_image_desc_t
-
struct ze_image_desc_t
Image descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_image_flags_t flags
[in] creation flags. must be 0 (default) or a valid combination of ze_image_flag_t; default is read-only, cached access.
-
ze_image_type_t type
[in] image type
-
ze_image_format_t format
[in] image format
-
uint64_t width
[in] width dimension. ZE_IMAGE_TYPE_BUFFER: size in bytes; see ze_device_image_properties_t.maxImageBufferSize for limits. ZE_IMAGE_TYPE_1D, ZE_IMAGE_TYPE_1DARRAY: width in pixels; see ze_device_image_properties_t.maxImageDims1D for limits. ZE_IMAGE_TYPE_2D, ZE_IMAGE_TYPE_2DARRAY: width in pixels; see ze_device_image_properties_t.maxImageDims2D for limits. ZE_IMAGE_TYPE_3D: width in pixels; see ze_device_image_properties_t.maxImageDims3D for limits.
-
uint32_t height
[in] height dimension. ZE_IMAGE_TYPE_2D, ZE_IMAGE_TYPE_2DARRAY: height in pixels; see ze_device_image_properties_t.maxImageDims2D for limits. ZE_IMAGE_TYPE_3D: height in pixels; see ze_device_image_properties_t.maxImageDims3D for limits. other: ignored.
-
uint32_t depth
[in] depth dimension. ZE_IMAGE_TYPE_3D: depth in pixels; see ze_device_image_properties_t.maxImageDims3D for limits. other: ignored.
-
uint32_t arraylevels
[in] array levels. ZE_IMAGE_TYPE_1DARRAY, ZE_IMAGE_TYPE_2DARRAY: see ze_device_image_properties_t.maxImageArraySlices for limits. other: ignored.
-
uint32_t miplevels
[in] mipmap levels (must be 0)
-
ze_structure_type_t stype
ze_image_properties_t
-
struct ze_image_properties_t
Image properties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_image_sampler_filter_flags_t samplerFilterFlags
returns 0 (unsupported) or a combination of ze_image_sampler_filter_flag_t.
[out] supported sampler filtering.
-
ze_structure_type_t stype
Memory
Functions
Enumerations
Structures
Memory Functions
zeMemAllocDevice
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemAllocDevice(ze_context_handle_t hContext, const ze_device_mem_alloc_desc_t *device_desc, size_t size, size_t alignment, ze_device_handle_t hDevice, void **pptr)
Allocates device memory on the context.
Device allocations are owned by a specific device.
In general, a device allocation may only be accessed by the device that owns it.
The application must only use the memory allocation for the context and device, or its sub-devices, which was provided during allocation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
device_desc – [in] pointer to device memory allocation descriptor
size – [in] size in bytes to allocate; must be less-than ze_device_properties_t.maxMemAllocSize.
alignment – [in] minimum alignment in bytes for the allocation; must be a power of two.
hDevice – [in] handle of the device
pptr – [out] pointer to device allocation
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == device_desc
nullptr == pptr
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x7 < device_desc->flags
ZE_RESULT_ERROR_UNSUPPORTED_SIZE
0 == size
ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT
Must be zero or a power-of-two
0 != (alignment & (alignment - 1))
zeMemAllocHost
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemAllocHost(ze_context_handle_t hContext, const ze_host_mem_alloc_desc_t *host_desc, size_t size, size_t alignment, void **pptr)
Allocates host memory on the context.
Host allocations are owned by the host process.
Host allocations are accessible by the host and all devices within the driver’s context.
Host allocations are frequently used as staging areas to transfer data to or from devices.
The application must only use the memory allocation for the context which was provided during allocation.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
host_desc – [in] pointer to host memory allocation descriptor
size – [in] size in bytes to allocate; must be less-than ze_device_properties_t.maxMemAllocSize.
alignment – [in] minimum alignment in bytes for the allocation; must be a power of two.
pptr – [out] pointer to host allocation
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == host_desc
nullptr == pptr
ZE_RESULT_ERROR_INVALID_ENUMERATION
0xf < host_desc->flags
ZE_RESULT_ERROR_UNSUPPORTED_SIZE
0 == size
ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT
Must be zero or a power-of-two
0 != (alignment & (alignment - 1))
zeMemFree
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemFree(ze_context_handle_t hContext, void *ptr)
Frees allocated host memory, device memory, or shared memory on the context.
The application must ensure the device is not currently referencing the memory before it is freed
The implementation of this function may immediately free all Host and Device allocations associated with this memory
The application must not call this function from simultaneous threads with the same pointer.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
ptr – [in][release] pointer to memory to free
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == ptr
zeMemGetAllocProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemGetAllocProperties(ze_context_handle_t hContext, const void *ptr, ze_memory_allocation_properties_t *pMemAllocProperties, ze_device_handle_t *phDevice)
Retrieves attributes of a memory allocation.
The application may call this function from simultaneous threads.
The application may query attributes of a memory allocation unrelated to the context. When this occurs, the returned allocation type will be ZE_MEMORY_TYPE_UNKNOWN, and the returned identifier and associated device is unspecified.
- Parameters
hContext – [in] handle of the context object
ptr – [in] memory pointer to query
pMemAllocProperties – [in,out] query result for memory allocation properties
phDevice – [out][optional] device associated with this allocation
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == ptr
nullptr == pMemAllocProperties
zeMemGetAddressRange
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemGetAddressRange(ze_context_handle_t hContext, const void *ptr, void **pBase, size_t *pSize)
Retrieves the base address and/or size of an allocation.
The application may call this function from simultaneous threads.
- Parameters
hContext – [in] handle of the context object
ptr – [in] memory pointer to query
pBase – [in,out][optional] base address of the allocation
pSize – [in,out][optional] size of the allocation
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == ptr
zeMemGetIpcHandle
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemGetIpcHandle(ze_context_handle_t hContext, const void *ptr, ze_ipc_mem_handle_t *pIpcHandle)
Creates an IPC memory handle for the specified allocation.
Takes a pointer to a device memory allocation and creates an IPC memory handle for exporting it for use in another process.
The pointer must be base pointer of the device memory allocation; i.e. the value returned from zeMemAllocDevice.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
ptr – [in] pointer to the device memory allocation
pIpcHandle – [out] Returned IPC memory handle
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == ptr
nullptr == pIpcHandle
zeMemOpenIpcHandle
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemOpenIpcHandle(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_ipc_mem_handle_t handle, ze_ipc_memory_flags_t flags, void **pptr)
Opens an IPC memory handle to retrieve a device pointer on the context.
Takes an IPC memory handle from a remote process and associates it with a device pointer usable in this process.
The device pointer in this process should not be freed with zeMemFree, but rather with zeMemCloseIpcHandle.
Multiple calls to this function with the same IPC handle will return unique pointers.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
hDevice – [in] handle of the device to associate with the IPC memory handle
handle – [in] IPC memory handle
flags – [in] flags controlling the operation. must be 0 (default) or a valid combination of ze_ipc_memory_flag_t.
pptr – [out] pointer to device allocation in this process
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_ENUMERATION
0x3 < flags
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pptr
zeMemCloseIpcHandle
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemCloseIpcHandle(ze_context_handle_t hContext, const void *ptr)
Closes an IPC memory handle.
Closes an IPC memory handle by unmapping memory that was opened in this process using zeMemOpenIpcHandle.
The application must not call this function from simultaneous threads with the same pointer.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
ptr – [in][release] pointer to device allocation in this process
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == ptr
Memory Enums
ze_device_mem_alloc_flags_t
-
enum ze_device_mem_alloc_flag_t
Values:
-
enumerator ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED
device should cache allocation
-
enumerator ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED
device should not cache allocation (UC)
-
enumerator ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT
optimize shared allocation for first access on the device
-
enumerator ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32
-
enumerator ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED
ze_host_mem_alloc_flags_t
-
enum ze_host_mem_alloc_flag_t
Values:
-
enumerator ZE_HOST_MEM_ALLOC_FLAG_BIAS_CACHED
host should cache allocation
-
enumerator ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED
host should not cache allocation (UC)
-
enumerator ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED
host memory should be allocated write-combined (WC)
-
enumerator ZE_HOST_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT
optimize shared allocation for first access on the host
-
enumerator ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32
-
enumerator ZE_HOST_MEM_ALLOC_FLAG_BIAS_CACHED
ze_memory_type_t
-
enum ze_memory_type_t
Memory allocation type.
Values:
-
enumerator ZE_MEMORY_TYPE_UNKNOWN
the memory pointed to is of unknown type
-
enumerator ZE_MEMORY_TYPE_HOST
the memory pointed to is a host allocation
-
enumerator ZE_MEMORY_TYPE_DEVICE
the memory pointed to is a device allocation
-
enumerator ZE_MEMORY_TYPE_SHARED
the memory pointed to is a shared ownership allocation
-
enumerator ZE_MEMORY_TYPE_FORCE_UINT32
-
enumerator ZE_MEMORY_TYPE_UNKNOWN
Memory Structures
ze_device_mem_alloc_desc_t
-
struct ze_device_mem_alloc_desc_t
Device memory allocation descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_device_mem_alloc_flags_t flags
[in] flags specifying additional allocation controls. must be 0 (default) or a valid combination of ze_device_mem_alloc_flag_t; default behavior may use implicit driver-based heuristics.
-
uint32_t ordinal
[in] ordinal of the device’s local memory to allocate from. must be less than the count returned from zeDeviceGetMemoryProperties.
-
ze_structure_type_t stype
ze_host_mem_alloc_desc_t
-
struct ze_host_mem_alloc_desc_t
Host memory allocation descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_host_mem_alloc_flags_t flags
[in] flags specifying additional allocation controls. must be 0 (default) or a valid combination of ze_host_mem_alloc_flag_t; default behavior may use implicit driver-based heuristics.
-
ze_structure_type_t stype
ze_memory_allocation_properties_t
-
struct ze_memory_allocation_properties_t
Memory allocation properties queried using zeMemGetAllocProperties.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
void *pNext
[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_memory_type_t type
[out] type of allocated memory
-
uint64_t id
[out] identifier for this allocation
-
uint64_t pageSize
[out] page size used for allocation
-
ze_structure_type_t stype
ze_external_memory_export_desc_t
-
struct ze_external_memory_export_desc_t
Additional allocation descriptor for exporting external memory.
This structure may be passed to zeMemAllocDevice, via the
pNext
member of ze_device_mem_alloc_desc_t, to indicate an exportable memory allocation.This structure may be passed to zeImageCreate, via the
pNext
member of ze_image_desc_t, to indicate an exportable image.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_external_memory_type_flags_t flags
[in] flags specifying memory export types for this allocation. must be 0 (default) or a valid combination of ze_external_memory_type_flags_t
ze_external_memory_import_fd_t
-
struct ze_external_memory_import_fd_t
Additional allocation descriptor for importing external memory as a file descriptor.
This structure may be passed to zeMemAllocDevice, via the
pNext
member of ze_device_mem_alloc_desc_t, to import memory from a file descriptor.This structure may be passed to zeImageCreate, via the
pNext
member of ze_image_desc_t, to import memory from a file descriptor.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_external_memory_type_flags_t flags
[in] flags specifying the memory import type for the file descriptor. must be 0 (default) or a valid combination of ze_external_memory_type_flags_t
-
int fd
[in] the file descriptor handle to import
ze_external_memory_export_fd_t
-
struct ze_external_memory_export_fd_t
Exports an allocation as a file descriptor.
This structure may be passed to zeMemGetAllocProperties, via the
pNext
member of ze_memory_allocation_properties_t, to export a memory allocation as a file descriptor.This structure may be passed to zeImageGetAllocPropertiesExt, via the
pNext
member of ze_image_allocation_ext_properties_t, to export an image as a file descriptor.The requested memory export type must have been specified when the allocation was made.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_external_memory_type_flags_t flags
[in] flags specifying the memory export type for the file descriptor. must be 0 (default) or a valid combination of ze_external_memory_type_flags_t
-
int fd
[out] the exported file descriptor handle representing the allocation.
ze_external_memory_import_win32_handle_t
-
struct ze_external_memory_import_win32_handle_t
Additional allocation descriptor for importing external memory as a Win32 handle.
When
handle
isnullptr
,name
must not benullptr
.When
name
isnullptr
,handle
must not benullptr
.When
flags
is ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT,name
must benullptr
.This structure may be passed to zeMemAllocDevice, via the
pNext
member of ze_device_mem_alloc_desc_t, to import memory from a Win32 handle.This structure may be passed to zeImageCreate, via the
pNext
member of ze_image_desc_t, to import memory from a Win32 handle.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_external_memory_type_flags_t flags
[in] flags specifying the memory import type for the Win32 handle. must be 0 (default) or a valid combination of ze_external_memory_type_flags_t
-
void *handle
[in][optional] the Win32 handle to import
-
const void *name
[in][optional] name of a memory object to import
ze_external_memory_export_win32_handle_t
-
struct ze_external_memory_export_win32_handle_t
Exports an allocation as a Win32 handle.
This structure may be passed to zeMemGetAllocProperties, via the
pNext
member of ze_memory_allocation_properties_t, to export a memory allocation as a Win32 handle.This structure may be passed to zeImageGetAllocPropertiesExt, via the
pNext
member of ze_image_allocation_ext_properties_t, to export an image as a Win32 handle.The requested memory export type must have been specified when the allocation was made.
Public Members
-
ze_structure_type_t stype
[in] type of this structure
-
const void *pNext
[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains sType and pNext).
-
ze_external_memory_type_flags_t flags
[in] flags specifying the memory export type for the Win32 handle. must be 0 (default) or a valid combination of ze_external_memory_type_flags_t
-
void *handle
[out] the exported Win32 handle representing the allocation.
Module
Functions
Enumerations
Structures
Module Functions
zeModuleCreate
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_module_desc_t *desc, ze_module_handle_t *phModule, ze_module_build_log_handle_t *phBuildLog)
Creates a module on the context.
Compiles the module for execution on the device.
The application must only use the module for the device, or its sub-devices, which was provided during creation.
The module can be copied to other devices and contexts within the same driver instance by using zeModuleGetNativeBinary.
A build log can optionally be returned to the caller. The caller is responsible for destroying build log using zeModuleBuildLogDestroy.
The module descriptor constants are only supported for SPIR-V specialization constants.
The application may call this function from simultaneous threads.
The implementation of this function must be thread-safe.
- Parameters
hContext – [in] handle of the context object
hDevice – [in] handle of the device
desc – [in] pointer to module descriptor
phModule – [out] pointer to handle of module object created
phBuildLog – [out][optional] pointer to handle of module’s build log.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hContext
nullptr == hDevice
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == desc
nullptr == desc->pInputModule
nullptr == phModule
ZE_RESULT_ERROR_INVALID_ENUMERATION
ZE_MODULE_FORMAT_NATIVE < desc->format
0 == desc->inputSize
zeModuleDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleDestroy(ze_module_handle_t hModule)
Destroys module.
The application must destroy all kernel and build log handles created from the module before destroying the module itself.
The application must ensure the device is not currently referencing the module before it is deleted.
The implementation of this function may immediately free all Host and Device allocations associated with this module.
The application must not call this function from simultaneous threads with the same module handle.
The implementation of this function must be thread-safe.
- Parameters
hModule – [in][release] handle of the module
- Returns
zeModuleDynamicLink
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleDynamicLink(uint32_t numModules, ze_module_handle_t *phModules, ze_module_build_log_handle_t *phLinkLog)
Dynamically link modules together that share import/export linkage dependencies.
Modules support SPIR-V import and export linkage types for functions and global variables. See the SPIR-V specification for linkage details.
Modules can have both import and export linkage.
Modules that do not have any imports or exports do not need to be linked.
All module import requirements must be satisfied via linking before kernel objects can be created from them.
Modules cannot be partially linked. Unsatisfiable import dependencies in the set of modules passed to zeModuleDynamicLink will result in ZE_RESULT_ERROR_MODULE_LINK_FAILURE being returned.
Modules will only be linked once. A module can be used in multiple link calls if it has exports but its imports will not be re-linked.
Ambiguous dependencies, where multiple modules satisfy the same import dependencies for a module, are not allowed.
The application must ensure the modules being linked were created on the same context.
The application may call this function from simultaneous threads as long as the import modules being linked are not the same.
ModuleGetNativeBinary can be called on any module regardless of whether it is linked or not.
A link log can optionally be returned to the caller. The caller is responsible for destroying the link log using zeModuleBuildLogDestroy.
The link log may contain a list of the unresolved import dependencies if present.
The implementation of this function should be lock-free.
- Parameters
numModules – [in] number of modules to be linked pointed to by phModules.
phModules – [in][range(0, numModules)] pointer to an array of modules to dynamically link together.
phLinkLog – [out][optional] pointer to handle of dynamic link log.
- Returns
zeModuleBuildLogDestroy
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleBuildLogDestroy(ze_module_build_log_handle_t hModuleBuildLog)
Destroys module build log object.
The implementation of this function may immediately free all Host allocations associated with this object.
The application must not call this function from simultaneous threads with the same build log handle.
The implementation of this function should be lock-free.
This function can be called before or after zeModuleDestroy for the associated module.
- Parameters
hModuleBuildLog – [in][release] handle of the module build log object.
- Returns
zeModuleBuildLogGetString
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleBuildLogGetString(ze_module_build_log_handle_t hModuleBuildLog, size_t *pSize, char *pBuildLog)
Retrieves text string for build log.
The caller can pass nullptr for pBuildLog when querying only for size.
The caller must provide memory for build log.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hModuleBuildLog – [in] handle of the module build log object.
pSize – [in,out] size of build log string.
pBuildLog – [in,out][optional] pointer to null-terminated string of the log.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hModuleBuildLog
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pSize
zeModuleGetNativeBinary
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetNativeBinary(ze_module_handle_t hModule, size_t *pSize, uint8_t *pModuleNativeBinary)
Retrieve native binary from Module.
The native binary output can be cached to disk and new modules can be later constructed from the cached copy.
The native binary will retain debugging information that is associated with a module.
The caller can pass nullptr for pModuleNativeBinary when querying only for size.
The implementation will copy the native binary into a buffer supplied by the caller.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hModule – [in] handle of the module
pSize – [in,out] size of native binary in bytes.
pModuleNativeBinary – [in,out][optional] byte pointer to native binary
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hModule
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pSize
zeModuleGetGlobalPointer
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetGlobalPointer(ze_module_handle_t hModule, const char *pGlobalName, size_t *pSize, void **pptr)
Retrieve global variable pointer from Module.
The application may query global pointer from any module that either exports or imports it.
The application must dynamically link a module that imports a global before the global pointer can be queried from it.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hModule – [in] handle of the module
pGlobalName – [in] name of global variable in module
pSize – [in,out][optional] size of global variable
pptr – [in,out][optional] device visible pointer
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hModule
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pGlobalName
zeModuleGetKernelNames
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetKernelNames(ze_module_handle_t hModule, uint32_t *pCount, const char **pNames)
Retrieve all kernel names in the module.
The application may call this function from simultaneous threads.
The implementation of this function should be lock-free.
- Parameters
hModule – [in] handle of the module
pCount – [in,out] pointer to the number of names. if count is zero, then the driver shall update the value with the total number of names available. if count is greater than the number of names available, then the driver shall update the value with the correct number of names available.
pNames – [in,out][optional][range(0, *pCount)] array of names of functions. if count is less than the number of names available, then driver shall only retrieve that number of names.
- Returns
ZE_RESULT_ERROR_INVALID_NULL_HANDLE
nullptr == hModule
ZE_RESULT_ERROR_INVALID_NULL_POINTER
nullptr == pCount
zeModuleGetProperties
-
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetProperties(ze_module_handle_t hModule, ze_module_properties_t *pModuleProperties)
Retrieve module properties.
The application may call this function from simu