Skip to content

Commit d19308f

Browse files
Fix review comment: consolidate this to a single instance of this implementation
1 parent f546f6b commit d19308f

File tree

4 files changed

+25
-31
lines changed

4 files changed

+25
-31
lines changed

test/support/test_dynamic_load_utils.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,7 @@
1919
#include <iostream>
2020

2121
#if TEST_DYNAMIC_SELECTION_AVAILABLE
22-
23-
namespace TestUtils
24-
{
25-
template <typename Op, ::std::size_t CallNumber>
26-
struct unique_kernel_name;
27-
28-
template <typename Policy, int idx>
29-
using new_kernel_name = unique_kernel_name<typename std::decay_t<Policy>::kernel_name, idx>;
30-
} // namespace TestUtils
22+
#include "utils_sycl_defs.h"
3123

3224
int
3325
test_dl_initialization(const std::vector<sycl::queue>& u)

test/support/test_dynamic_selection_utils.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@
1515
#include <random>
1616
#include <algorithm>
1717
#include <iostream>
18-
#if TEST_DYNAMIC_SELECTION_AVAILABLE
19-
20-
namespace TestUtils
21-
{
22-
template <typename Op, ::std::size_t CallNumber>
23-
struct unique_kernel_name;
2418

25-
template <typename Policy, int idx>
26-
using new_kernel_name = unique_kernel_name<typename std::decay_t<Policy>::kernel_name, idx>;
27-
} // namespace TestUtils
19+
#if TEST_DYNAMIC_SELECTION_AVAILABLE
20+
#include "utils_sycl_defs.h"
2821

2922
static inline void
3023
build_universe(std::vector<sycl::queue>& u)

test/support/utils_invoke.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,13 @@
2020

2121
#include "iterator_utils.h"
2222

23-
namespace TestUtils
24-
{
2523
#if TEST_DPCPP_BACKEND_PRESENT
24+
#include "utils_sycl_defs.h"
25+
#endif
2626

27-
template <sycl::usm::alloc alloc_type>
28-
constexpr ::std::size_t
29-
uniq_kernel_index()
27+
namespace TestUtils
3028
{
31-
return static_cast<::std::underlying_type_t<sycl::usm::alloc>>(alloc_type);
32-
}
33-
34-
template <typename Op, ::std::size_t CallNumber>
35-
struct unique_kernel_name;
36-
37-
template <typename Policy, int idx>
38-
using new_kernel_name = unique_kernel_name<typename std::decay_t<Policy>::kernel_name, idx>;
29+
#if TEST_DPCPP_BACKEND_PRESENT
3930

4031
/**
4132
* make_policy functions test wrappers

test/support/utils_sycl_defs.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,22 @@
3636
# define TEST_LIBSYCL_VERSION 0
3737
#endif
3838

39+
namespace TestUtils
40+
{
41+
42+
template <sycl::usm::alloc alloc_type>
43+
constexpr ::std::size_t
44+
uniq_kernel_index()
45+
{
46+
return static_cast<::std::underlying_type_t<sycl::usm::alloc>>(alloc_type);
47+
}
48+
49+
template <typename Op, ::std::size_t CallNumber>
50+
struct unique_kernel_name;
51+
52+
template <typename Policy, int idx>
53+
using new_kernel_name = unique_kernel_name<typename std::decay_t<Policy>::kernel_name, idx>;
54+
55+
} /* namespace TestUtils */
56+
3957
#endif // _UTILS_SYCL_DEFS_H

0 commit comments

Comments
 (0)