Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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 @@ -457,6 +457,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 @@ -253,6 +253,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 @@ -1022,6 +1022,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
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 @@ -625,6 +625,12 @@ GetDeviceMemoryScopeCapabilities(ur_device_handle_t device,
device, UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, flags);
}

ur_result_t GetDeviceBFloat16ConversionsNativeSupport(ur_device_handle_t device,
Copy link
Contributor

Choose a reason for hiding this comment

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

this helper isn't used anywhere

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, @aarongreig
I removed the unused helper.
Thanks very much.

bool &support) {
return GetDeviceInfo<bool>(device, UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_NATIVE,
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