-
Notifications
You must be signed in to change notification settings - Fork 976
GLSL_QCOM_multiple_wait_queues #4250
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
Open
wooyoungqcom
wants to merge
1
commit into
KhronosGroup:main
Choose a base branch
from
CodeLinaro:GLSL_QCOM_multiple_wait_queues
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
216 changes: 216 additions & 0 deletions
216
Test/baseResults/spv.qcom.multiple_wait_queues.comp.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,216 @@ | ||
| spv.qcom.multiple_wait_queues.comp | ||
| // Module Version 10300 | ||
| // Generated by (magic number): 8000b | ||
| // Id's are bound by 115 | ||
|
|
||
| Capability Shader | ||
| Capability VulkanMemoryModelKHR | ||
| Capability CooperativeMatrixKHR | ||
| Extension "SPV_KHR_cooperative_matrix" | ||
| Extension "SPV_KHR_vulkan_memory_model" | ||
| 1: ExtInstImport "GLSL.std.450" | ||
| MemoryModel Logical VulkanKHR | ||
| EntryPoint GLCompute 4 "main" | ||
| ExecutionMode 4 LocalSize 64 2 2 | ||
| Source GLSL 450 | ||
| SourceExtension "GL_KHR_cooperative_matrix" | ||
| SourceExtension "GL_KHR_memory_scope_semantics" | ||
| SourceExtension "GL_QCOM_multiple_wait_queues" | ||
| Name 4 "main" | ||
| Name 11 "coop_matmul(u1;u1;" | ||
| Name 9 "row" | ||
| Name 10 "col" | ||
| Name 13 "step" | ||
| Name 21 "TOTAL_K" | ||
| Name 24 "subMatrixAStart" | ||
| Name 30 "subMatrixBStart" | ||
| Name 37 "TILE_M" | ||
| Name 41 "matA" | ||
| Name 43 "InputA" | ||
| MemberName 43(InputA) 0 "x" | ||
| Name 45 "inputA" | ||
| Name 52 "TILE_N" | ||
| Name 56 "matB" | ||
| Name 58 "InputB" | ||
| MemberName 58(InputB) 0 "x" | ||
| Name 60 "inputB" | ||
| Name 68 "matC" | ||
| Name 73 "TILE_K" | ||
| Name 83 "subMatrixAStart" | ||
| Name 88 "subMatrixBStart" | ||
| Name 105 "param" | ||
| Name 106 "param" | ||
| Name 109 "InputC" | ||
| MemberName 109(InputC) 0 "x" | ||
| Name 111 "inputC" | ||
| Decorate 21(TOTAL_K) SpecId 0 | ||
| Decorate 37(TILE_M) SpecId 3 | ||
| Decorate 42 ArrayStride 4 | ||
| Decorate 43(InputA) Block | ||
| MemberDecorate 43(InputA) 0 NonWritable | ||
| MemberDecorate 43(InputA) 0 Offset 0 | ||
| Decorate 45(inputA) NonWritable | ||
| Decorate 45(inputA) Binding 0 | ||
| Decorate 45(inputA) DescriptorSet 0 | ||
| Decorate 52(TILE_N) SpecId 4 | ||
| Decorate 57 ArrayStride 4 | ||
| Decorate 58(InputB) Block | ||
| MemberDecorate 58(InputB) 0 NonWritable | ||
| MemberDecorate 58(InputB) 0 Offset 0 | ||
| Decorate 60(inputB) NonWritable | ||
| Decorate 60(inputB) Binding 1 | ||
| Decorate 60(inputB) DescriptorSet 0 | ||
| Decorate 73(TILE_K) SpecId 7 | ||
| Decorate 108 ArrayStride 4 | ||
| Decorate 109(InputC) Block | ||
| MemberDecorate 109(InputC) 0 NonWritable | ||
| MemberDecorate 109(InputC) 0 Offset 0 | ||
| Decorate 111(inputC) NonWritable | ||
| Decorate 111(inputC) Binding 2 | ||
| Decorate 111(inputC) DescriptorSet 0 | ||
| Decorate 114 BuiltIn WorkgroupSize | ||
| 2: TypeVoid | ||
| 3: TypeFunction 2 | ||
| 6: TypeInt 32 0 | ||
| 7: TypePointer Function 6(int) | ||
| 8: TypeFunction 2 7(ptr) 7(ptr) | ||
| 14: 6(int) Constant 0 | ||
| 21(TOTAL_K): 6(int) SpecConstant 1 | ||
| 22: TypeBool | ||
| 26: 6(int) Constant 16 | ||
| 35: TypeFloat 32 | ||
| 36: 6(int) Constant 3 | ||
| 37(TILE_M): 6(int) SpecConstant 1 | ||
| 38: 6(int) Constant 8 | ||
| 39: TypeCooperativeMatrixKHR 35(float) 36 37(TILE_M) 38 14 | ||
| 40: TypePointer Function 39 | ||
| 42: TypeRuntimeArray 35(float) | ||
| 43(InputA): TypeStruct 42 | ||
| 44: TypePointer StorageBuffer 43(InputA) | ||
| 45(inputA): 44(ptr) Variable StorageBuffer | ||
| 46: TypeInt 32 1 | ||
| 47: 46(int) Constant 0 | ||
| 49: TypePointer StorageBuffer 35(float) | ||
| 52(TILE_N): 6(int) SpecConstant 1 | ||
| 53: 6(int) Constant 1 | ||
| 54: TypeCooperativeMatrixKHR 35(float) 36 38 52(TILE_N) 53 | ||
| 55: TypePointer Function 54 | ||
| 57: TypeRuntimeArray 35(float) | ||
| 58(InputB): TypeStruct 57 | ||
| 59: TypePointer StorageBuffer 58(InputB) | ||
| 60(inputB): 59(ptr) Variable StorageBuffer | ||
| 63: 46(int) Constant 1 | ||
| 65: 6(int) Constant 2 | ||
| 66: TypeCooperativeMatrixKHR 35(float) 36 37(TILE_M) 52(TILE_N) 65 | ||
| 67: TypePointer Function 66 | ||
| 73(TILE_K): 6(int) SpecConstant 1 | ||
| 108: TypeRuntimeArray 35(float) | ||
| 109(InputC): TypeStruct 108 | ||
| 110: TypePointer StorageBuffer 109(InputC) | ||
| 111(inputC): 110(ptr) Variable StorageBuffer | ||
| 112: TypeVector 6(int) 3 | ||
| 113: 6(int) Constant 64 | ||
| 114: 112(ivec3) ConstantComposite 113 65 65 | ||
| 4(main): 2 Function None 3 | ||
| 5: Label | ||
| 105(param): 7(ptr) Variable Function | ||
| 106(param): 7(ptr) Variable Function | ||
| Store 105(param) 14 | ||
| Store 106(param) 14 | ||
| 107: 2 FunctionCall 11(coop_matmul(u1;u1;) 105(param) 106(param) | ||
| Return | ||
| FunctionEnd | ||
| 11(coop_matmul(u1;u1;): 2 Function None 8 | ||
| 9(row): 7(ptr) FunctionParameter | ||
| 10(col): 7(ptr) FunctionParameter | ||
| 12: Label | ||
| 13(step): 7(ptr) Variable Function | ||
| 24(subMatrixAStart): 7(ptr) Variable Function | ||
| 30(subMatrixBStart): 7(ptr) Variable Function | ||
| 41(matA): 40(ptr) Variable Function | ||
| 56(matB): 55(ptr) Variable Function | ||
| 68(matC): 67(ptr) Variable Function | ||
| 83(subMatrixAStart): 7(ptr) Variable Function | ||
| 88(subMatrixBStart): 7(ptr) Variable Function | ||
| Store 13(step) 14 | ||
| Branch 15 | ||
| 15: Label | ||
| LoopMerge 17 18 0 | ||
| Branch 19 | ||
| 19: Label | ||
| 20: 6(int) Load 13(step) | ||
| 23: 22(bool) ULessThan 20 21(TOTAL_K) | ||
| BranchConditional 23 16 17 | ||
| 16: Label | ||
| 25: 6(int) Load 9(row) | ||
| 27: 6(int) IMul 25 26 | ||
| 28: 6(int) Load 13(step) | ||
| 29: 6(int) IAdd 27 28 | ||
| Store 24(subMatrixAStart) 29 | ||
| 31: 6(int) Load 10(col) | ||
| 32: 6(int) IMul 31 26 | ||
| 33: 6(int) Load 13(step) | ||
| 34: 6(int) IAdd 32 33 | ||
| Store 30(subMatrixBStart) 34 | ||
| 48: 6(int) Load 24(subMatrixAStart) | ||
| 50: 49(ptr) AccessChain 45(inputA) 47 48 | ||
| 51: 39 CooperativeMatrixLoadKHR 50 47 26 None | ||
| Store 41(matA) 51 | ||
| 61: 6(int) Load 30(subMatrixBStart) | ||
| 62: 49(ptr) AccessChain 60(inputB) 47 61 | ||
| 64: 54 CooperativeMatrixLoadKHR 62 63 26 None | ||
| Store 56(matB) 64 | ||
| 69: 39 Load 41(matA) | ||
| 70: 54 Load 56(matB) | ||
| 71: 66 Load 68(matC) | ||
| 72: 66 CooperativeMatrixMulAddKHR 69 70 71 | ||
| Store 68(matC) 72 | ||
| Branch 18 | ||
| 18: Label | ||
| 74: 6(int) Load 13(step) | ||
| 75: 6(int) IAdd 74 73(TILE_K) | ||
| Store 13(step) 75 | ||
| Branch 15 | ||
| 17: Label | ||
| Store 13(step) 14 | ||
| Branch 76 | ||
| 76: Label | ||
| LoopMerge 78 79 2 | ||
| Branch 80 | ||
| 80: Label | ||
| 81: 6(int) Load 13(step) | ||
| 82: 22(bool) ULessThan 81 21(TOTAL_K) | ||
| BranchConditional 82 77 78 | ||
| 77: Label | ||
| 84: 6(int) Load 9(row) | ||
| 85: 6(int) IMul 84 26 | ||
| 86: 6(int) Load 13(step) | ||
| 87: 6(int) IAdd 85 86 | ||
| Store 83(subMatrixAStart) 87 | ||
| 89: 6(int) Load 10(col) | ||
| 90: 6(int) IMul 89 26 | ||
| 91: 6(int) Load 13(step) | ||
| 92: 6(int) IAdd 90 91 | ||
| Store 88(subMatrixBStart) 92 | ||
| 93: 6(int) Load 83(subMatrixAStart) | ||
| 94: 49(ptr) AccessChain 45(inputA) 47 93 | ||
| 95: 39 CooperativeMatrixLoadKHR 94 47 26 None | ||
| Store 41(matA) 95 | ||
| 96: 6(int) Load 88(subMatrixBStart) | ||
| 97: 49(ptr) AccessChain 60(inputB) 47 96 | ||
| 98: 54 CooperativeMatrixLoadKHR 97 63 26 None | ||
| Store 56(matB) 98 | ||
| 99: 39 Load 41(matA) | ||
| 100: 54 Load 56(matB) | ||
| 101: 66 Load 68(matC) | ||
| 102: 66 CooperativeMatrixMulAddKHR 99 100 101 | ||
| Store 68(matC) 102 | ||
| Branch 79 | ||
| 79: Label | ||
| 103: 6(int) Load 13(step) | ||
| 104: 6(int) IAdd 103 73(TILE_K) | ||
| Store 13(step) 104 | ||
| Branch 76 | ||
| 78: Label | ||
| Return | ||
| FunctionEnd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #version 450 core | ||
| #extension GL_KHR_memory_scope_semantics : enable | ||
|
|
||
| #extension GL_KHR_cooperative_matrix : enable | ||
| #extension GL_QCOM_multiple_wait_queues : enable | ||
|
|
||
| layout(constant_id = 0) const uint TOTAL_K = 1; | ||
|
|
||
| layout(constant_id = 3) const uint TILE_M = 1; | ||
| layout(constant_id = 4) const uint TILE_N = 1; | ||
| layout(constant_id = 7) const uint TILE_K = 1; | ||
|
|
||
| layout(set=0, binding=0) readonly buffer InputA { float x[]; } inputA; | ||
| layout(set=0, binding=1) readonly buffer InputB { float x[]; } inputB; | ||
| layout(set=0, binding=2) readonly buffer InputC { float x[]; } inputC; | ||
|
|
||
| layout(local_size_x = 64, local_size_y = 2, local_size_z = 2) in; | ||
|
|
||
| #define STRIDE_A 16 | ||
| #define STRIDE_B 16 | ||
|
|
||
| void coop_matmul(uint row, uint col) | ||
| { | ||
| coopmat<float, gl_ScopeSubgroup, TILE_M, 8, gl_MatrixUseA> matA; | ||
| coopmat<float, gl_ScopeSubgroup, 8, TILE_N, gl_MatrixUseB> matB; | ||
| coopmat<float, gl_ScopeSubgroup, TILE_M, TILE_N, gl_MatrixUseAccumulator> matC; | ||
| uint step; | ||
|
|
||
| [[multiple_wait_queuesQCOM]] | ||
| for (step = 0; step < TOTAL_K; step += TILE_K) { | ||
| uint subMatrixAStart = row * STRIDE_A + step; | ||
| uint subMatrixBStart = col * STRIDE_B + step; | ||
|
|
||
| coopMatLoad(matA, inputA.x, subMatrixAStart, STRIDE_A, gl_CooperativeMatrixLayoutRowMajor); // Global to CoopMat | ||
| coopMatLoad(matB, inputB.x, subMatrixBStart, STRIDE_B, gl_CooperativeMatrixLayoutColumnMajor); // Global to CoopMat | ||
|
|
||
| matC = coopMatMulAdd(matA, matB, matC); | ||
| } | ||
|
|
||
| [[multiple_wait_queuesQCOM(2)]] | ||
| for (step = 0; step < TOTAL_K; step += TILE_K) { | ||
| uint subMatrixAStart = row * STRIDE_A + step; | ||
| uint subMatrixBStart = col * STRIDE_B + step; | ||
|
|
||
| coopMatLoad(matA, inputA.x, subMatrixAStart, STRIDE_A, gl_CooperativeMatrixLayoutRowMajor); // Global to CoopMat | ||
| coopMatLoad(matB, inputB.x, subMatrixBStart, STRIDE_B, gl_CooperativeMatrixLayoutColumnMajor); // Global to CoopMat | ||
|
|
||
| matC = coopMatMulAdd(matA, matB, matC); | ||
| } | ||
| } | ||
|
|
||
| void main() | ||
| { | ||
| coop_matmul(0, 0); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code, you should remove it.