File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 1
1
// ===--------- device.cpp - Level Zero Adapter ----------------------------===//
2
2
//
3
- // Copyright (C) 2023 Intel Corporation
3
+ // Copyright (C) 2023-2024 Intel Corporation
4
4
//
5
5
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
6
6
// Exceptions. See LICENSE.TXT
@@ -337,8 +337,27 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
337
337
case UR_DEVICE_INFO_DRIVER_VERSION:
338
338
case UR_DEVICE_INFO_BACKEND_RUNTIME_VERSION:
339
339
return ReturnValue (Device->Platform ->ZeDriverVersion .c_str ());
340
- case UR_DEVICE_INFO_VERSION:
341
- return ReturnValue (Device->Platform ->ZeDriverApiVersion .c_str ());
340
+ case UR_DEVICE_INFO_VERSION: {
341
+ // from compute-runtime/shared/source/helpers/hw_ip_version.h
342
+ typedef struct {
343
+ uint32_t revision : 6 ;
344
+ uint32_t reserved : 8 ;
345
+ uint32_t release : 8 ;
346
+ uint32_t architecture : 10 ;
347
+ } version_components_t ;
348
+ typedef struct {
349
+ union {
350
+ uint32_t value;
351
+ version_components_t components;
352
+ };
353
+ } ipVersion_t;
354
+ ipVersion_t IpVersion;
355
+ IpVersion.value = Device->ZeDeviceIpVersionExt ->ipVersion ;
356
+ std::stringstream S;
357
+ S << IpVersion.components .architecture << " ."
358
+ << IpVersion.components .release << " ." << IpVersion.components .revision ;
359
+ return ReturnValue (S.str ().c_str ());
360
+ }
342
361
case UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES: {
343
362
auto Res = Device->Platform ->populateDeviceCacheIfNeeded ();
344
363
if (Res != UR_RESULT_SUCCESS) {
You can’t perform that action at this time.
0 commit comments