Skip to content

Commit

Permalink
Remove UR_DEVICE_INFO_BFLOAT16
Browse files Browse the repository at this point in the history
Resolves #2385
  • Loading branch information
isaacault committed Feb 13, 2025
1 parent 064d356 commit fa9891c
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 63 deletions.
36 changes: 17 additions & 19 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2142,57 +2142,55 @@ typedef enum ur_device_info_t {
/// [::ur_memory_scope_capability_flags_t] return a bit-field of atomic
/// memory fence scope capabilities
UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES = 103,
/// [::ur_bool_t] support for bfloat16
UR_DEVICE_INFO_BFLOAT16 = 104,
/// [uint32_t] Returns 1 if the device doesn't have a notion of a
/// queue index. Otherwise, returns the number of queue indices that are
/// available for this device.
UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES = 105,
UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES = 104,
/// [::ur_bool_t] support the ::urKernelSetSpecializationConstants entry
/// point
UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS = 106,
UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS = 105,
/// [uint32_t][optional-query] return the width in bits of the memory bus
/// interface of the device.
UR_DEVICE_INFO_MEMORY_BUS_WIDTH = 107,
UR_DEVICE_INFO_MEMORY_BUS_WIDTH = 106,
/// [size_t[3]] return max 3D work groups
UR_DEVICE_INFO_MAX_WORK_GROUPS_3D = 108,
UR_DEVICE_INFO_MAX_WORK_GROUPS_3D = 107,
/// [::ur_bool_t] return true if Async Barrier is supported
UR_DEVICE_INFO_ASYNC_BARRIER = 109,
UR_DEVICE_INFO_ASYNC_BARRIER = 108,
/// [::ur_bool_t] return true if specifying memory channels is supported
UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT = 110,
UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT = 109,
/// [::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_SUPPORTED = 110,
/// [uint32_t][optional-query] The maximum number of registers available
/// per block.
UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP = 112,
UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP = 111,
/// [uint32_t][optional-query] The device IP version. The meaning of the
/// device IP version is implementation-defined, but newer devices should
/// have a higher version than older devices.
UR_DEVICE_INFO_IP_VERSION = 113,
UR_DEVICE_INFO_IP_VERSION = 112,
/// [::ur_bool_t] return true if the device supports virtual memory.
UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT = 114,
UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT = 113,
/// [::ur_bool_t] return true if the device supports ESIMD.
UR_DEVICE_INFO_ESIMD_SUPPORT = 115,
UR_DEVICE_INFO_ESIMD_SUPPORT = 114,
/// [::ur_device_handle_t[]][optional-query] The set of component devices
/// contained by this composite device.
UR_DEVICE_INFO_COMPONENT_DEVICES = 116,
UR_DEVICE_INFO_COMPONENT_DEVICES = 115,
/// [::ur_device_handle_t][optional-query] The composite device containing
/// this component device.
UR_DEVICE_INFO_COMPOSITE_DEVICE = 117,
UR_DEVICE_INFO_COMPOSITE_DEVICE = 116,
/// [::ur_bool_t] return true if the device supports the
/// `EnqueueDeviceGlobalVariableWrite` and
/// `EnqueueDeviceGlobalVariableRead` entry points.
UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 118,
UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 117,
/// [::ur_bool_t] return true if the device supports USM pooling. Pertains
/// to the `USMPool` entry points and usage of the `pool` parameter of the
/// USM alloc entry points.
UR_DEVICE_INFO_USM_POOL_SUPPORT = 119,
UR_DEVICE_INFO_USM_POOL_SUPPORT = 118,
/// [uint32_t] the number of compute units for specific backend.
UR_DEVICE_INFO_NUM_COMPUTE_UNITS = 120,
UR_DEVICE_INFO_NUM_COMPUTE_UNITS = 119,
/// [::ur_bool_t] support the ::urProgramSetSpecializationConstants entry
/// point
UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS = 121,
UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS = 120,
/// [::ur_bool_t] Returns true if the device supports the use of
/// command-buffers.
UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000,
Expand Down
16 changes: 0 additions & 16 deletions include/ur_print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2822,9 +2822,6 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
case UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES:
os << "UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES";
break;
case UR_DEVICE_INFO_BFLOAT16:
os << "UR_DEVICE_INFO_BFLOAT16";
break;
case UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES:
os << "UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES";
break;
Expand Down Expand Up @@ -4297,19 +4294,6 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr,

os << ")";
} break;
case UR_DEVICE_INFO_BFLOAT16: {
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
if (sizeof(ur_bool_t) > size) {
os << "invalid size (is: " << size
<< ", expected: >=" << sizeof(ur_bool_t) << ")";
return UR_RESULT_ERROR_INVALID_SIZE;
}
os << (const void *)(tptr) << " (";

os << *tptr;

os << ")";
} break;
case UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES: {
const uint32_t *tptr = (const uint32_t *)ptr;
if (sizeof(uint32_t) > size) {
Expand Down
2 changes: 0 additions & 2 deletions scripts/core/device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,6 @@ etors:
desc: "[$x_memory_order_capability_flags_t] return a bit-field of atomic memory fence order capabilities"
- name: ATOMIC_FENCE_SCOPE_CAPABILITIES
desc: "[$x_memory_scope_capability_flags_t] return a bit-field of atomic memory fence scope capabilities"
- name: BFLOAT16
desc: "[$x_bool_t] support for bfloat16"
- name: MAX_COMPUTE_QUEUE_INDICES
desc: |
[uint32_t] Returns 1 if the device doesn't have a notion of a
Expand Down
8 changes: 0 additions & 8 deletions source/adapters/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP;
return ReturnValue(Capabilities);
}
case UR_DEVICE_INFO_BFLOAT16: {
int Major = 0;
UR_CHECK_ERROR(cuDeviceGetAttribute(
&Major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, hDevice->get()));

bool BFloat16 = (Major >= 8) ? true : false;
return ReturnValue(BFloat16);
}
case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL: {
// NVIDIA devices only support one sub-group size (the warp size)
int WarpSize = 0;
Expand Down
2 changes: 0 additions & 2 deletions source/adapters/hip/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,8 +1052,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
#else
return ReturnValue(ur_bool_t{false});
#endif
case UR_DEVICE_INFO_BFLOAT16:
return ReturnValue(true);
case UR_DEVICE_INFO_ASYNC_BARRIER:
return ReturnValue(false);
case UR_DEVICE_INFO_IL_VERSION:
Expand Down
4 changes: 0 additions & 4 deletions source/adapters/level_zero/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,6 @@ ur_result_t urDeviceGetInfo(
return ReturnValue(uint32_t{Device->ZeDeviceProperties->numEUsPerSubslice});
case UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
return ReturnValue(uint32_t{Device->ZeDeviceProperties->numThreadsPerEU});
case UR_DEVICE_INFO_BFLOAT16: {
// bfloat16 math functions are not yet supported on Intel GPUs.
return ReturnValue(ur_bool_t{false});
}
case UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: {
// There are no explicit restrictions in L0 programming guide, so assume all
// are supported
Expand Down
2 changes: 0 additions & 2 deletions source/adapters/native_cpu/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return ReturnValue(bool{0});
case UR_DEVICE_INFO_ATOMIC_64:
return ReturnValue(bool{1});
case UR_DEVICE_INFO_BFLOAT16:
return ReturnValue(bool{0});
case UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT:
return ReturnValue(bool{0});
case UR_DEVICE_INFO_IMAGE_SRGB:
Expand Down
1 change: 0 additions & 1 deletion source/adapters/opencl/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
// We can't query to check if these are supported, they will need to be
// manually updated if support is ever implemented.
case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS:
case UR_DEVICE_INFO_BFLOAT16:
case UR_DEVICE_INFO_ASYNC_BARRIER: {
return ReturnValue(false);
}
Expand Down
2 changes: 0 additions & 2 deletions test/conformance/device/urDeviceGetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ static std::unordered_map<ur_device_info_t, size_t> device_info_size_map = {
sizeof(ur_memory_order_capability_flags_t)},
{UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES,
sizeof(ur_memory_scope_capability_flags_t)},
{UR_DEVICE_INFO_BFLOAT16, sizeof(ur_bool_t)},
{UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES, sizeof(uint32_t)},
{UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS, sizeof(ur_bool_t)},
{UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS, sizeof(ur_bool_t)},
Expand Down Expand Up @@ -235,7 +234,6 @@ UUR_DEVICE_TEST_SUITE_WITH_PARAM(
UR_DEVICE_INFO_BUILD_ON_SUBDEVICE, //
UR_DEVICE_INFO_ATOMIC_64, //
UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, //
UR_DEVICE_INFO_BFLOAT16, //
UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES, //
UR_DEVICE_INFO_MEMORY_BUS_WIDTH, //
UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, //
Expand Down
1 change: 0 additions & 1 deletion test/conformance/testing/include/uur/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ GetDeviceMemoryOrderCapabilities(ur_device_handle_t device,
ur_result_t
GetDeviceMemoryScopeCapabilities(ur_device_handle_t device,
ur_memory_scope_capability_flags_t &flags);
ur_result_t GetDeviceBFloat16Support(ur_device_handle_t device, bool &support);
ur_result_t GetDeviceMaxComputeQueueIndices(ur_device_handle_t device,
uint32_t &max_indices);
ur_result_t GetDeviceHostPipeRWSupported(ur_device_handle_t device,
Expand Down
4 changes: 0 additions & 4 deletions test/conformance/testing/source/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,6 @@ GetDeviceMemoryScopeCapabilities(ur_device_handle_t device,
device, UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, flags);
}

ur_result_t GetDeviceBFloat16Support(ur_device_handle_t device, bool &support) {
return GetDeviceInfo<bool>(device, UR_DEVICE_INFO_BFLOAT16, support);
}

ur_result_t GetDeviceMaxComputeQueueIndices(ur_device_handle_t device,
uint32_t &max_indices) {
return GetDeviceInfo<uint32_t>(
Expand Down
2 changes: 0 additions & 2 deletions tools/urinfo/urinfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ inline void printDeviceInfos(ur_device_handle_t hDevice,
printDeviceInfo<ur_memory_scope_capability_flags_t>(
hDevice, UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES);
std::cout << prefix;
printDeviceInfo<ur_bool_t>(hDevice, UR_DEVICE_INFO_BFLOAT16);
std::cout << prefix;
printDeviceInfo<uint32_t>(hDevice, UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES);
std::cout << prefix;
printDeviceInfo<ur_bool_t>(
Expand Down

0 comments on commit fa9891c

Please sign in to comment.