forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPIR-V 1.1/1.2] SPIRVReader: Add SubgroupsPerWorkgroup(Id) (KhronosG…
…roup#2916) Add support for consuming the SubgroupsPerWorkgroup (SPIR-V 1.1) and SubgroupsPerWorkgroupId (SPIR-V 1.2) execution modes. Map both of these to `spirv.ExecutionMode` named metadata.
- Loading branch information
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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,24 @@ | ||
; REQUIRES: spirv-as | ||
|
||
; RUN: spirv-as %s --target-env spv1.2 -o %t.spv | ||
; RUN: spirv-val %t.spv | ||
; RUN: llvm-spirv -r -o %t.rev.bc %t.spv | ||
; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s | ||
|
||
OpCapability Addresses | ||
OpCapability Linkage | ||
OpCapability Kernel | ||
OpCapability SubgroupDispatch | ||
OpMemoryModel Physical64 OpenCL | ||
OpEntryPoint Kernel %fn "testSubgroupsPerWorkgroup" | ||
OpExecutionMode %fn SubgroupsPerWorkgroup 8 | ||
%void = OpTypeVoid | ||
%fnTy = OpTypeFunction %void | ||
|
||
; CHECK: !spirv.ExecutionMode = !{![[MD:[0-9]+]]} | ||
; CHECK: ![[MD]] = !{ptr @testSubgroupsPerWorkgroup, i32 36, i32 8} | ||
|
||
%fn = OpFunction %void None %fnTy | ||
%entry = OpLabel | ||
OpReturn | ||
OpFunctionEnd |
This file contains 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,27 @@ | ||
; REQUIRES: spirv-as | ||
|
||
; RUN: spirv-as %s --target-env spv1.2 -o %t.spv | ||
; RUN: spirv-val %t.spv | ||
; RUN: llvm-spirv -r -o %t.rev.bc %t.spv | ||
; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s | ||
|
||
OpCapability Addresses | ||
OpCapability Linkage | ||
OpCapability Kernel | ||
OpCapability SubgroupDispatch | ||
OpMemoryModel Physical64 OpenCL | ||
OpEntryPoint Kernel %fn "testSubgroupsPerWorkgroupId" | ||
OpExecutionModeId %fn SubgroupsPerWorkgroupId %uint_8 | ||
%void = OpTypeVoid | ||
%uint = OpTypeInt 32 0 | ||
%uint_4 = OpConstant %uint 4 | ||
%uint_8 = OpSpecConstantOp %uint IAdd %uint_4 %uint_4 | ||
%fnTy = OpTypeFunction %void | ||
|
||
; CHECK: !spirv.ExecutionMode = !{![[MD:[0-9]+]]} | ||
; CHECK: ![[MD]] = !{ptr @testSubgroupsPerWorkgroupId, i32 37, i32 8} | ||
|
||
%fn = OpFunction %void None %fnTy | ||
%entry = OpLabel | ||
OpReturn | ||
OpFunctionEnd |