Contributors
-
Artem Radzikhovskyy, Intel
-
Michael Kinsner, Intel
-
Joe Garvey, Intel
-
Mohammad Fawaz, Intel
-
Gregory Lueck, Intel
Dependencies
This extension is written against the SPIR-V Specification, Version 1.6 Revision 2.
This extension requires SPIR-V 1.0.
Overview
This extension adds a decoration that can be applied to global (module scope) variables. This decoration explicitly asserts that the global variable can be accessed outside the SPIR-V module.
Extension Name
To use this extension within a SPIR-V module, the following OpExtension must be present in the module:
OpExtension "SPV_INTEL_global_variable_host_access"
Modifications to the SPIR-V Specification, Version 1.6
Host Access Qualifier
After Section 3.18, add a new section "3.18a Host Access Qualifier" as follows
Defines the host system access permissions.
Used by HostAccessINTEL.
| Host Access Qualifier | Enabling Capabilities | |
|---|---|---|
0 |
NoneINTEL The execution environment may neither read nor write the variable from the host. On an FPGA device, no memory port is exposed. |
GlobalVariableHostAccessINTEL |
1 |
ReadINTEL The execution environment may read the variable from the host but will never write it. On an FPGA device, only a read memory port is exposed. |
GlobalVariableHostAccessINTEL |
2 |
WriteINTEL The execution environment may write the variable from the host but will never read it. On an FPGA device, only a write memory port is exposed. |
GlobalVariableHostAccessINTEL |
3 |
ReadWriteINTEL The execution environment may read or write the variable from the host. On an FPGA device, a read/write memory port is exposed. |
GlobalVariableHostAccessINTEL |
Decoration
Modify Section 3.20, Decoration, adding these rows to the Decoration table:
| Decoration | Extra Operands | Enabling Capabilities | ||
|---|---|---|---|---|
6188 |
HostAccessINTEL The client API’s execution environment may provide a way to access a global variable’s value from the host system. If it does, this decoration provides two pieces of information. Access is an assertion by the producer about the types of these accesses, which may allow the consumer to perform certain optimizations. Name is a name which the client API’s execution environment may use to identify this variable. If a global OpVariable is not decorated with HostAccessINTEL, the default behavior is defined by the client API specification. |
Host Access Qualifier |
Literal String |
GlobalVariableHostAccessINTEL |