Skip to content

Commit

Permalink
[SYCL] Implement sycl_ext_oneapi_device_architecture on host for Leve…
Browse files Browse the repository at this point in the history
…l Zero and OpenCL (#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#573
- intel/llvm#9873
- intel/llvm#9979
- intel/llvm#10054
  • Loading branch information
dm-vodopyanov authored and omarahmed1111 committed Oct 23, 2023
1 parent 15d6b32 commit 5123470
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ur_level_zero_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ ze_structure_type_t getZeStructureType<ze_device_memory_ext_properties_t>() {
return ZE_STRUCTURE_TYPE_DEVICE_MEMORY_EXT_PROPERTIES;
}
template <>
ze_structure_type_t getZeStructureType<ze_device_ip_version_ext_t>() {
return ZE_STRUCTURE_TYPE_DEVICE_IP_VERSION_EXT;
}
template <>
ze_structure_type_t getZeStructureType<ze_device_memory_access_properties_t>() {
return ZE_STRUCTURE_TYPE_DEVICE_MEMORY_ACCESS_PROPERTIES;
}
Expand Down
10 changes: 10 additions & 0 deletions ur_level_zero_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
uint32_t{1});
case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE:
return ReturnValue(uint64_t{Device->ZeDeviceCacheProperties->cacheSize});
case UR_DEVICE_INFO_IP_VERSION:
return ReturnValue(uint32_t{Device->ZeDeviceIpVersionExt->ipVersion});
case UR_DEVICE_INFO_MAX_PARAMETER_SIZE:
return ReturnValue(
size_t{Device->ZeDeviceModuleProperties->maxArgumentsSize});
Expand Down Expand Up @@ -908,6 +910,14 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal,
ZE_CALL_NOCHECK(zeDeviceGetComputeProperties, (ZeDevice, &Properties));
};

ZeDeviceIpVersionExt.Compute =
[ZeDevice](ze_device_ip_version_ext_t &Properties) {
ze_device_properties_t P;
P.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES;
P.pNext = (void *)&Properties;
ZE_CALL_NOCHECK(zeDeviceGetProperties, (ZeDevice, &P));
};

ZeDeviceImageProperties.Compute =
[ZeDevice](ze_device_image_properties_t &Properties) {
ZE_CALL_NOCHECK(zeDeviceGetImageProperties, (ZeDevice, &Properties));
Expand Down
1 change: 1 addition & 0 deletions ur_level_zero_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,5 @@ struct ur_device_handle_t_ : _ur_object {
ZeCache<ZeStruct<ze_device_memory_access_properties_t>>
ZeDeviceMemoryAccessProperties;
ZeCache<ZeStruct<ze_device_cache_properties_t>> ZeDeviceCacheProperties;
ZeCache<ZeStruct<ze_device_ip_version_ext_t>> ZeDeviceIpVersionExt;
};

0 comments on commit 5123470

Please sign in to comment.