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 introduces two new storage classes that are sub classes of the CrossWorkgroup storage class. Using these more specific storage classes provides additional information that can enable optimization. The extension also introduces two new conversion instructions to enable converting pointers from and to these storage classes.
Extension Name
To use this extension within a SPIR-V module, the following OpExtension must be present in the module:
OpExtension "SPV_ALTERA_usm_storage_classes"
Token Number Assignments
OpPtrCastToCrossWorkgroupALTERA |
5934 |
USMStorageClassesALTERA |
5935 |
DeviceOnlyALTERA |
5936 |
HostOnlyALTERA |
5937 |
OpCrossWorkgroupCastToPtrALTERA |
5938 |
Modifications to the SPIR-V Specification, Version 1.6 Revision 2
Storage Class
Modify Section 3.7, Storage Class, adding these rows to the table:
| Storage Class | Enabling Capabilities | |
|---|---|---|
5936 |
DeviceOnlyALTERA |
USMStorageClassesALTERA |
5937 |
HostOnlyALTERA |
USMStorageClassesALTERA |
Capability
Modify Section 3.31, Capability, adding a row to the Capability table:
| Capability | Implicitly Declares | |
|---|---|---|
5935 |
USMStorageClassesALTERA |
Kernel |
Instructions
Modify Section 3.36.11, Conversion Instructions, adding two new instructions as follows:
OpPtrCastToCrossWorkgroupALTERA Converts a pointer’s Storage Class from a more specific class to CrossWorkgroup. Result Type must be an OpTypePointer. Its Storage Class must be CrossWorkgroup. Pointer must point to the DeviceOnlyALTERA or HostOnlyALTERA Storage Class. Pointer must have the same type as Result Type aside from the Storage Class. |
Capability: |
|||
4 |
5934 |
<id> |
Result <id> |
<id> |
OpCrossWorkgroupCastToPtrALTERA Convert a pointer’s Storage Class from CrossWorkgroup to a more specific class. Result Type must be an OpTypePointer. Result Type's Storage Class must be DeviceOnlyALTERA or HostOnlyALTERA. Pointer must point to the CrossWorkgroup Storage Class. Pointer must have the same type as Result Type aside from the Storage Class. |
Capability: |
|||
4 |
5938 |
<id> |
Result <id> |
<id> |