Skip to content

Commit fd47adf

Browse files
authored
[SYCL][COMPAT][E2E] Removes std++20 usage from syclcompat e2e tests (#14916)
Removes c++20 features from the e2e tests to avoid introducing c++20 in SYCLcompat by accident Signed-off-by: Alberto Cabrera <[email protected]>
1 parent 0f5ee07 commit fd47adf

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

sycl/test-e2e/syclcompat/common.hpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,22 @@
2727

2828
constexpr double ERROR_TOLERANCE = 1e-5;
2929

30-
// Typed call helper
31-
// Iterates over all types and calls Functor f for each of them
32-
template <typename Functor, template <typename...> class Container,
33-
typename... Ts>
34-
void for_each_type_call(Functor &&f, Container<Ts...> *) {
35-
(f.template operator()<Ts>(), ...);
30+
template <typename Tuple, typename Func, std::size_t... Is>
31+
void for_each_type_call(Func &&f, std::index_sequence<Is...>) {
32+
(f(std::integral_constant<std::size_t, Is>{}), ...);
3633
}
3734

38-
template <typename tuple, typename Functor>
39-
void instantiate_all_types(Functor &&f) {
40-
for_each_type_call(f, static_cast<tuple *>(nullptr));
35+
template <typename Tuple, typename Func> void instantiate_all_types(Func &&f) {
36+
for_each_type_call<Tuple>(
37+
std::forward<Func>(f),
38+
std::make_index_sequence<std::tuple_size_v<Tuple>>{});
4139
}
4240

4341
#define INSTANTIATE_ALL_TYPES(tuple, f) \
44-
instantiate_all_types<tuple>([]<typename T>() { f<T>(); });
42+
instantiate_all_types<tuple>([](auto index) { \
43+
using T = std::tuple_element_t<decltype(index)::value, tuple>; \
44+
f<T>(); \
45+
});
4546

4647
using value_type_list =
4748
std::tuple<int, unsigned int, short, unsigned short, long, unsigned long,

sycl/test-e2e/syclcompat/lit.local.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ for substitution in config.substitutions:
44
if substitution[0] == "%clangxx":
55
original_clangxx=substitution[1]
66
config.substitutions.insert(0,
7-
("%clangxx", original_clangxx + ' -Wno-error=c++20-extensions -Wno-error=#warnings -Wno-error=deprecated-declarations'))
7+
("%clangxx", original_clangxx + ' -Wno-error=#warnings -Wno-error=deprecated-declarations'))

0 commit comments

Comments
 (0)