Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 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 @@ -460,6 +460,8 @@ etors:
desc: "[int32_t][optional-query] return min power limit in milliwatts."
- name: MAX_POWER_LIMIT
desc: "[int32_t][optional-query] return max power limit in milliwatts."
- name: BFLOAT16_CONVERSIONS_NATIVE
desc: "[$x_bool_t] support for native bfloat16 conversions"
--- #--------------------------------------------------------------------------
type: function
desc: "Retrieves various information about device"
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 @@ -254,6 +254,8 @@ 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_CONVERSIONS_NATIVE:
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 @@ -1023,6 +1023,8 @@ 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_CONVERSIONS_NATIVE:
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_NATIVE: {
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 @@ -344,6 +344,8 @@ 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_CONVERSIONS_NATIVE:
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 @@ -1514,6 +1514,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_NATIVE: {
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
17 changes: 17 additions & 0 deletions unified-runtime/test/conformance/device/urDeviceGetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,23 @@ TEST_P(urDeviceGetInfoTest, SuccessUseNativeAssert) {
property_value);
}

TEST_P(urDeviceGetInfoTest, SuccessBfloat16ConversionsNative) {
size_t property_size = 0;
const ur_device_info_t property_name =
UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_NATIVE;

ASSERT_SUCCESS_OR_OPTIONAL_QUERY(
urDeviceGetInfo(device, property_name, 0, nullptr, &property_size),
property_name);
ASSERT_EQ(property_size, sizeof(ur_bool_t));

uint32_t property_value = 0;
ASSERT_QUERY_RETURNS_VALUE(urDeviceGetInfo(device, property_name,
property_size, &property_value,
nullptr),
property_value);
}

TEST_P(urDeviceGetInfoTest, SuccessThrottleReasons) {
// TODO: enable when driver/library version mismatch is fixed in CI.
// See https://github.com/intel/llvm/issues/17614
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