|
| 1 | += SYCL_INTEL_device_specific_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 | + |
| 13 | +:blank: pass:[ +] |
| 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 | +// This is necessary for asciidoc, but not for asciidoctor |
| 21 | +:cpp: C++ |
| 22 | + |
| 23 | +== Introduction |
| 24 | +IMPORTANT: This specification is a draft. |
| 25 | + |
| 26 | +NOTE: Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are |
| 27 | +trademarks of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. |
| 28 | +used by permission by Khronos. |
| 29 | + |
| 30 | +NOTE: This document is better viewed when rendered as html with asciidoctor. |
| 31 | +GitHub does not render image icons. |
| 32 | + |
| 33 | +This document describes an extension to rename device-specific kernel queries |
| 34 | +to better describe the operations performed. |
| 35 | + |
| 36 | +== Name Strings |
| 37 | + |
| 38 | ++SYCL_INTEL_device_specific_kernel_queries+ |
| 39 | + |
| 40 | +== Notice |
| 41 | + |
| 42 | +Copyright (c) 2020 Intel Corporation. All rights reserved. |
| 43 | + |
| 44 | +== Status |
| 45 | + |
| 46 | +Working Draft |
| 47 | + |
| 48 | +This is a preview extension specification, intended to provide early access to |
| 49 | +a feature for review and community feedback. When the feature matures, this |
| 50 | +specification may be released as a formal extension. |
| 51 | + |
| 52 | +Because the interfaces defined by this specification are not final and are |
| 53 | +subject to change they are not intended to be used by shipping software |
| 54 | +products. |
| 55 | + |
| 56 | +== Version |
| 57 | + |
| 58 | +Built On: {docdate} + |
| 59 | +Revision: 1 |
| 60 | + |
| 61 | +== Contact |
| 62 | +Felipe de Azevedo Piovezan, Intel (felipe 'dot' de 'dot' azevedo 'dot' piovezan 'at' intel 'dot' com) |
| 63 | + |
| 64 | +== Dependencies |
| 65 | + |
| 66 | +This extension is written against the SYCL 1.2.1 specification, Revision 6. |
| 67 | + |
| 68 | +== Overview |
| 69 | + |
| 70 | +OpenCL provides two functions for querying properties of a kernel: |
| 71 | +`clGetKernelInfo` is used for kernel properties that are device agnostic, |
| 72 | +whereas `clGetKernelWorkGroupInfo` is used for kernel and work-group properties |
| 73 | +that depend on a specific device. The name `clGetKernelWorkGroupInfo` doesn't |
| 74 | +convey the API's intended use explicitly, that is, queries for |
| 75 | +*device-specific* properties. In this sense, `clGetKernelWorkGroupInfo` is a |
| 76 | +misnomer for some uses of the API. |
| 77 | + |
| 78 | +SYCL inherited these names in the form of the queries `kernel::get_info` and |
| 79 | +`kernel::get_work_group_info`. This extension renames the latter (and its |
| 80 | +template arguments as appropriate) in order to align the query name with its |
| 81 | +functionality. |
| 82 | + |
| 83 | +== Modifications of SYCL 1.2.1 Specification |
| 84 | + |
| 85 | +=== Change Section 4.8.7 Kernel class |
| 86 | + |
| 87 | +==== Change `kernel` class interface |
| 88 | + |
| 89 | +Remove lines 29-31 (inclusive) from the `kernel` class interface: |
| 90 | + |
| 91 | +[source,c++,`sycl::kernel`,linenums] |
| 92 | +---- |
| 93 | +template <info::kernel_work_group param> |
| 94 | +typename info::param_traits<info::kernel_work_group, param>::return_type |
| 95 | +get_work_group_info(const device &dev) const; |
| 96 | +---- |
| 97 | + |
| 98 | +Add function overload `get_info` to the `kernel` class interface: |
| 99 | + |
| 100 | +[source,c++,`sycl::kernel`,linenums] |
| 101 | +---- |
| 102 | +template <info::kernel_device_specific param> |
| 103 | +typename info::param_traits<info::kernel_device_specific, param>::return_type |
| 104 | +get_info(const device &dev) const; |
| 105 | +---- |
| 106 | + |
| 107 | +==== Change table 4.83 Member functions of the Kernel class |
| 108 | + |
| 109 | +Remove row `get_work_group_info(const device &dev)`: |
| 110 | + |
| 111 | +[width="40%",frame="topbot",options="header,footer"] |
| 112 | +|====================== |
| 113 | +|Member functions |Description |
| 114 | +|`template <info::kernel_work_group param>typename info::param_traits<info::kernel_work_group, param>::return_type get_work_group_info(const device &dev)const` | |
| 115 | +Query information from the work-group from a kernel using the info::kernel_work_group descriptor for a specific device |
| 116 | +|====================== |
| 117 | + |
| 118 | +Add row `get_info(const device &dev)`: |
| 119 | + |
| 120 | +[width="40%",frame="topbot",options="header,footer"] |
| 121 | +|====================== |
| 122 | +|Member functions |Description |
| 123 | +|`template <info::kernel_device_specific param>typename info::param_traits<info::kernel_device_specific, param>::return_type get_info(const device &dev)const` | |
| 124 | +Query information from a kernel using the info::kernel_device_specific descriptor for a specific device. |
| 125 | +|====================== |
| 126 | + |
| 127 | +==== Change table 4.85 Kernel work-group information descriptors |
| 128 | + |
| 129 | +Rename table to: +Kernel device-specific information descriptors+. |
| 130 | + |
| 131 | +Replace all references to `info::kernel_work_group` with |
| 132 | +`info::kernel_device_specific`. |
| 133 | + |
| 134 | +==== Change A.5 Kernel Information Descriptors |
| 135 | + |
| 136 | +Rename `enum class kernel_work_group: int` to `enum class |
| 137 | +kernel_device_specific: int`. |
| 138 | + |
| 139 | +== Issues |
| 140 | + |
| 141 | +None. |
| 142 | + |
| 143 | +== Revision History |
| 144 | + |
| 145 | +[cols="5,15,15,70"] |
| 146 | +[grid="rows"] |
| 147 | +[options="header"] |
| 148 | +|======================================== |
| 149 | +|Rev|Date|Author|Changes |
| 150 | +|1|2020-04-15|Felipe de Azevedo Piovezan|*Initial public working draft* |
| 151 | +|======================================== |
| 152 | + |
| 153 | +//************************************************************************ |
| 154 | +//Other formatting suggestions: |
| 155 | +// |
| 156 | +//* Use *bold* text for host APIs, or [source] syntax highlighting. |
| 157 | +//* Use +mono+ text for device APIs, or [source] syntax highlighting. |
| 158 | +//* Use +mono+ text for extension names, types, or enum values. |
| 159 | +//* Use _italics_ for parameters. |
| 160 | +//************************************************************************ |
0 commit comments