Skip to content

Commit f431324

Browse files
committed
Add sub for other adapters and guard L0 implementation with extension macro
1 parent 7467544 commit f431324

File tree

7 files changed

+15
-1
lines changed

7 files changed

+15
-1
lines changed

source/adapters/cuda/device.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10851085
case UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE:
10861086
case UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE:
10871087
case UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
1088+
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP:
10881089
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
10891090

10901091
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:

source/adapters/hip/device.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
902902
case UR_DEVICE_INFO_BFLOAT16:
903903
case UR_DEVICE_INFO_IL_VERSION:
904904
case UR_DEVICE_INFO_ASYNC_BARRIER:
905+
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP:
905906
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
906907
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: {
907908
int DriverVersion = 0;

source/adapters/level_zero/common.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,13 @@ template <> zes_structure_type_t getZesStructureType<zes_mem_properties_t>() {
330330
return ZES_STRUCTURE_TYPE_MEM_PROPERTIES;
331331
}
332332

333+
#ifdef ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_NAME
333334
template <>
334335
ze_structure_type_t
335336
getZeStructureType<ze_intel_device_block_array_exp_properties_t>() {
336337
return ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_PROPERTIES;
337338
}
339+
#endif // ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_NAME
338340

339341
// Global variables for ZER_EXT_RESULT_ADAPTER_SPECIFIC_ERROR
340342
thread_local ur_result_t ErrorMessageCode = UR_RESULT_SUCCESS;

source/adapters/level_zero/device.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,7 @@ ur_result_t urDeviceGetInfo(
11561156
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
11571157
return ReturnValue(true);
11581158
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP: {
1159+
#ifdef ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_NAME
11591160
const auto ZeDeviceBlockArrayFlags =
11601161
Device->ZeDeviceBlockArrayProperties->flags;
11611162

@@ -1172,6 +1173,9 @@ ur_result_t urDeviceGetInfo(
11721173
BlockArrayCapabilities |= UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_STORE;
11731174
}
11741175
return ReturnValue(BlockArrayCapabilities);
1176+
#else
1177+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
1178+
#endif
11751179
}
11761180
default:
11771181
logger::error("Unsupported ParamName in urGetDeviceInfo");
@@ -1581,6 +1585,7 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal,
15811585
ZE_CALL_NOCHECK(zeDeviceGetProperties, (ZeDevice, &P));
15821586
};
15831587

1588+
#ifdef ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_NAME
15841589
ZeDeviceBlockArrayProperties.Compute =
15851590
[ZeDevice](
15861591
ZeStruct<ze_intel_device_block_array_exp_properties_t> &Properties) {
@@ -1589,6 +1594,7 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal,
15891594
P.pNext = &Properties;
15901595
ZE_CALL_NOCHECK(zeDeviceGetProperties, (ZeDevice, &P));
15911596
};
1597+
#endif // ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_NAME
15921598

15931599
ImmCommandListUsed = this->useImmediateCommandLists();
15941600

source/adapters/level_zero/device.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,10 @@ struct ur_device_handle_t_ : _ur_object {
223223
ZeCache<struct ze_global_memsize> ZeGlobalMemSize;
224224
ZeCache<ZeStruct<ze_mutable_command_list_exp_properties_t>>
225225
ZeDeviceMutableCmdListsProperties;
226+
#ifdef ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_NAME
226227
ZeCache<ZeStruct<ze_intel_device_block_array_exp_properties_t>>
227228
ZeDeviceBlockArrayProperties;
229+
#endif // ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_NAME
228230

229231
// Map device bindless image offset to corresponding host image handle.
230232
std::unordered_map<ur_exp_image_native_handle_t, ze_image_handle_t>

source/adapters/native_cpu/device.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
365365
case UR_DEVICE_INFO_MAX_WORK_GROUPS_3D:
366366
case UR_DEVICE_INFO_MEMORY_CLOCK_RATE:
367367
case UR_DEVICE_INFO_MEMORY_BUS_WIDTH:
368+
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP:
368369
return UR_RESULT_ERROR_INVALID_VALUE;
369370
case UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: {
370371
// Currently for Native CPU fences are implemented using OCK

source/adapters/opencl/device.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10671067
case UR_DEVICE_INFO_GLOBAL_MEM_FREE:
10681068
case UR_DEVICE_INFO_MEMORY_CLOCK_RATE:
10691069
case UR_DEVICE_INFO_MEMORY_BUS_WIDTH:
1070-
case UR_DEVICE_INFO_ASYNC_BARRIER: {
1070+
case UR_DEVICE_INFO_ASYNC_BARRIER:
1071+
case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP: {
10711072
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
10721073
}
10731074

0 commit comments

Comments
 (0)