Skip to content

Commit 2ceeba5

Browse files
authored
[SYCL][DOC] Refactor OCL global variable spec (#5659)
We decided that the OpenCL API Specification should not contain detailed information about how the APIs interact with SPIR-V. Instead, we want this information in the OpenCL SPIR-V Environment Specification. Change this extension specification accordingly.
1 parent 0e44f1b commit 2ceeba5

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

sycl/doc/design/opencl-extensions/cl_intel_global_variable_access.asciidoc

+27-16
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,10 @@ cl_int clEnqueueWriteGlobalVariableINTEL(
147147
_program_ must define a global variable identified by _name_.
148148

149149
* _name_ identifies the global variable to read or write. Must be non-NULL.
150-
The interpretation depends on how _program_ was created:
151-
152-
** If _program_ was created with *clCreateProgramWithIL* from SPIR-V, there are
153-
two cases:
154-
155-
*** If the SPIR-V module declares the *GlobalVariableDecorationsINTEL*
156-
capability, the implementation looks first for an *OpVariable* that is
157-
decorated with *HostAccessINTEL* where the _Name_ operand is the same as
158-
_name_.
159-
160-
*** The implementation next looks for an *OpVariable* that is decorated with
161-
*LinkageAttributes* where the _Linkage Type_ is *Export* and the _Name_
162-
operand is the same as _name_.
163-
164-
** If _program_ was created in any other way, the interpretation of
165-
_name_ is implementation-defined.
150+
The interpretation depends on how _program_ was created, so see the
151+
appropriate environment specification for details. (For example, if
152+
_program_ was created from SPIR-V, see the OpenCL SPIR-V Environment
153+
Specification.)
166154

167155
* _blocking_read_ and _blocking_write_ indicate if the read and write
168156
operations are _blocking_ or _non-blocking_ (see below).
@@ -292,6 +280,29 @@ Add two new rows to Table 37, *List of supported event command types*:
292280
|===
293281

294282

283+
== Modifications to the OpenCL SPIR-V Environment Specification
284+
285+
=== New Section "Global Variables"
286+
287+
Add a new subsection under section 2, *Common Properties* named *Global
288+
Variables* with the following content:
289+
290+
Host code may read or write the content of a global variable in a `cl_program`
291+
by calling *clEnqueueReadGlobalVariableINTEL* or
292+
*clEnqueueWriteGlobalVariableINTEL*. Those two functions both take a _name_
293+
parameter which identifies the variable. For a `cl_program` created from
294+
SPIR-V, this parameter is interpreted as follows:
295+
296+
* If the SPIR-V module used to create _program_ declares the
297+
*GlobalVariableDecorationsINTEL* capability, the implementation looks first
298+
for an *OpVariable* that is decorated with *HostAccessINTEL* where the _Name_
299+
operand is the same as _name_.
300+
301+
* The implementation next looks for an *OpVariable* that is decorated with
302+
*LinkageAttributes* where the _Linkage Type_ is *Export* and the _Name_
303+
operand is the same as _name_.
304+
305+
295306
== Issues
296307

297308
. We do not have a formal definition for the _name_ of a global variable when

0 commit comments

Comments
 (0)