Skip to content

Commit

Permalink
[SYCL][COMPAT] Removal of std++20 in e2e, refactor of RUN directives (i…
Browse files Browse the repository at this point in the history
…ntel#14657)

This PR removes the use of std++20 in syclcompat e2e tests to avoid
std++20 features being accidentally added in the headers.
It also changes %clang++ substitutions to use %build to reduce the
length of RUN directives

Signed-off-by: Alberto Cabrera <[email protected]>
  • Loading branch information
Alcpz authored Jul 22, 2024
1 parent 5fad111 commit 72ede75
Show file tree
Hide file tree
Showing 59 changed files with 68 additions and 64 deletions.
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/atomic/atomic_arith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// UNSUPPORTED: hip

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <cstddef>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/atomic/atomic_bitwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// to fail. The same applies to each test within this directory
// UNSUPPORTED: hip

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/atomic/atomic_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// UNSUPPORTED: hip || (windows && level_zero)

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70 %} %s -o %t.out
// RUN: %{build} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70 %} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/atomic/atomic_comp_exchange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// UNSUPPORTED: hip

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/atomic/atomic_memory_acq_rel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// UNSUPPORTED: hip

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70 %} %s -o %t.out
// RUN: %{build} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70 %} -o %t.out
// RUN: %{run} %t.out

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/atomic/atomic_minmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// UNSUPPORTED: hip

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <type_traits>
Expand Down
11 changes: 7 additions & 4 deletions sycl/test-e2e/syclcompat/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ constexpr double ERROR_TOLERANCE = 1e-5;

// Typed call helper
// Iterates over all types and calls Functor f for each of them
template <typename Functor, template <typename...> class Container,
typename... Ts>
void for_each_type_call(Functor &&f, Container<Ts...> *) {
(f.template operator()<Ts>(), ...);
}

template <typename tuple, typename Functor>
void instantiate_all_types(Functor &&f) {
auto for_each_type_call =
[&]<template <typename...> class Container, typename... Ts>(
Container<Ts...> *) { (f.template operator()<Ts>(), ...); };
for_each_type_call(static_cast<tuple *>(nullptr));
for_each_type_call(f, static_cast<tuple *>(nullptr));
}

#define INSTANTIATE_ALL_TYPES(tuple, f) \
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Syclcompat macros tests
**************************************************************************/

// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <cassert>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/device/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
//===----------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <syclcompat/device.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/device/device_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Device filtering tests
**************************************************************************/

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <syclcompat/device.hpp>
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/syclcompat/device/device_profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
* Tests for the enable_profiling property paths
**************************************************************************/

// RUN: %clangxx -DSYCLCOMPAT_PROFILING_ENABLED=1 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t-profiling.out
// RUN: %{build} -DSYCLCOMPAT_PROFILING_ENABLED=1 -o %t-profiling.out
// RUN: %{run} %t-profiling.out
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t-no-profiling.out
// RUN: %{build} -o %t-no-profiling.out
// RUN: %{run} %t-no-profiling.out

#include <syclcompat/device.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/device/device_threaded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

// REQUIRES: linux

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -lpthread %s -o %t.out
// RUN: %{build} -lpthread -o %t.out
// RUN: %{run} %t.out

#include <syclcompat/device.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/dim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* dim3 tests
**************************************************************************/

// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <cassert>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/id_query/id_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* global_id query tests
**************************************************************************/

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/launch/launch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
**************************************************************************/
// https://github.com/intel/llvm/issues/14387
// UNSUPPORTED: gpu-intel-dg2
// RUN: %clangxx -std=c++20 -fsycl -fsycl-device-code-split=per_kernel -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -fsycl-device-code-split=per_kernel -o %t.out
// RUN: %{run} %t.out

#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_bfe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -std=c++17 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <bitset>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_bfi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -std=c++17 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <bitset>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_byte_dot_product.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -std=c++17 -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_61 %} %s -o %t.out
// RUN: %{build} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_61 %} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_compare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// REQUIRES: aspect-fp16

// RUN: %clangxx -std=c++17 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/half_type.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//===---------------------------------------------------------------===//

// REQUIRES: aspect-fp64
// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <complex>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_complex_datatype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
//===---------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <cmath>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_extend_v_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <cmath>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_extend_v_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <cmath>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_funnelshift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* math funnel helpers tests
**************************************************************************/

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <syclcompat/device.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_length_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===----------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* tests for non-vectorized math helper functions
**************************************************************************/

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <syclcompat/dims.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_vectorized.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// REQUIRES: aspect-fp16

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <syclcompat/math.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===----------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_vectorized_max_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===----------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/math/math_vectorized_min_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===----------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/memory/local_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* launch<F> tests with static local memory
**************************************************************************/

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/memory/memcpy_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===----------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <malloc.h>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/memory/memcpy_3d2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <malloc.h>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/memory/memory_async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

// Tests for the sycl::events returned from syclcompat::*Async API calls
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/memory/memory_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* 3D memory copy tests for new image/memcpy_parameter API
**************************************************************************/

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

// FIXME(@intel/syclcompat-lib-reviewers): These are some limited tests for the
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/memory/memory_image_xfails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===---------------------------------------------------------------------===//

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

// Tests for the sycl::events returned from syclcompat::*Async API calls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* memory operations tests for operations when changing the default queue
**************************************************************************/

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// ===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_shared_allocations
// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===----------------------------------------------------------------------===//

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//
// ===----------------------------------------------------------------------===//

// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//
//
// ===----------------------------------------------------------------------===//
// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Loading

0 comments on commit 72ede75

Please sign in to comment.