Skip to content

[SYCL][InvokeSIMD] Add test for invoke_simd return type error #8772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions sycl/test/invoke_simd/return-type-mismatch-error.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// RUN: not %clangxx -fsycl -fsycl-device-only -S %s -o /dev/null 2>&1 | FileCheck %s
#include <sycl/ext/oneapi/experimental/invoke_simd.hpp>
#include <sycl/sycl.hpp>

using namespace sycl::ext::oneapi::experimental;
using namespace sycl;
namespace esimd = sycl::ext::intel::esimd;

[[intel::device_indirectly_callable]] simd<int, 4> callee(simd<int, 8>) {
return simd<int, 4>();
}

void foo() {
constexpr unsigned Size = 1024;
constexpr unsigned GroupSize = 64;
sycl::range<1> GlobalRange{Size};
sycl::range<1> LocalRange{GroupSize};
sycl::nd_range<1> Range(GlobalRange, LocalRange);
queue q;
auto e = q.submit([&](handler &cgh) {
cgh.parallel_for(Range, [=](nd_item<1> ndi) {
invoke_simd(ndi.get_sub_group(), callee, 0);
});
});
}

int main() {
foo();
// CHECK: {{.*}}error:{{.*}}static assertion failed due to requirement 'RetVecLength == 8': invoke_simd callee return type vector length must match kernel subgroup size{{.*}}
}