From 93aa6e75a60abb5f548c740026bce283862d93d0 Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Tue, 28 Mar 2023 06:32:48 -0700 Subject: [PATCH] [SYCL] Move get_spec_const_vec16 E2E regression test This commit moves the in-review fp64_relaxed.cpp test from the now archived intel/llvm-test-suite repo. See https://github.com/intel/llvm-test-suite/pull/1634. Signed-off-by: Larsen, Steffen --- .../Regression/get_spec_const_vec16.cpp | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sycl/test-e2e/Regression/get_spec_const_vec16.cpp diff --git a/sycl/test-e2e/Regression/get_spec_const_vec16.cpp b/sycl/test-e2e/Regression/get_spec_const_vec16.cpp new file mode 100644 index 0000000000000..ab9709a4b0c15 --- /dev/null +++ b/sycl/test-e2e/Regression/get_spec_const_vec16.cpp @@ -0,0 +1,27 @@ +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -o %t.out %s +// RUN: %CPU_RUN_PLACEHOLDER %t.out +// RUN: %GPU_RUN_PLACEHOLDER %t.out +// RUN: %ACC_RUN_PLACEHOLDER %t.out +// +// Tests that the right value returned after setting a specialization constant +// of sycl::vec type is correct. + +#include + +#include + +constexpr sycl::specialization_id> spec_const(20); + +int main() { + sycl::vec Result{0}; + sycl::vec Ref{5}; + sycl::queue Q; + Q.submit([&](sycl::handler &CGH) { + CGH.set_specialization_constant(Ref); + Result = CGH.get_specialization_constant(); + }); + auto CompRes = Ref == Result; + assert(std::all_of(&CompRes[0], &CompRes[0] + 16, + [](const bool &A) { return A; })); + return 0; +}