Skip to content

Commit

Permalink
Improvements to align CTS and Spec for Device:
Browse files Browse the repository at this point in the history
- Rework urDeviceGetInfoTest to move all enums to their own tests instead of a switch case - #2290
- Remove the UR/OpenCL Device enum map function - no point maintaining both a switch case and a separate mapping function
- Update some spec wording for consistency
- Add missing Device info enums to OpenCL adapater
- Add new urDevicePartition test for checking UR_DEVICE_INFO_PARENT_DEVICE
- Move UUR_RETURN_ON_FATAL_FAILURE and UUR_ASSERT_SUCCESS_OR_UNSUPPORTED to join similar macros in checks.h
- Update spec to say info queries that return char[] are null-terminated
- Update UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH/HEIGHT/PITCH should be uint32_t, matching SYCL RT
- Add missing unsupported device enums to HIP adapter
  • Loading branch information
martygrant committed Jan 23, 2025
1 parent d3e9704 commit b8a9271
Show file tree
Hide file tree
Showing 33 changed files with 3,651 additions and 1,002 deletions.
123 changes: 62 additions & 61 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1451,20 +1451,20 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGet(
///////////////////////////////////////////////////////////////////////////////
/// @brief Supported platform info
typedef enum ur_platform_info_t {
/// [char[]] The string denoting name of the platform. The size of the
/// info needs to be dynamically queried.
UR_PLATFORM_INFO_NAME = 1,
/// [char[]] The string denoting name of the vendor of the platform. The
/// [char[]] The null-terminated string denoting name of the platform. The
/// size of the info needs to be dynamically queried.
UR_PLATFORM_INFO_NAME = 1,
/// [char[]] The null-terminated string denoting name of the vendor of the
/// platform. The size of the info needs to be dynamically queried.
UR_PLATFORM_INFO_VENDOR_NAME = 2,
/// [char[]] The string denoting the version of the platform. The size of
/// the info needs to be dynamically queried.
/// [char[]] The null-terminatedstring denoting the version of the
/// platform. The size of the info needs to be dynamically queried.
UR_PLATFORM_INFO_VERSION = 3,
/// [char[]] The string denoting extensions supported by the platform. The
/// size of the info needs to be dynamically queried.
/// [char[]] The null-terminatedstring denoting extensions supported by
/// the platform. The size of the info needs to be dynamically queried.
UR_PLATFORM_INFO_EXTENSIONS = 4,
/// [char[]] The string denoting profile of the platform. The size of the
/// info needs to be dynamically queried.
/// [char[]] The null-terminated string denoting profile of the platform.
/// The size of the info needs to be dynamically queried.
UR_PLATFORM_INFO_PROFILE = 5,
/// [::ur_platform_backend_t] The backend of the platform. Identifies the
/// native backend adapter implementing this platform.
Expand Down Expand Up @@ -1976,7 +1976,7 @@ typedef enum ur_device_info_t {
/// [uint64_t] max memory allocation size
UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE = 28,
/// [::ur_bool_t] images are supported
UR_DEVICE_INFO_IMAGE_SUPPORTED = 29,
UR_DEVICE_INFO_IMAGE_SUPPORT = 29,
/// [uint32_t] max number of image objects arguments of a kernel declared
/// with the read_only qualifier
UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS = 30,
Expand Down Expand Up @@ -2046,7 +2046,8 @@ typedef enum ur_device_info_t {
UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES = 60,
/// [::ur_queue_flags_t] host queue property bit-field
UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES = 61,
/// [char[]] a semi-colon separated list of built-in kernels
/// [char[]] a null-terminated semi-colon separated list of built-in
/// kernels
UR_DEVICE_INFO_BUILT_IN_KERNELS = 62,
/// [::ur_platform_handle_t] the platform associated with the device
UR_DEVICE_INFO_PLATFORM = 63,
Expand All @@ -2055,21 +2056,22 @@ typedef enum ur_device_info_t {
/// It is unsuitable for general use in applications. This feature is
/// provided for identifying memory leaks.
UR_DEVICE_INFO_REFERENCE_COUNT = 64,
/// [char[]] IL version
/// [char[]] null-terminated IL version
UR_DEVICE_INFO_IL_VERSION = 65,
/// [char[]] Device name
/// [char[]] null-terminated device name
UR_DEVICE_INFO_NAME = 66,
/// [char[]] Device vendor
/// [char[]] null-terminated device vendor
UR_DEVICE_INFO_VENDOR = 67,
/// [char[]] Driver version
/// [char[]] null-terminated driver version
UR_DEVICE_INFO_DRIVER_VERSION = 68,
/// [char[]] Device profile
/// [char[]] null-terminated device profile
UR_DEVICE_INFO_PROFILE = 69,
/// [char[]] Device version
/// [char[]] null-terminated device version
UR_DEVICE_INFO_VERSION = 70,
/// [char[]] Version of backend runtime
/// [char[]] null-terminated version of backend runtime
UR_DEVICE_INFO_BACKEND_RUNTIME_VERSION = 71,
/// [char[]] Return a space separated list of extension names
/// [char[]] Return a null-terminated space separated list of extension
/// names
UR_DEVICE_INFO_EXTENSIONS = 72,
/// [size_t] Maximum size in bytes of internal printf buffer
UR_DEVICE_INFO_PRINTF_BUFFER_SIZE = 73,
Expand All @@ -2089,9 +2091,8 @@ typedef enum ur_device_info_t {
/// If the device does not support any affinity domains, then 0 will be
/// returned.
UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN = 78,
/// [::ur_device_partition_property_t[]] return an array of
/// ::ur_device_partition_property_t for properties specified in
/// ::urDevicePartition
/// [::ur_device_partition_property_t[]] returns an array of properties
/// specified in ::urDevicePartition
UR_DEVICE_INFO_PARTITION_TYPE = 79,
/// [uint32_t] max number of sub groups
UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS = 80,
Expand All @@ -2116,7 +2117,7 @@ typedef enum ur_device_info_t {
UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT = 87,
/// [uint8_t[]][optional-query] return device UUID
UR_DEVICE_INFO_UUID = 88,
/// [char[]][optional-query] return device PCI address
/// [char[]][optional-query] return null-terminated device PCI address
UR_DEVICE_INFO_PCI_ADDRESS = 89,
/// [uint32_t][optional-query] return Intel GPU EU count
UR_DEVICE_INFO_GPU_EU_COUNT = 90,
Expand Down Expand Up @@ -2172,7 +2173,7 @@ typedef enum ur_device_info_t {
UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT = 110,
/// [::ur_bool_t] Return true if the device supports enqueueing commands
/// to read and write pipes from the host.
UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED = 111,
UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORT = 111,
/// [uint32_t][optional-query] The maximum number of registers available
/// per block.
UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP = 112,
Expand Down Expand Up @@ -2211,7 +2212,7 @@ typedef enum ur_device_info_t {
/// for command synchronization outside of a command-buffer.
UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP = 0x1002,
/// [::ur_bool_t] return true if enqueue Cluster Launch is supported
UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP = 0x1111,
UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP = 0x1111,
/// [::ur_bool_t] returns true if the device supports the creation of
/// bindless images
UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP = 0x2000,
Expand All @@ -2227,14 +2228,14 @@ typedef enum ur_device_info_t {
/// [uint32_t] returns the required alignment of the pitch between two
/// rows of an image in bytes
UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP = 0x2004,
/// [size_t] returns the maximum linear width allowed for images allocated
/// using USM
/// [uint32_t] returns the maximum linear width allowed for images
/// allocated using USM
UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP = 0x2005,
/// [size_t] returns the maximum linear height allowed for images
/// [uint32_t] returns the maximum linear height allowed for images
/// allocated using USM
UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP = 0x2006,
/// [size_t] returns the maximum linear pitch allowed for images allocated
/// using USM
/// [uint32_t] returns the maximum linear pitch allowed for images
/// allocated using USM
UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP = 0x2007,
/// [::ur_bool_t] returns true if the device supports allocating mipmap
/// resources
Expand All @@ -2260,40 +2261,40 @@ typedef enum ur_device_info_t {
/// [::ur_bool_t] returns true if the device supports sampling cubemapped
/// images across face boundaries
UR_DEVICE_INFO_CUBEMAP_SEAMLESS_FILTERING_SUPPORT_EXP = 0x2011,
/// [::ur_bool_t] returns true if the device is capable of fetching USM
/// [::ur_bool_t] returns true if the device supports fetching USM backed
/// 1D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP = 0x2012,
/// [::ur_bool_t] returns true if the device supports fetching non-USM
/// backed 1D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_EXP = 0x2012,
/// [::ur_bool_t] returns true if the device is capable of fetching
/// non-USM backed 1D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_EXP = 0x2013,
/// [::ur_bool_t] returns true if the device is capable of fetching USM
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_SUPPORT_EXP = 0x2013,
/// [::ur_bool_t] returns true if the device supports fetching USM backed
/// 2D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP = 0x2014,
/// [::ur_bool_t] returns true if the device supports fetching non-USM
/// backed 2D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_EXP = 0x2014,
/// [::ur_bool_t] returns true if the device is capable of fetching
/// non-USM backed 2D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_EXP = 0x2015,
/// [::ur_bool_t] returns true if the device is capable of fetching
/// non-USM backed 3D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP = 0x2017,
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_SUPPORT_EXP = 0x2015,
/// [::ur_bool_t] returns true if the device supports fetching non-USM
/// backed 3D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_SUPPORT_EXP = 0x2017,
/// [::ur_bool_t] returns true if the device supports timestamp recording
UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP = 0x2018,
/// [::ur_bool_t] returns true if the device supports allocating and
/// accessing image array resources.
UR_DEVICE_INFO_IMAGE_ARRAY_SUPPORT_EXP = 0x2019,
/// [::ur_bool_t] returns true if the device supports unique addressing
/// per dimension.
UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_EXP = 0x201A,
/// [::ur_bool_t] returns true if the device is capable of sampling USM
/// backed 1D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_EXP = 0x201B,
/// [::ur_bool_t] returns true if the device is capable of sampling USM
/// backed 2D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_EXP = 0x201C,
UR_DEVICE_INFO_BINDLESS_UNIQUE_ADDRESSING_PER_DIM_SUPPORT_EXP = 0x201A,
/// [::ur_bool_t] returns true if the device supports sampling USM backed
/// 1D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP = 0x201B,
/// [::ur_bool_t] returns true if the device supports sampling USM backed
/// 2D sampled image data.
UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP = 0x201C,
/// [::ur_bool_t] returns true if the device supports enqueueing of native
/// work
UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020,
/// [::ur_bool_t] returns true if the device supports low-power events.
UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP = 0x2021,
UR_DEVICE_INFO_LOW_POWER_EVENTS_SUPPORT_EXP = 0x2021,
/// [::ur_exp_device_2d_block_array_capability_flags_t] return a bit-field
/// of Intel GPU 2D block array capabilities
UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP = 0x2022,
Expand Down Expand Up @@ -5571,14 +5572,14 @@ typedef enum ur_program_info_t {
/// subset of those devices when the program is created using
/// ::urProgramCreateWithBinary.
UR_PROGRAM_INFO_DEVICES = 3,
/// [char[]] Return program IL if the program was created with
/// ::urProgramCreateWithIL, otherwise return size will be set to 0 and
/// nothing will be returned.
/// [char[]] Return null-terminated program IL if the program was created
/// with ::urProgramCreateWithIL, otherwise return size will be set to 0
/// and nothing will be returned.
UR_PROGRAM_INFO_IL = 4,
/// [size_t[]] Return program binary sizes for each device.
UR_PROGRAM_INFO_BINARY_SIZES = 5,
/// [unsigned char[]] Return program binaries for all devices for this
/// Program.
/// [unsigned char[]] Return null-terminated program binaries for all
/// devices for this Program.
UR_PROGRAM_INFO_BINARIES = 6,
/// [size_t][optional-query] Number of kernels in Program, return type
/// size_t.
Expand Down Expand Up @@ -6647,7 +6648,7 @@ typedef enum ur_queue_flag_t {
/// implementation may use interrupt-driven events. May reduce CPU
/// utilization at the cost of increased event completion latency. Other
/// platforms may ignore this flag.
UR_QUEUE_FLAG_LOW_POWER_EVENTS_EXP = UR_BIT(11),
UR_QUEUE_FLAG_LOW_POWER_EVENTS_SUPPORT_EXP = UR_BIT(11),
/// @cond
UR_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff
/// @endcond
Expand Down Expand Up @@ -11805,10 +11806,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMReleaseExp(
typedef enum ur_exp_peer_info_t {
/// [int] 1 if P2P access is supported otherwise P2P access is not
/// supported.
UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED = 0,
UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT = 0,
/// [int] 1 if atomic operations are supported over the P2P link,
/// otherwise such operations are not supported.
UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED = 1,
UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT = 1,
/// @cond
UR_EXP_PEER_INFO_FORCE_UINT32 = 0x7fffffff
/// @endcond
Expand Down Expand Up @@ -11918,7 +11919,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp(
/// + `NULL == commandDevice`
/// + `NULL == peerDevice`
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
/// + `::UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED < propName`
/// + `::UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORT < propName`
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
/// + If `propName` is not supported by the adapter.
/// - ::UR_RESULT_ERROR_INVALID_SIZE
Expand Down
Loading

0 comments on commit b8a9271

Please sign in to comment.