Skip to content

Commit e30dc8c

Browse files
[SYCL] Implement sycl_ext_oneapi_device_architecture on host for Level Zero and OpenCL (intel#9843)
This patch introduces new host API for sycl_ext_oneapi_device_architecture extension and implements it, currently only for Level Zero and OpenCL Depends on - oneapi-src/unified-runtime#573 - intel#9873 - intel#9979 - intel#10054
1 parent 02d7c54 commit e30dc8c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ur_level_zero_common.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ ze_structure_type_t getZeStructureType<ze_device_memory_ext_properties_t>() {
239239
return ZE_STRUCTURE_TYPE_DEVICE_MEMORY_EXT_PROPERTIES;
240240
}
241241
template <>
242+
ze_structure_type_t getZeStructureType<ze_device_ip_version_ext_t>() {
243+
return ZE_STRUCTURE_TYPE_DEVICE_IP_VERSION_EXT;
244+
}
245+
template <>
242246
ze_structure_type_t getZeStructureType<ze_device_memory_access_properties_t>() {
243247
return ZE_STRUCTURE_TYPE_DEVICE_MEMORY_ACCESS_PROPERTIES;
244248
}

ur_level_zero_device.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
396396
uint32_t{1});
397397
case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE:
398398
return ReturnValue(uint64_t{Device->ZeDeviceCacheProperties->cacheSize});
399+
case UR_DEVICE_INFO_IP_VERSION:
400+
return ReturnValue(uint32_t{Device->ZeDeviceIpVersionExt->ipVersion});
399401
case UR_DEVICE_INFO_MAX_PARAMETER_SIZE:
400402
return ReturnValue(
401403
size_t{Device->ZeDeviceModuleProperties->maxArgumentsSize});
@@ -908,6 +910,14 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal,
908910
ZE_CALL_NOCHECK(zeDeviceGetComputeProperties, (ZeDevice, &Properties));
909911
};
910912

913+
ZeDeviceIpVersionExt.Compute =
914+
[ZeDevice](ze_device_ip_version_ext_t &Properties) {
915+
ze_device_properties_t P;
916+
P.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES;
917+
P.pNext = (void *)&Properties;
918+
ZE_CALL_NOCHECK(zeDeviceGetProperties, (ZeDevice, &P));
919+
};
920+
911921
ZeDeviceImageProperties.Compute =
912922
[ZeDevice](ze_device_image_properties_t &Properties) {
913923
ZE_CALL_NOCHECK(zeDeviceGetImageProperties, (ZeDevice, &Properties));

ur_level_zero_device.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,5 @@ struct ur_device_handle_t_ : _ur_object {
168168
ZeCache<ZeStruct<ze_device_memory_access_properties_t>>
169169
ZeDeviceMemoryAccessProperties;
170170
ZeCache<ZeStruct<ze_device_cache_properties_t>> ZeDeviceCacheProperties;
171+
ZeCache<ZeStruct<ze_device_ip_version_ext_t>> ZeDeviceIpVersionExt;
171172
};

0 commit comments

Comments
 (0)