Skip to content

Commit

Permalink
[NFC][SYCL] Move builtin tests sycl/test/basic_tests/{*builtins*.cpp,…
Browse files Browse the repository at this point in the history
…builtins/} (#12667)

While at it, fix formatting and modernize include to SYCL 2020
(`<sycl/sycl.hpp>`).
  • Loading branch information
aelovikov-intel authored Feb 9, 2024
1 parent d69a4c2 commit db04b1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// NOTE: Compile the test fully to ensure the library exports the right host
// symbols.

#include <CL/sycl.hpp>
#include <sycl/sycl.hpp>

// Some helper macros to verify return type of the builtins. To be used like
// this
Expand All @@ -19,15 +19,15 @@ template <class... Args> struct CheckHelper {
template <class F> static auto call(F f) { return f(Args()...); }
};

#define CHECK(EXPECTED, FUNC, ...) \
#define CHECK(EXPECTED, FUNC, ...) \
{ \
auto ret = CheckHelper<__VA_ARGS__>::call( \
[](auto... args) { return cl::sycl::FUNC(args...); }); \
static_assert(std::is_same_v<decltype(ret), EXPECTED>); \
[](auto... args) { return sycl::FUNC(args...); }); \
static_assert(std::is_same_v<decltype(ret), EXPECTED>); \
}

void foo() {
using namespace cl::sycl;
using namespace sycl;
using boolm = marray<bool, 2>;

using int16v = vec<int16_t, 2>;
Expand Down Expand Up @@ -247,9 +247,9 @@ void foo() {
}

int main() {
cl::sycl::queue q;
sycl::queue q;
foo(); // Verify host.
q.submit([&](cl::sycl::handler &cgh) {
q.submit([&](sycl::handler &cgh) {
cgh.single_task<class test>([]() {
foo(); // verify device
});
Expand Down

0 comments on commit db04b1e

Please sign in to comment.