Skip to content

Commit d01f85c

Browse files
authored
[SYCL][InvokeSIMD] Add test for invoke_simd return type error (#8772)
Based on intel/llvm-test-suite#1679 Signed-off-by: Sarnie, Nick <[email protected]>
1 parent f61a136 commit d01f85c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: not %clangxx -fsycl -fsycl-device-only -S %s -o /dev/null 2>&1 | FileCheck %s
2+
#include <sycl/ext/oneapi/experimental/invoke_simd.hpp>
3+
#include <sycl/sycl.hpp>
4+
5+
using namespace sycl::ext::oneapi::experimental;
6+
using namespace sycl;
7+
namespace esimd = sycl::ext::intel::esimd;
8+
9+
[[intel::device_indirectly_callable]] simd<int, 4> callee(simd<int, 8>) {
10+
return simd<int, 4>();
11+
}
12+
13+
void foo() {
14+
constexpr unsigned Size = 1024;
15+
constexpr unsigned GroupSize = 64;
16+
sycl::range<1> GlobalRange{Size};
17+
sycl::range<1> LocalRange{GroupSize};
18+
sycl::nd_range<1> Range(GlobalRange, LocalRange);
19+
queue q;
20+
auto e = q.submit([&](handler &cgh) {
21+
cgh.parallel_for(Range, [=](nd_item<1> ndi) {
22+
invoke_simd(ndi.get_sub_group(), callee, 0);
23+
});
24+
});
25+
}
26+
27+
int main() {
28+
foo();
29+
// CHECK: {{.*}}error:{{.*}}static assertion failed due to requirement 'RetVecLength == 8': invoke_simd callee return type vector length must match kernel subgroup size{{.*}}
30+
}

0 commit comments

Comments
 (0)