-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][ESIMD] Add support for named barrier APIs
Signed-off-by: Sergey Dmitriev <serguei.n.dmitriev@intel.com>
- Loading branch information
1 parent
7f5bd40
commit f66adaa
Showing
8 changed files
with
220 additions
and
7 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
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,21 @@ | ||
; RUN: opt < %s -LowerESIMD -S | FileCheck %s | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" | ||
target triple = "spir64-unknown-unknown-sycldevice" | ||
|
||
; Function Attrs: convergent norecurse mustprogress | ||
define dso_local spir_kernel void @_ZTSZ6calleriE12kernel_esimd() !sycl_explicit_simd !3 { | ||
entry: | ||
; CHECK: call void @llvm.genx.nbarrier(i8 0, i8 2, i8 0) | ||
call spir_func void @_Z16__esimd_nbarrierhhh(i8 zeroext 0, i8 zeroext 2, i8 zeroext 0) | ||
|
||
; CHECK: call void @llvm.genx.raw.send.noresult.i1.v8i32(i32 0, i1 true, i32 3, i32 33554436, <8 x i32> <i32 0, i32 0, i32 67371008, i32 0, i32 0, i32 0, i32 0, i32 0>) | ||
call spir_func void @_Z32__esimd_raw_send_nbarrier_signalIjLi8EEvjjjN2cl4sycl5INTEL3gpu6detail11vector_typeIT_XT0_EE4typeEt(i32 0, i32 3, i32 33554436, <8 x i32> <i32 0, i32 0, i32 67371008, i32 0, i32 0, i32 | ||
0, i32 0, i32 0>, i16 zeroext 1) | ||
|
||
ret void | ||
} | ||
!3 = !{} | ||
|
||
declare dso_local spir_func void @_Z16__esimd_nbarrierhhh(i8 zeroext, i8 zeroext, i8 zeroext) local_unnamed_addr #1 | ||
declare dso_local spir_func void @_Z32__esimd_raw_send_nbarrier_signalIjLi8EEvjjjN2cl4sycl5INTEL3gpu6detail11vector_typeIT_XT0_EE4typeEt(i32, i32, i32, <8 x i32>, i16 zeroext) |
19 changes: 19 additions & 0 deletions
19
llvm/test/tools/sycl-post-link/sycl-esimd/nbarriers-metadata.ll
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,19 @@ | ||
; RUN: sycl-post-link -split-esimd -lower-esimd -S %s -o %t.table | ||
; RUN: FileCheck %s -input-file=%t_esimd_0.ll | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" | ||
target triple = "spir64-unknown-unknown-sycldevice" | ||
|
||
; Function Attrs: convergent norecurse mustprogress | ||
define dso_local spir_kernel void @_ZTSZ6calleriE12kernel_esimd() #0 !sycl_explicit_simd !3 { | ||
entry: | ||
tail call spir_func void @_Z21__esimd_nbarrier_inith(i8 zeroext 7) | ||
ret void | ||
} | ||
|
||
!3 = !{} | ||
|
||
declare dso_local spir_func void @_Z21__esimd_nbarrier_inith(i8 zeroext) | ||
; CHECK: attributes #0 = { {{.*}}"VCNamedBarrierCount"="7"{{.*}} } | ||
|
||
attributes #0 = { "sycl-module-id"="a.cpp" } |
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,19 @@ | ||
// RUN: %clangxx -fsycl -c -fsycl-device-only -Xclang -emit-llvm %s -o %t | ||
|
||
#include <CL/sycl.hpp> | ||
#include <sycl/ext/intel/experimental/esimd.hpp> | ||
|
||
using namespace sycl::ext::intel::experimental::esimd; | ||
|
||
template <typename name, typename Func> | ||
__attribute__((sycl_kernel)) void kernel(Func kernelFunc) { | ||
kernelFunc(); | ||
} | ||
|
||
void caller(int x) { | ||
kernel<class kernel_esimd>([=]() SYCL_ESIMD_KERNEL { | ||
nbarrier_init<7>(); | ||
nbarrier_wait(2); | ||
nbarrier_signal(0, 0, 4, 4); | ||
}); | ||
} |