Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions unified-runtime/include/ur_api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions unified-runtime/include/ur_print.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions unified-runtime/scripts/core/device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ etors:
available for this device.
- name: KERNEL_SET_SPECIALIZATION_CONSTANTS
desc: "[$x_bool_t] support the $xKernelSetSpecializationConstants entry point"
- name: BFLOAT16_CONVERSIONS_INTEL
desc: "[$x_bool_t] support for native bfloat16 conversions"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid rewriting all of the enum values, move this new entry to the end of the array, i.e. after line 451.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this to the bottom and run the generate again please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @kbenzie
Fixed.
Thanks very much.

- name: MEMORY_BUS_WIDTH
desc: "[uint32_t][optional-query] return the width in bits of the memory bus interface of the device."
- name: MAX_WORK_GROUPS_3D
Expand Down
2 changes: 2 additions & 0 deletions unified-runtime/source/adapters/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
bool BFloat16 = (Major >= 8) ? true : false;
return ReturnValue(BFloat16);
}
case UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL:
return ReturnValue(false);
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: 2 additions & 0 deletions unified-runtime/source/adapters/hip/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
#endif
case UR_DEVICE_INFO_BFLOAT16:
return ReturnValue(true);
case UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL:
return ReturnValue(false);
case UR_DEVICE_INFO_ASYNC_BARRIER:
return ReturnValue(false);
case UR_DEVICE_INFO_IL_VERSION:
Expand Down
8 changes: 8 additions & 0 deletions unified-runtime/source/adapters/level_zero/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,14 @@ ur_result_t urDeviceGetInfo(
return ze2urResult(errc);
return ReturnValue(UrRootDev);
}
case UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL: {
bool Bfloat16ConversionSupport =
(Device->Platform->zeDriverExtensionMap.count(
ZE_BFLOAT16_CONVERSIONS_EXT_NAME)) ||
((Device->ZeDeviceProperties->deviceId & 0xfff) == 0x201 ||
(Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0);
return ReturnValue(Bfloat16ConversionSupport);
}
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:
return ReturnValue(true);
case UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_CAPABILITIES_EXP: {
Expand Down
2 changes: 2 additions & 0 deletions unified-runtime/source/adapters/native_cpu/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return ReturnValue(bool{1});
case UR_DEVICE_INFO_BFLOAT16:
return ReturnValue(bool{0});
case UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL:
return ReturnValue(bool{0});
case UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT:
return ReturnValue(bool{0});
case UR_DEVICE_INFO_IMAGE_SRGB:
Expand Down
7 changes: 7 additions & 0 deletions unified-runtime/source/adapters/opencl/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return ReturnValue(UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_LOAD |
UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_STORE);
}
case UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL: {
bool Supported = false;
UR_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions(
cl_adapter::cast<cl_device_id>(hDevice),
{"cl_intel_bfloat16_conversions"}, Supported));
return ReturnValue(Supported);
}
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: {
cl_device_id Dev = cl_adapter::cast<cl_device_id>(hDevice);
size_t ExtSize = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ TEST_P(urDeviceGetInfoTest, SuccessAtomicFenceScopeCapabilities) {
ASSERT_EQ(property_value & UR_MEMORY_SCOPE_CAPABILITY_FLAGS_MASK, 0);
}

TEST_P(urDeviceGetInfoTest, SuccessBFloat64) {
TEST_P(urDeviceGetInfoTest, SuccessBFloat16) {
size_t property_size = 0;
const ur_device_info_t property_name = UR_DEVICE_INFO_BFLOAT16;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for the old deprecated bfloat16 query, there's a pr open to remove it https://github.com/intel/llvm/pull/17053/files#diff-4ad6c68f3c3e27ec6c124dab1d1c2cd28dc6bba6f4e0960f44eec79b3c0c1c98

for testing if you could just copy this function but rename the test and update property_name that'd be ideal, like this:

TEST_P(urDeviceGetInfoTest, SuccessBFloat16Conversions) {
  size_t property_size = 0;
  const ur_device_info_t property_name = UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL;


Expand Down
6 changes: 6 additions & 0 deletions unified-runtime/test/conformance/testing/source/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,12 @@ ur_result_t GetDeviceBFloat16Support(ur_device_handle_t device, bool &support) {
return GetDeviceInfo<bool>(device, UR_DEVICE_INFO_BFLOAT16, support);
}

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

ur_result_t GetDeviceMaxComputeQueueIndices(ur_device_handle_t device,
uint32_t &max_indices) {
return GetDeviceInfo<uint32_t>(
Expand Down
3 changes: 3 additions & 0 deletions unified-runtime/tools/urinfo/urinfo.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading