Skip to content

Commit bf9d64d

Browse files
Fixed sycl/test/esimd/*
1 parent 6189ea6 commit bf9d64d

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

sycl/test/esimd/glob.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// RUN: %clangxx -fsycl -fsycl-explicit-simd -c -fsycl-device-only -Xclang -emit-llvm %s -o - | \
2-
// RUN: FileCheck %s
1+
// RUN: %clangxx -fsycl -fsycl-explicit-simd -c -fsycl-device-only -Xclang -emit-llvm %s -o %t
2+
// RUN: sycl-post-link -split-esimd -lower-esimd -O2 -S %t -o %t.table
3+
// RUN: FileCheck %s -input-file=%t_esimd_0.ll
34

45
// This test checks that globals with register attribute are allowed in ESIMD
56
// mode, can be accessed in functions and correct LLVM IR is generated
@@ -9,7 +10,6 @@
910
#include <CL/sycl/INTEL/esimd.hpp>
1011
#include <iostream>
1112

12-
using namespace cl::sycl;
1313
using namespace sycl::INTEL::gpu;
1414

1515
constexpr unsigned VL = 16;
@@ -22,7 +22,16 @@ ESIMD_PRIVATE ESIMD_REGISTER(17 + VL) simd<int, VL> vc1;
2222
// CHECK-DAG: @vc1 = {{.+}} <16 x i32> zeroinitializer, align 64 #1
2323
// CHECK-DAG: attributes #1 = { {{.*}}"VCByteOffset"="33" "VCGlobalVariable" "VCVolatile"{{.*}} }
2424

25-
SYCL_EXTERNAL ESIMD_NOINLINE void init_vc(int x) {
25+
template <typename name, typename Func>
26+
__attribute__((sycl_kernel)) void kernel(Func kernelFunc) {
27+
kernelFunc();
28+
}
29+
30+
SYCL_ESIMD_FUNCTION SYCL_EXTERNAL ESIMD_NOINLINE void init_vc(int x) {
2631
vc1 = vc + 1;
2732
vc = x;
2833
}
34+
35+
void caller(int x) {
36+
kernel<class kernel_esimd>([=]() SYCL_ESIMD_KERNEL { init_vc(x); });
37+
}

sycl/test/esimd/intrins_trans.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// RUN: %clangxx -O0 -fsycl -fsycl-explicit-simd -fsycl-device-only -Xclang -emit-llvm %s -o - | \
2-
// RUN: FileCheck %s
1+
// RUN: %clangxx -O0 -fsycl -fsycl-explicit-simd -fsycl-device-only -Xclang -emit-llvm %s -o %t
2+
// RUN: sycl-post-link -split-esimd -lower-esimd -O0 -S %t -o %t.table
3+
// RUN: FileCheck %s -input-file=%t_esimd_0.ll
34

45
// Checks ESIMD intrinsic translation.
56
// NOTE: must be run in -O0, as optimizer optimizes away some of the code
@@ -109,7 +110,7 @@ SYCL_ESIMD_FUNCTION SYCL_EXTERNAL simd<float, 16> foo() {
109110
// CHECK: call void @llvm.genx.media.st.v32i32(i32 0, i32 %[[SI2]], i32 0, i32 32, i32 %{{[0-9a-zA-Z_.]+}}, i32 %{{[0-9a-zA-Z_.]+}}, <32 x i32> %{{[0-9a-zA-Z_.]+}})
110111

111112
auto ee = __esimd_vload<int, 16>((vector_type_t<int, 16> *)(&vg));
112-
// CHECK: %{{[0-9a-zA-Z_.]+}} = call <16 x i32> @llvm.genx.vload.v16i32.p4v16i32(<16 x i32> addrspace(4)* {{.*}})
113+
// CHECK: %{{[0-9a-zA-Z_.]+}} = call <16 x i32> @llvm.genx.vload.v16i32.p0v16i32(<16 x i32>* {{.*}})
113114
__esimd_vstore<int, 32>(&vc, va.data());
114115
// CHECK: store <32 x i32> %{{[0-9a-zA-Z_.]+}}, <32 x i32> addrspace(4)* {{.*}}
115116

sycl/test/esimd/spirv_intrins_trans.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -O0 -S -emit-llvm -x c++ %s -o - | FileCheck %s
1+
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -O0 -S -emit-llvm -x c++ %s -o %t
2+
// RUN: sycl-post-link -split-esimd -lower-esimd -O2 -S %t -o %t.table
3+
// RUN: FileCheck %s -input-file=%t_esimd_0.ll
4+
25
// This test checks that all SPIR-V intrinsics are correctly
3-
// translated into GenX counterparts (implemented in LowerCM.cpp)
6+
// translated into GenX counterparts (implemented in LowerESIMD.cpp)
47

58
#include <CL/sycl.hpp>
69
#include <CL/sycl/INTEL/esimd.hpp>

0 commit comments

Comments
 (0)