From ad95ba15134fac89b6a18d54d0d5d3a094673714 Mon Sep 17 00:00:00 2001 From: Dmitry Vodopyanov Date: Mon, 15 Sep 2025 14:59:23 +0200 Subject: [PATCH 1/6] [SYCL][Doc] Add `is_gpu_integrated` query to `sycl_ext_intel_device_info` --- .../supported/sycl_ext_intel_device_info.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md index f0244e68f1552..e7c9af58643d8 100644 --- a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md +++ b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md @@ -21,6 +21,7 @@ The Feature Test Macro SYCL\_EXT\_INTEL\_DEVICE\_INFO will be defined as one of | 6 | Memory clock rate and bus width queries are supported | | 7 | Throttle reasons, fan speed and power limits queries are supported | | 8 | Device LUID and device node mask is supported | +| 9 | GPU is integrated or discrete query is supported | @@ -344,6 +345,39 @@ Then the number of hardware threads per EU can be obtained using the standard ge auto threadsCount = dev.get_info(); } +# Intel GPU is integrated or discrete # + +A new device descriptor will be added which will provide information if Intel GPU is integrated or discrete. + + +## Version ## + +The extension supports this query in version 9 and later. + +## Device Information Descriptors ## + +| Device Descriptors | Return Type | Description | +| ------------------ | ----------- | ----------- | +| ext\:\:intel\:\:info\:\:device\:\:gpu\_is\_integrated | bool | Returns `true` if GPU is integrated. Returns `false` if GPU is discrete. | + + +## Aspects ## + +A new aspect, ext\_intel\_gpu\_is\_integrated, will be added. + + +## Error Condition ## + +Throws a synchronous `exception` with the `errc::feature_not_supported` error code if the device does not have `aspect::ext_intel_gpu_is_integrated`. + +## Example Usage ## + +Then the information about if GPU is integrated or discrete can be obtained using the standard get\_info() interface. + + if (dev.has(aspect::ext_intel_gpu_is_integrated)) { + bool is_gpu_integrated = dev.get_info(); + } + # Maximum Memory Bandwidth # A new device descriptor will be added which will provide the maximum memory bandwidth. If the device is a subdevice, then the maximum bandwidth of the subdevice is returned. From 71791cbf797cf2dc013bb6f669c1374bef016ddd Mon Sep 17 00:00:00 2001 From: Dmitry Vodopyanov Date: Mon, 15 Sep 2025 17:17:27 +0200 Subject: [PATCH 2/6] Update --- ...l_ext_oneapi_device_is_integrated.asciidoc | 119 ++++++++++++++++++ .../supported/sycl_ext_intel_device_info.md | 34 ----- 2 files changed, 119 insertions(+), 34 deletions(-) create mode 100644 sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc new file mode 100644 index 0000000000000..bd7b03f6e1f06 --- /dev/null +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc @@ -0,0 +1,119 @@ += sycl_ext_oneapi_device_is_integrated + +:source-highlighter: coderay +:coderay-linenums-mode: table + +// This section needs to be after the document title. +:doctype: book +:toc2: +:toc: left +:encoding: utf-8 +:lang: en +:dpcpp: pass:[DPC++] +:endnote: —{nbsp}end{nbsp}note + +// Set the default source code type in this document to C++, +// for syntax highlighting purposes. This is needed because +// docbook uses c++ and html5 uses cpp. +:language: {basebackend@docbook:c++:cpp} + + +== Notice + +[%hardbreaks] +Copyright (C) 2025 Intel Corporation. All rights reserved. + +Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks +of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by +permission by Khronos. + + +== Contact + +To report problems with this extension, please open a new issue at: + +https://github.com/intel/llvm/issues + + +== Dependencies + +This extension is written against the SYCL 2020 revision 10 specification. +All references below to the "core SYCL specification" or to section numbers in +the SYCL specification refer to that revision. + + +== Status + +This is a proposed extension specification, intended to gather community +feedback. Interfaces defined in this specification may not be implemented yet +or may be in a preliminary state. The specification itself may also change in +incompatible ways before it is finalized. *Shipping software products should +not rely on APIs defined in this specification.* + + +== Overview + +This extension allows host code to check whether a physical device, represented +by a SYCL device, is integrated. + + +== Specification + +=== Feature test macro + +This extension provides a feature-test macro as described in the core SYCL +specification. An implementation supporting this extension must predefine the +macro `SYCL_EXT_ONEAPI_DEVICE_IS_INTEGRATED` to one of the values defined in the +implementation supports this feature, or applications can test the macro's +value to determine which of the extension's features the implementation +supports. + +[%header,cols="1,5"] +|=== +|Value +|Description + +|1 +|The APIs of this experimental extension are not versioned, so the feature-test + macro always has this value. +|=== + +=== New device aspects + +This extension adds new device aspect: + +```c++ +namespace sycl { + +enum class aspect : /*unspecified*/ { + ext_oneapi_device_is_integrated +}; + +} // namespace sycl +``` + +[width="100%",%header,cols="50%,50%"] +|=== +|Aspect +|Description + +|`ext_oneapi_device_is_integrated` +|Indicates that the device supports the `sycl::device::get_info()` call. +|=== + +=== New device descriptor + +[width="100%",%header,cols="50%,50%,50%"] +|=== +|Device descriptor +|Return type +|Description + +|`sycl::ext::oneapi::info::device::gpu_is_integrated` +|bool +|Returns `true` if device is integrated, overwise returns `false`. +|=== + +== Issues + +None. diff --git a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md index e7c9af58643d8..f0244e68f1552 100644 --- a/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md +++ b/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md @@ -21,7 +21,6 @@ The Feature Test Macro SYCL\_EXT\_INTEL\_DEVICE\_INFO will be defined as one of | 6 | Memory clock rate and bus width queries are supported | | 7 | Throttle reasons, fan speed and power limits queries are supported | | 8 | Device LUID and device node mask is supported | -| 9 | GPU is integrated or discrete query is supported | @@ -345,39 +344,6 @@ Then the number of hardware threads per EU can be obtained using the standard ge auto threadsCount = dev.get_info(); } -# Intel GPU is integrated or discrete # - -A new device descriptor will be added which will provide information if Intel GPU is integrated or discrete. - - -## Version ## - -The extension supports this query in version 9 and later. - -## Device Information Descriptors ## - -| Device Descriptors | Return Type | Description | -| ------------------ | ----------- | ----------- | -| ext\:\:intel\:\:info\:\:device\:\:gpu\_is\_integrated | bool | Returns `true` if GPU is integrated. Returns `false` if GPU is discrete. | - - -## Aspects ## - -A new aspect, ext\_intel\_gpu\_is\_integrated, will be added. - - -## Error Condition ## - -Throws a synchronous `exception` with the `errc::feature_not_supported` error code if the device does not have `aspect::ext_intel_gpu_is_integrated`. - -## Example Usage ## - -Then the information about if GPU is integrated or discrete can be obtained using the standard get\_info() interface. - - if (dev.has(aspect::ext_intel_gpu_is_integrated)) { - bool is_gpu_integrated = dev.get_info(); - } - # Maximum Memory Bandwidth # A new device descriptor will be added which will provide the maximum memory bandwidth. If the device is a subdevice, then the maximum bandwidth of the subdevice is returned. From c767268fc1a3bf65a258699db756b8dc70c616ed Mon Sep 17 00:00:00 2001 From: Dmitry Vodopyanov Date: Mon, 15 Sep 2025 17:21:06 +0200 Subject: [PATCH 3/6] Update --- .../proposed/sycl_ext_oneapi_device_is_integrated.asciidoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc index bd7b03f6e1f06..26dfc6c1a9971 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc @@ -98,7 +98,9 @@ enum class aspect : /*unspecified*/ { |Description |`ext_oneapi_device_is_integrated` -|Indicates that the device supports the `sycl::device::get_info()` call. +|Indicates that the device supports the + `sycl::device::get_info()` + call. |=== === New device descriptor From 3e0d37ef83239dd67e9888910f58a49312317ba3 Mon Sep 17 00:00:00 2001 From: Dmitry Vodopyanov Date: Tue, 16 Sep 2025 12:16:27 +0200 Subject: [PATCH 4/6] Update sycl_ext_oneapi_device_is_integrated.asciidoc --- .../proposed/sycl_ext_oneapi_device_is_integrated.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc index 26dfc6c1a9971..3a927c3a1a595 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc @@ -99,7 +99,7 @@ enum class aspect : /*unspecified*/ { |`ext_oneapi_device_is_integrated` |Indicates that the device supports the - `sycl::device::get_info()` + `sycl::device::get_info()` call. |=== @@ -111,7 +111,7 @@ enum class aspect : /*unspecified*/ { |Return type |Description -|`sycl::ext::oneapi::info::device::gpu_is_integrated` +|`sycl::ext::oneapi::info::device::device_is_integrated` |bool |Returns `true` if device is integrated, overwise returns `false`. |=== From b5f7d52f11969bdfda181c5d8e52c87a2dae969f Mon Sep 17 00:00:00 2001 From: Dmitry Vodopyanov Date: Tue, 16 Sep 2025 15:57:26 +0200 Subject: [PATCH 5/6] Update sycl_ext_oneapi_device_is_integrated.asciidoc --- .../proposed/sycl_ext_oneapi_device_is_integrated.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc index 3a927c3a1a595..844df7ba7e7b8 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc @@ -54,7 +54,7 @@ not rely on APIs defined in this specification.* == Overview This extension allows host code to check whether a physical device, represented -by a SYCL device, is integrated. +by a SYCL device, is integrated with the host. == Specification @@ -113,7 +113,7 @@ enum class aspect : /*unspecified*/ { |`sycl::ext::oneapi::info::device::device_is_integrated` |bool -|Returns `true` if device is integrated, overwise returns `false`. +|Returns `true` if device is integrated, otherwise returns `false`. |=== == Issues From 657d782b629dfdb679c791a5ae15c95f20bb28da Mon Sep 17 00:00:00 2001 From: Dmitry Vodopyanov Date: Thu, 2 Oct 2025 16:26:53 +0200 Subject: [PATCH 6/6] Apply CR feedback --- ..._oneapi_device_is_integrated_gpu.asciidoc} | 39 +++++++------------ 1 file changed, 14 insertions(+), 25 deletions(-) rename sycl/doc/extensions/proposed/{sycl_ext_oneapi_device_is_integrated.asciidoc => sycl_ext_oneapi_device_is_integrated_gpu.asciidoc} (69%) diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated_gpu.asciidoc similarity index 69% rename from sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc rename to sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated_gpu.asciidoc index 844df7ba7e7b8..e48ef4ba40ca1 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_is_integrated_gpu.asciidoc @@ -1,4 +1,4 @@ -= sycl_ext_oneapi_device_is_integrated += sycl_ext_oneapi_device_is_integrated_gpu :source-highlighter: coderay :coderay-linenums-mode: table @@ -53,8 +53,11 @@ not rely on APIs defined in this specification.* == Overview -This extension allows host code to check whether a physical device, represented -by a SYCL device, is integrated with the host. +This extension allows host code to check whether a SYCL GPU device is "integrated" +or "discrete". An integrated GPU device often shares memory with the host CPU, +while a discrete GPU is often a separate card with its own memory. However, some +GPU devices may not fit neatly into either category, so implementors may provide +their own judgement when categorizing a GPU device as "integrated" vs. "discrete". == Specification @@ -63,9 +66,9 @@ by a SYCL device, is integrated with the host. This extension provides a feature-test macro as described in the core SYCL specification. An implementation supporting this extension must predefine the -macro `SYCL_EXT_ONEAPI_DEVICE_IS_INTEGRATED` to one of the values defined in the -implementation supports this feature, or applications can test the macro's -value to determine which of the extension's features the implementation +macro `SYCL_EXT_ONEAPI_DEVICE_IS_INTEGRATED_GPU` to one of the values defined +in the implementation supports this feature, or applications can test the +macro's value to determine which of the extension's features the implementation supports. [%header,cols="1,5"] @@ -78,7 +81,7 @@ supports. macro always has this value. |=== -=== New device aspects +=== New device aspect This extension adds new device aspect: @@ -86,7 +89,7 @@ This extension adds new device aspect: namespace sycl { enum class aspect : /*unspecified*/ { - ext_oneapi_device_is_integrated + ext_oneapi_is_integrated_gpu }; } // namespace sycl @@ -97,23 +100,9 @@ enum class aspect : /*unspecified*/ { |Aspect |Description -|`ext_oneapi_device_is_integrated` -|Indicates that the device supports the - `sycl::device::get_info()` - call. -|=== - -=== New device descriptor - -[width="100%",%header,cols="50%,50%,50%"] -|=== -|Device descriptor -|Return type -|Description - -|`sycl::ext::oneapi::info::device::device_is_integrated` -|bool -|Returns `true` if device is integrated, otherwise returns `false`. +|`ext_oneapi_is_integrated_gpu` +|Indicates that the implementation identifies this device as integrated GPU. All devices +that have this aspect also have `aspect::gpu`. |=== == Issues