|
| 1 | += sycl_ext_intel_kernel_queries |
| 2 | + |
| 3 | +:source-highlighter: coderay |
| 4 | +:coderay-linenums-mode: table |
| 5 | + |
| 6 | +// This section needs to be after the document title. |
| 7 | +:doctype: book |
| 8 | +:toc2: |
| 9 | +:toc: left |
| 10 | +:encoding: utf-8 |
| 11 | +:lang: en |
| 12 | +:dpcpp: pass:[DPC++] |
| 13 | +:endnote: —{nbsp}end{nbsp}note |
| 14 | + |
| 15 | +// Set the default source code type in this document to C++, |
| 16 | +// for syntax highlighting purposes. This is needed because |
| 17 | +// docbook uses c++ and html5 uses cpp. |
| 18 | +:language: {basebackend@docbook:c++:cpp} |
| 19 | + |
| 20 | + |
| 21 | +== Notice |
| 22 | + |
| 23 | +[%hardbreaks] |
| 24 | +Copyright (C) 2025 Intel Corporation. All rights reserved. |
| 25 | + |
| 26 | +Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks |
| 27 | +of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by |
| 28 | +permission by Khronos. |
| 29 | + |
| 30 | + |
| 31 | +== Contact |
| 32 | + |
| 33 | +To report problems with this extension, please open a new issue at: |
| 34 | + |
| 35 | +https://github.com/intel/llvm/issues |
| 36 | + |
| 37 | + |
| 38 | +== Dependencies |
| 39 | + |
| 40 | +This extension is written against the SYCL 2020 revision 9 specification. |
| 41 | +All references below to the "core SYCL specification" or to section numbers in |
| 42 | +the SYCL specification refer to that revision. |
| 43 | + |
| 44 | + |
| 45 | +== Status |
| 46 | + |
| 47 | +This extension is implemented and fully supported by {dpcpp}. |
| 48 | + |
| 49 | + |
| 50 | +== Overview |
| 51 | + |
| 52 | +This extension contains a collection of queries that provide low-level |
| 53 | +information about kernels. |
| 54 | +These queries generally forward directly to the backend and expose concepts that |
| 55 | +are specific to a particular implementation. |
| 56 | +As a result, these queries may not be supported for all devices. |
| 57 | +Each query has an associate device aspect, which tells whether the query is |
| 58 | +supported on that device. |
| 59 | + |
| 60 | + |
| 61 | +== Specification |
| 62 | + |
| 63 | +=== Feature test macro |
| 64 | + |
| 65 | +This extension provides a feature-test macro as described in the core SYCL |
| 66 | +specification. |
| 67 | +An implementation supporting this extension must predefine the macro |
| 68 | +`SYCL_EXT_INTEL_KERNEL_QUERIES` to one of the values defined in the table below. |
| 69 | +Applications can test for the existence of this macro to determine if the |
| 70 | +implementation supports this feature, or applications can test the macro's value |
| 71 | +to determine which of the extension's features the implementation supports. |
| 72 | + |
| 73 | +[%header,cols="1,5"] |
| 74 | +|=== |
| 75 | +|Value |
| 76 | +|Description |
| 77 | + |
| 78 | +|1 |
| 79 | +|Initial version of this extension. |
| 80 | +|=== |
| 81 | + |
| 82 | +=== Spill memory size |
| 83 | + |
| 84 | +This query returns the kernel's spill memory size that is allocated by the |
| 85 | +compiler, as reported by Level Zero. |
| 86 | + |
| 87 | +==== New device aspect |
| 88 | + |
| 89 | +This extension adds the following new device aspect. |
| 90 | + |
| 91 | +[source,c++] |
| 92 | +---- |
| 93 | +namespace sycl { |
| 94 | +
|
| 95 | +enum class aspect { |
| 96 | + ext_intel_spill_memory_size |
| 97 | +
|
| 98 | + // ... |
| 99 | +}; |
| 100 | +
|
| 101 | +} |
| 102 | +---- |
| 103 | + |
| 104 | +''' |
| 105 | + |
| 106 | +`*ext_intel_spill_memory_size*` |
| 107 | + |
| 108 | +Indicates that the `spill_memory_size` kernel information descriptor may be used |
| 109 | +to query kernels for this device. |
| 110 | + |
| 111 | +''' |
| 112 | + |
| 113 | +==== New device specific kernel information descriptor |
| 114 | + |
| 115 | +This extension adds the following information descriptor that can be used with |
| 116 | +`kernel::get_info(const device&)`. |
| 117 | + |
| 118 | +''' |
| 119 | + |
| 120 | +`*ext::intel::info::kernel_device_specific::spill_memory_size*` |
| 121 | + |
| 122 | +[source,c++] |
| 123 | +---- |
| 124 | +namespace sycl::ext::intel::info::kernel_device_specific { |
| 125 | +struct spill_memory_size { |
| 126 | + using return_type = size_t; |
| 127 | +}; |
| 128 | +} // namespace sycl::ext::intel::info::kernel_device_specific |
| 129 | +---- |
| 130 | + |
| 131 | +_Remarks:_ Template parameter to `kernel::get_info(const device&)`. |
| 132 | + |
| 133 | +_Returns:_ The spill memory size that is allocated by the compiler for this |
| 134 | +kernel for the given device. |
| 135 | + |
| 136 | +_Throws:_ An `exception` with the `errc::feature_not_supported` error code if |
| 137 | +the device does not have `aspect::ext_intel_spill_memory_size`. |
| 138 | + |
| 139 | +''' |
0 commit comments