Skip to content

Commit 1344ff0

Browse files
committed
OpenCL adapter implementation and update other adapters
1 parent 999b2b5 commit 1344ff0

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

source/adapters/cuda/device.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,9 +1087,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10871087
case UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE:
10881088
case UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE:
10891089
case UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
1090-
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP:
10911090
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
1092-
1091+
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP:
1092+
return ReturnValue(
1093+
static_cast<ur_exp_device_2d_block_array_capability_flags_t>(0));
10931094
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:
10941095
case UR_DEVICE_INFO_COMMAND_BUFFER_EVENT_SUPPORT_EXP:
10951096
return ReturnValue(true);

source/adapters/hip/device.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
904904
case UR_DEVICE_INFO_BFLOAT16:
905905
case UR_DEVICE_INFO_IL_VERSION:
906906
case UR_DEVICE_INFO_ASYNC_BARRIER:
907-
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP:
908907
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
908+
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP:
909+
return ReturnValue(
910+
static_cast<ur_exp_device_2d_block_array_capability_flags_t>(0));
909911
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: {
910912
int DriverVersion = 0;
911913
UR_CHECK_ERROR(hipDriverGetVersion(&DriverVersion));

source/adapters/native_cpu/device.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
367367
case UR_DEVICE_INFO_MEMORY_BUS_WIDTH:
368368
return UR_RESULT_ERROR_INVALID_VALUE;
369369
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP:
370-
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
370+
return ReturnValue(
371+
static_cast<ur_exp_device_2d_block_array_capability_flags_t>(0));
371372
case UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: {
372373
// Currently for Native CPU fences are implemented using OCK
373374
// builtins, so we have different capabilities than atomic operations

source/adapters/opencl/device.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,10 +1094,20 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10941094
case UR_DEVICE_INFO_MEMORY_CLOCK_RATE:
10951095
case UR_DEVICE_INFO_MEMORY_BUS_WIDTH:
10961096
case UR_DEVICE_INFO_ASYNC_BARRIER:
1097-
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP: {
10981097
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
1098+
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP: {
1099+
bool Is2DBlockIOSupported = false;
1100+
if (cl_adapter::checkDeviceExtensions(
1101+
cl_adapter::cast<cl_device_id>(hDevice),
1102+
{"cl_intel_subgroup_2d_block_io"},
1103+
Is2DBlockIOSupported) != UR_RESULT_SUCCESS ||
1104+
!Is2DBlockIOSupported) {
1105+
return ReturnValue(
1106+
static_cast<ur_exp_device_2d_block_array_capability_flags_t>(0));
1107+
}
1108+
return ReturnValue(UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_LOAD |
1109+
UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_STORE);
10991110
}
1100-
11011111
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: {
11021112
cl_device_id Dev = cl_adapter::cast<cl_device_id>(hDevice);
11031113
size_t ExtSize = 0;

0 commit comments

Comments
 (0)