diff --git a/test/support/test_dynamic_load_utils.h b/test/support/test_dynamic_load_utils.h index dd43d24e991..05b7409ab13 100644 --- a/test/support/test_dynamic_load_utils.h +++ b/test/support/test_dynamic_load_utils.h @@ -18,20 +18,13 @@ #include #include +#include "support/utils_sycl_defs.h" // for TestUtils::unique_kernel_name and etc. + #if TEST_DYNAMIC_SELECTION_AVAILABLE class load1; class load2; -namespace TestUtils -{ -template -struct unique_kernel_name; - -template -using new_kernel_name = unique_kernel_name, idx>; -} // namespace TestUtils - int test_dl_initialization(const std::vector& u) { diff --git a/test/support/test_dynamic_selection_utils.h b/test/support/test_dynamic_selection_utils.h index e77892fa0be..b40ffbd806e 100644 --- a/test/support/test_dynamic_selection_utils.h +++ b/test/support/test_dynamic_selection_utils.h @@ -15,16 +15,9 @@ #include #include #include -#if TEST_DYNAMIC_SELECTION_AVAILABLE - -namespace TestUtils -{ -template -struct unique_kernel_name; -template -using new_kernel_name = unique_kernel_name, idx>; -} // namespace TestUtils +#if TEST_DYNAMIC_SELECTION_AVAILABLE +#include "utils_sycl_defs.h" static inline void build_universe(std::vector& u) diff --git a/test/support/utils_invoke.h b/test/support/utils_invoke.h index 2b2a1230c8f..92a32e0a625 100644 --- a/test/support/utils_invoke.h +++ b/test/support/utils_invoke.h @@ -22,6 +22,7 @@ #include // for std::once_flag #include // for std::logic_error +#include "utils_sycl_defs.h" #include "iterator_utils.h" #include "compile_only_checks.h" @@ -38,19 +39,6 @@ namespace TestUtils // Implemented in utils_sycl.h, required to include this file. sycl::queue get_test_queue(); -template -constexpr ::std::size_t -uniq_kernel_index() -{ - return static_cast<::std::underlying_type_t>(alloc_type); -} - -template -struct unique_kernel_name; - -template -using new_kernel_name = unique_kernel_name<::std::decay_t, idx>; - /** * make_policy functions test wrappers * The main purpose of this function wrapper in TestUtils namespace - to cut template params from diff --git a/test/support/utils_sycl_defs.h b/test/support/utils_sycl_defs.h index 91d4008fd0e..51c5fe3d6a2 100644 --- a/test/support/utils_sycl_defs.h +++ b/test/support/utils_sycl_defs.h @@ -36,4 +36,22 @@ # define TEST_LIBSYCL_VERSION 0 #endif +namespace TestUtils +{ + +template +constexpr std::size_t +uniq_kernel_index() +{ + return static_cast>(alloc_type); +} + +template +struct unique_kernel_name; + +template +using new_kernel_name = unique_kernel_name::kernel_name, idx>; + +} /* namespace TestUtils */ + #endif // _UTILS_SYCL_DEFS_H