Skip to content

Commit e83a1f1

Browse files
authored
[SYCL][ESIMD] named_barrier_signal should have a fence (#12826)
It's required. Signed-off-by: Sarnie, Nick <[email protected]>
1 parent f81b5a2 commit e83a1f1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sycl/include/sycl/ext/intel/experimental/esimd/memory.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ __ESIMD_API void named_barrier_signal(uint8_t barrier_id,
402402
__ESIMD_DNS::vector_type_t<uint32_t, 8> payload = 0;
403403
payload[2] = (num_consumers & 0xff) << 24 | (num_producers & 0xff) << 16 |
404404
producer_consumer_mode << 14 | (barrier_id & 0b11111) << 0;
405-
405+
__esimd_fence(__ESIMD_NS::fence_mask::global_coherent_fence |
406+
__ESIMD_NS::fence_mask::local_barrier);
406407
__esimd_raw_send_nbarrier_signal<uint32_t, 8>(
407408
0 /*sendc*/, gateway, descriptor, payload, 1 /*pred*/);
408409
}

sycl/test/esimd/nbarriers.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -c -fsycl-device-only -Xclang -emit-llvm %s -o %t
1+
// RUN: %clangxx -fsycl -c -fsycl-device-only -Xclang -emit-llvm %s -o - 2>&1 | FileCheck %s
22

33
#include <sycl/ext/intel/esimd.hpp>
44
#include <sycl/sycl.hpp>
@@ -15,6 +15,8 @@ void caller(int x) {
1515
kernel<class kernel_esimd>([=]() SYCL_ESIMD_KERNEL {
1616
named_barrier_init<7>();
1717
named_barrier_wait(2);
18+
// CHECK: call spir_func void @_Z13__esimd_fenceh(i8 noundef zeroext 33)
19+
// CHECK-NEXT: call spir_func void @_Z32__esimd_raw_send_nbarrier_signal{{.*}}
1820
named_barrier_signal(0, 0, 4, 4);
1921
});
2022
}

0 commit comments

Comments
 (0)