Skip to content

Commit 0c278e8

Browse files
Refactoring to avoid decltype(CLONE_NEW_POLICY(policy)) in template specializations
1 parent 2e9beab commit 0c278e8

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

test/parallel_api/algorithm/alg.sorting/sort_by_key_common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ test_with_std_policy(Policy&& policy, Size n, StabilityTag stability_tag, Compar
190190
#if TEST_DPCPP_BACKEND_PRESENT
191191
struct TagUSM;
192192

193-
template <typename Policy, typename KeyT, typename ValT, sycl::usm::alloc alloc_type, std::uint32_t KernelNameID,
194-
typename Size, typename StabilityTag, typename ...Compare>
193+
template <typename KeyT, typename ValT, sycl::usm::alloc alloc_type, std::uint32_t KernelNameID,
194+
typename Size, typename StabilityTag, typename Policy, typename ...Compare>
195195
void
196196
test_with_usm(Policy&& policy, Size n, StabilityTag stability_tag, Compare... compare)
197197
{
@@ -258,8 +258,8 @@ test_device_policy(Policy&& policy, StabilityTag stability_tag)
258258
{
259259
CustomGreat custom_greater; // Cover merge-sort from device backend
260260

261-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), std::int16_t, float, sycl::usm::alloc::shared, 1>(CLONE_NEW_POLICY(policy), large_size, stability_tag, std::greater{});
262-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), std::uint32_t, std::uint32_t, sycl::usm::alloc::device, 2>(CLONE_NEW_POLICY(policy), large_size, stability_tag);
261+
test_with_usm<std::int16_t, float, sycl::usm::alloc::shared, 1>(CLONE_NEW_POLICY(policy), large_size, stability_tag, std::greater{});
262+
test_with_usm<std::uint32_t, std::uint32_t, sycl::usm::alloc::device, 2>(CLONE_NEW_POLICY(policy), large_size, stability_tag);
263263

264264
test_with_buffers<float, float, 3>(CLONE_NEW_POLICY(policy), small_size, stability_tag, custom_greater);
265265
test_with_buffers<Particle::energy_type, Particle, 4>(CLONE_NEW_POLICY(policy), large_size, stability_tag, custom_greater);

test/parallel_api/experimental/asynch.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ void test_impl(Policy&& policy)
259259
test2_with_buffers(CLONE_NEW_POLICY(policy));
260260

261261
// Run tests for USM shared/device memory
262-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::shared>(CLONE_NEW_POLICY(policy));
263-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::device>(CLONE_NEW_POLICY(policy));
262+
test_with_usm<sycl::usm::alloc::shared>(CLONE_NEW_POLICY(policy));
263+
test_with_usm<sycl::usm::alloc::device>(CLONE_NEW_POLICY(policy));
264264
}
265265

266266
#endif // #if TEST_DPCPP_BACKEND_PRESENT

test/parallel_api/numeric/numeric.ops/exclusive_scan.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ test_with_usm(Policy&& policy)
6969
{
7070
for (::std::size_t n = 0; n <= TestUtils::max_n; n = n <= 16 ? n + 1 : size_t(3.1415 * n))
7171
{
72-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), alloc_type>(CLONE_NEW_POLICY(policy), n);
72+
test_with_usm<alloc_type>(CLONE_NEW_POLICY(policy), n);
7373
}
7474
}
7575

7676
template <typename Policy>
7777
void test_impl(Policy&& policy)
7878
{
7979
// Run tests for USM shared/device memory
80-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::shared>(CLONE_NEW_POLICY(policy));
81-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::device>(CLONE_NEW_POLICY(policy));
80+
test_with_usm<sycl::usm::alloc::shared>(CLONE_NEW_POLICY(policy));
81+
test_with_usm<sycl::usm::alloc::device>(CLONE_NEW_POLICY(policy));
8282
}
8383
#endif // TEST_DPCPP_BACKEND_PRESENT
8484

test/parallel_api/numeric/numeric.ops/exclusive_scan_by_segment_zip.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ template <typename Policy>
9191
void test_impl(Policy&& policy)
9292
{
9393
// Run tests for USM shared/device memory
94-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::shared, class KernelName1>(CLONE_NEW_POLICY(policy));
95-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::device, class KernelName2>(CLONE_NEW_POLICY(policy));
94+
test_with_usm<sycl::usm::alloc::shared, class KernelName1>(CLONE_NEW_POLICY(policy));
95+
test_with_usm<sycl::usm::alloc::device, class KernelName2>(CLONE_NEW_POLICY(policy));
9696
}
9797

9898
#endif // TEST_DPCPP_BACKEND_PRESENT

test/parallel_api/numeric/numeric.ops/inclusive_scan_by_segment_zip.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ template <typename Policy>
9393
void test_impl(Policy&& policy)
9494
{
9595
// Run tests for USM shared/device memory
96-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::shared, KernelName1>(CLONE_NEW_POLICY(policy));
97-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::device, KernelName2>(CLONE_NEW_POLICY(policy));
96+
test_with_usm<sycl::usm::alloc::shared, KernelName1>(CLONE_NEW_POLICY(policy));
97+
test_with_usm<sycl::usm::alloc::device, KernelName2>(CLONE_NEW_POLICY(policy));
9898
}
9999

100100
#endif // TEST_DPCPP_BACKEND_PRESENT

test/parallel_api/numeric/numeric.ops/reduce_by_segment.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ struct FlagPred
240240
};
241241

242242
#if TEST_DPCPP_BACKEND_PRESENT
243-
template <typename Policy, sycl::usm::alloc alloc_type, typename KernelName, typename T>
243+
template <sycl::usm::alloc alloc_type, typename KernelName, typename T, typename Policy>
244244
void
245245
test_flag_pred(Policy&& policy)
246246
{
@@ -357,8 +357,8 @@ template <typename Policy>
357357
void test_flag_pred_impl(Policy&& policy)
358358
{
359359
// test with flag pred
360-
test_flag_pred<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::device, KernelName1, std::uint64_t>(CLONE_NEW_POLICY(policy));
361-
test_flag_pred<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::device, KernelName2, MatrixPoint<float>>(CLONE_NEW_POLICY(policy));
360+
test_flag_pred<sycl::usm::alloc::device, KernelName1, std::uint64_t>(CLONE_NEW_POLICY(policy));
361+
test_flag_pred<sycl::usm::alloc::device, KernelName2, MatrixPoint<float>>(CLONE_NEW_POLICY(policy));
362362
}
363363

364364
#endif // TEST_DPCPP_BACKEND_PRESENT

test/parallel_api/numeric/numeric.ops/reduce_by_segment_zip.pass.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if TEST_DPCPP_BACKEND_PRESENT
3232
#include "support/sycl_alloc_utils.h"
3333

34-
template <typename Policy, sycl::usm::alloc alloc_type, std::size_t KernelIdx, typename BinaryOp>
34+
template <sycl::usm::alloc alloc_type, std::size_t KernelIdx, typename BinaryOp, typename Policy>
3535
void
3636
test_with_usm(Policy&& policy, BinaryOp binary_op)
3737
{
@@ -104,7 +104,7 @@ test_with_usm(Policy&& policy, BinaryOp binary_op)
104104
EXPECT_EQ(std::distance(begin_vals_out, new_last.second), 6, "wrong number of values from reduce_by_segment");
105105
}
106106

107-
template <typename Policy, std::size_t KernelIdx, typename BinaryOp>
107+
template <std::size_t KernelIdx, typename Policy, typename BinaryOp>
108108
void
109109
test_zip_with_discard(Policy&& policy, BinaryOp binary_op)
110110
{
@@ -166,8 +166,8 @@ template <typename Policy, typename BinaryOp>
166166
void test_impl(Policy&& policy, BinaryOp binary_op)
167167
{
168168
// Run tests for USM shared/device memory
169-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::shared, 0>(CLONE_NEW_POLICY(policy), binary_op);
170-
test_with_usm<decltype(CLONE_NEW_POLICY(policy)), sycl::usm::alloc::device, 1>(CLONE_NEW_POLICY(policy), binary_op);
169+
test_with_usm<sycl::usm::alloc::shared, 0>(CLONE_NEW_POLICY(policy), binary_op);
170+
test_with_usm<sycl::usm::alloc::device, 1>(CLONE_NEW_POLICY(policy), binary_op);
171171

172172
test_zip_with_discard<2>(CLONE_NEW_POLICY(policy), binary_op);
173173
}

0 commit comments

Comments
 (0)