Skip to content

Commit 4e39e3e

Browse files
[SYCL] Move get_spec_const_vec16 E2E regression test (#8830)
This commit moves the in-review get_spec_const_vec16.cpp test from the now archived intel/llvm-test-suite repo. See intel/llvm-test-suite#1634. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 1e88df5 commit 4e39e3e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -o %t.out %s
2+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
5+
//
6+
// Tests that the right value returned after setting a specialization constant
7+
// of sycl::vec<char, 16> type is correct.
8+
9+
#include <sycl/sycl.hpp>
10+
11+
#include <algorithm>
12+
13+
constexpr sycl::specialization_id<sycl::vec<char, 16>> spec_const(20);
14+
15+
int main() {
16+
sycl::vec<char, 16> Result{0};
17+
sycl::vec<char, 16> Ref{5};
18+
sycl::queue Q;
19+
Q.submit([&](sycl::handler &CGH) {
20+
CGH.set_specialization_constant<spec_const>(Ref);
21+
Result = CGH.get_specialization_constant<spec_const>();
22+
});
23+
auto CompRes = Ref == Result;
24+
assert(std::all_of(&CompRes[0], &CompRes[0] + 16,
25+
[](const bool &A) { return A; }));
26+
return 0;
27+
}

0 commit comments

Comments
 (0)