Skip to content

Commit b8160c6

Browse files
dm-vodopyanovbb-ur
authored andcommitted
1 parent ca72b9b commit b8160c6

7 files changed

Lines changed: 117 additions & 0 deletions

File tree

include/ur_api.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

include/ur_print.hpp

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<%
2+
OneApi=tags['$OneApi']
3+
x=tags['$x']
4+
X=x.upper()
5+
%>
6+
7+
.. _experimental-device-is-integrated-gpu:
8+
9+
================================================================================
10+
Device is integrated GPU
11+
================================================================================
12+
13+
.. warning::
14+
15+
Experimental features:
16+
17+
* May be replaced, updated, or removed at any time.
18+
* Do not require maintaining API/ABI stability of their own additions over
19+
time.
20+
* Do not require conformance testing of their own additions.
21+
22+
23+
Motivation
24+
--------------------------------------------------------------------------------
25+
This experimental extension enables the sycl_ext_oneapi_device_is_integrated_gpu
26+
feature:
27+
http://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_device_is_integrated_gpu.asciidoc.
28+
It introduces descriptor to query if device is integrated GPU.
29+
30+
API
31+
--------------------------------------------------------------------------------
32+
33+
Enums
34+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35+
* ${x}_device_info_t
36+
* ${X}_DEVICE_INFO_IS_INTEGRATED_GPU
37+
38+
Changelog
39+
--------------------------------------------------------------------------------
40+
41+
+-----------+------------------------+
42+
| Revision | Changes |
43+
+===========+========================+
44+
| 1.0 | Initial Draft |
45+
+-----------+------------------------+
46+
47+
48+
Support
49+
--------------------------------------------------------------------------------
50+
51+
Adapters which support this experimental feature *must* return ${X}_RESULT_SUCCESS
52+
from the ${x}DeviceGetInfo call with this new ${X}_DEVICE_INFO_IS_INTEGRATED_GPU
53+
device descriptor.
54+
55+
Contributors
56+
--------------------------------------------------------------------------------
57+
58+
* Vodopyanov, Dmitry `dmitry.vodopyanov@intel.com <dmitry.vodopyanov@intel.com>`_
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# Copyright (C) 2025 Intel Corporation
3+
#
4+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
5+
# Exceptions.
6+
# See LICENSE.TXT
7+
#
8+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9+
#
10+
# See YaML.md for syntax definition
11+
#
12+
--- #--------------------------------------------------------------------------
13+
type: header
14+
desc: "Intel $OneApi Unified Runtime Experimental APIs for quering if device is integrated GPU"
15+
ordinal: "99"
16+
--- #--------------------------------------------------------------------------
17+
type: enum
18+
extend: true
19+
typed_etors: true
20+
desc: "Extension enums for $x_device_info_t to support quering if device is integrated GPU."
21+
name: $x_device_info_t
22+
etors:
23+
- name: IS_INTEGRATED_GPU
24+
value: "0x2070"
25+
desc: "[$x_bool_t] returns true if the device is integrated GPU."

source/adapters/level_zero/device.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,8 @@ ur_result_t urDeviceGetInfo(
14611461
case UR_DEVICE_INFO_CLOCK_DEVICE_SUPPORT_EXP:
14621462
// Currently GPUs only support sub-group clock.
14631463
return ReturnValue(false);
1464+
case UR_DEVICE_INFO_IS_INTEGRATED_GPU:
1465+
return ReturnValue(static_cast<ur_bool_t>(Device->isIntegrated() != 0));
14641466
default:
14651467
UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo");
14661468
UR_LOG(ERR, "ParamNameParamName={}(0x{})", ParamName,

source/adapters/opencl/device.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,18 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
15101510
}
15111511
return ReturnValue(Supported);
15121512
}
1513+
case UR_DEVICE_INFO_IS_INTEGRATED_GPU: {
1514+
cl_bool CLValue;
1515+
1516+
// TODO: use stable API instead of deprecated CL_DEVICE_HOST_UNIFIED_MEMORY.
1517+
// Currently CL_DEVICE_HOST_UNIFIED_MEMORY is deprecated by OpenCL 2.0, but
1518+
// still was not removed even from Intel implementations of OpenCL 3.0.
1519+
CL_RETURN_ON_FAILURE(clGetDeviceInfo(hDevice->CLDevice,
1520+
CL_DEVICE_HOST_UNIFIED_MEMORY,
1521+
sizeof(cl_bool), &CLValue, nullptr));
1522+
1523+
return ReturnValue(static_cast<ur_bool_t>(CLValue));
1524+
}
15131525
// TODO: We can't query to check if these are supported, they will need to be
15141526
// manually updated if support is ever implemented.
15151527
case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS:

tools/urinfo/urinfo.hpp

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)