Skip to content

Commit 7308f85

Browse files
karolherbstvmaksimo
authored andcommitted
OpGroupWaitEvents doesn't require the Group capability
Fixes #595
1 parent bee4aa0 commit 7308f85

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,8 +2479,11 @@ class SPIRVGroupInstBase : public SPIRVInstTemplateBase {
24792479

24802480
#define _SPIRV_OP(x, ...) \
24812481
typedef SPIRVInstTemplate<SPIRVGroupInstBase, Op##x, __VA_ARGS__> SPIRV##x;
2482-
// Group instructions
2483-
_SPIRV_OP(GroupWaitEvents, false, 4)
2482+
// Group instructions.
2483+
// Even though GroupWaitEvents has Group in its name, it doesn't require the
2484+
// Group capability
2485+
typedef SPIRVInstTemplate<SPIRVInstTemplateBase, OpGroupWaitEvents, false, 4>
2486+
SPIRVGroupWaitEvents;
24842487
_SPIRV_OP(GroupAll, true, 5)
24852488
_SPIRV_OP(GroupAny, true, 5)
24862489
_SPIRV_OP(GroupBroadcast, true, 6)

llvm-spirv/test/event_no_group_cap.cl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
__kernel void test_fn( const __global char *src)
2+
{
3+
wait_group_events(0, NULL);
4+
}
5+
// RUN: %clang_cc1 -triple spir64 -x cl -cl-std=CL2.0 -finclude-default-header -O0 -emit-llvm-bc %s -o %t.bc
6+
// RUN: llvm-spirv %t.bc -spirv-text -o %t.spt
7+
// RUN: FileCheck < %t.spt %s
8+
// RUN: llvm-spirv %t.bc -o %t.spv
9+
// RUN: spirv-val %t.spv
10+
11+
// CHECK-NOT:Capability Groups
12+
// CHECK:GroupWaitEvents

0 commit comments

Comments
 (0)