Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spt file containing GlobalVariableHostAccessINTEL changes after -to-binary and then -to-text #2558

Open
wenju-he opened this issue May 9, 2024 · 0 comments

Comments

@wenju-he
Copy link
Contributor

wenju-he commented May 9, 2024

Content of global_var_host_access.spt:

119734787 65536 393230 10 0
2 Capability Addresses
2 Capability Linkage
2 Capability Kernel
2 Capability GlobalVariableHostAccessINTEL
11 Extension "SPV_INTEL_global_variable_host_access"
5 ExtInstImport 1 "OpenCL.std"
3 MemoryModel 2 2
3 Source 0 0
4 Name 5 "int_var"
5 Name 9 "bool_var"

6 Decorate 5 LinkageAttributes "int_var" Export
7 Decorate 5 HostAccessINTEL ReadINTEL "IntVarName"
7 Decorate 9 LinkageAttributes "bool_var" Export
7 Decorate 9 HostAccessINTEL ReadWriteINTEL "BoolVarName"
4 TypeInt 2 32 0
4 Constant 2 4 42
4 TypePointer 3 5 2
2 TypeBool 6
4 TypePointer 7 5 6
5 Variable 3 5 5 4
3 ConstantFalse 6 8
5 Variable 7 9 5 8

Apply commands llvm-spirv -to-binary global_var_host_access.spt and then llvm-spirv -to-text global_var_host_access.spv -o global_var_host_access.spv.spt. Output global_var_host_access.spv.spt is

119734787 65536 393230 10 0
2 Capability Addresses
2 Capability Linkage
2 Capability Kernel
2 Capability GlobalVariableDecorationsINTEL
2 Capability GlobalVariableHostAccessINTEL
11 Extension "SPV_INTEL_global_variable_host_access"
5 ExtInstImport 1 "OpenCL.std"
3 MemoryModel 2 2
3 Source 0 0
4 Name 5 "int_var"
5 Name 9 "bool_var"

6 Decorate 5 LinkageAttributes "int_var" Export
7 Decorate 5 HostAccessINTEL 0 ""

Differences in the new global_var_host_access.spv.spt:

  1. GlobalVariableDecorationsINTEL is added
  2. In Decorate 5, ReadINTEL "IntVarName" are missing
  3. Decorate 9 is missing
  4. two global variables are missing

Please check if there is expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant