Skip to content

[SYCL][COMPAT][E2E] Removes std++20 usage from syclcompat e2e tests #14916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions sycl/test-e2e/syclcompat/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,22 @@

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 Func, std::size_t... Is>
void for_each_type_call(Func &&f, std::index_sequence<Is...>) {
(f(std::integral_constant<std::size_t, Is>{}), ...);
}

template <typename tuple, typename Functor>
void instantiate_all_types(Functor &&f) {
for_each_type_call(f, static_cast<tuple *>(nullptr));
template <typename Tuple, typename Func> void instantiate_all_types(Func &&f) {
for_each_type_call<Tuple>(
std::forward<Func>(f),
std::make_index_sequence<std::tuple_size_v<Tuple>>{});
}

#define INSTANTIATE_ALL_TYPES(tuple, f) \
instantiate_all_types<tuple>([]<typename T>() { f<T>(); });
instantiate_all_types<tuple>([](auto index) { \
using T = std::tuple_element_t<decltype(index)::value, tuple>; \
f<T>(); \
});

using value_type_list =
std::tuple<int, unsigned int, short, unsigned short, long, unsigned long,
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/syclcompat/lit.local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ for substitution in config.substitutions:
if substitution[0] == "%clangxx":
original_clangxx=substitution[1]
config.substitutions.insert(0,
("%clangxx", original_clangxx + ' -Wno-error=c++20-extensions -Wno-error=#warnings -Wno-error=deprecated-declarations'))
("%clangxx", original_clangxx + ' -Wno-error=#warnings -Wno-error=deprecated-declarations'))
Loading