Skip to content

Commit c7cce70

Browse files
[SYCL][Test] Add regression test for sycl::vec compilation error in windows, debug (#16802)
Test to isolate `sycl::vec` regression after #14130. This PR caused `sycl::vec` to use `std::array` as its underlying storage. However, operations on `std::array` may emit debug-mode-only functions, on which the device compiler may fail.
1 parent e923fbb commit c7cce70

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Test to isolate sycl::vec regression after
2+
// https://github.com/intel/llvm/pull/14130. This PR caused sycl::vec to use
3+
// std::array as its underlying storage. However, operations on std::array
4+
// may emit debug-mode-only functions, on which the device compiler may fail.
5+
6+
// REQUIRES: windows
7+
8+
// RUN: %clangxx -fsycl -D_DEBUG %s -fsycl-device-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=note,warning
9+
10+
#include <sycl/sycl.hpp>
11+
12+
// expected-error@* {{SYCL kernel cannot call a variadic function}}
13+
// expected-error@* {{SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute}}
14+
// expected-error@* {{SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute}}
15+
SYCL_EXTERNAL auto GetFirstElement(sycl::vec<int, 3> v) { return v[0]; }

0 commit comments

Comments
 (0)