Skip to content

Commit feda7ec

Browse files
committed
Add tests for the new policy variables
1 parent da1ce7f commit feda7ec

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

test/general/dpl_namespace.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int main()
5151
std::get<1>(x) = (2 * std::get<0>(x)) / n;
5252
});
5353
// val_buf = {0,1,2,...,n-1}
54-
std::transform(TestUtils::make_device_policy<Transform>(dpl::execution::dpcpp_default),
54+
std::transform(TestUtils::make_device_policy<Transform>(dpl::execution::dpdefault<>),
5555
counting_first, counting_first + n, val_first, dpl::identity());
5656
auto result = dpl::inclusive_scan_by_segment(
5757
TestUtils::make_device_policy<Scan>(dpl::execution::dpcpp_default),

test/general/test_policies.pass.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,28 @@ main()
7878

7979
test_policy_instance(dpcpp_default);
8080

81+
test_policy_instance(dpdefault<>);
82+
test_policy_instance(dpdefault<Kernel<1>>);
83+
84+
if (sycl::device::get_devices(sycl::info::device_type::cpu).size() > 0)
85+
{
86+
test_policy_instance(dpcpu<>);
87+
test_policy_instance(dpcpu<Kernel<2>>);
88+
}
89+
90+
if (sycl::device::get_devices(sycl::info::device_type::gpu).size() > 0)
91+
{
92+
test_policy_instance(dpgpu<>);
93+
test_policy_instance(dpgpu<Kernel<3>>);
94+
}
95+
8196
// make_device_policy
8297
test_policy_instance(TestUtils::make_device_policy<Kernel<11>>(q));
8398
#if TEST_LIBSYCL_VERSION && TEST_LIBSYCL_VERSION < 60000
8499
// make_device_policy requires a sycl::queue as an argument.
85100
// Currently, there is no implicit conversion (implicit syc::queue constructor by a device selector)
86101
// from a device selector to a queue.
87-
// The same test call with explicit queue creation we have below in line 78.
102+
// The same test call with explicit queue creation we have below.
88103
test_policy_instance(TestUtils::make_device_policy<Kernel<12>>(TestUtils::default_selector));
89104
#endif
90105
test_policy_instance(TestUtils::make_device_policy<Kernel<13>>(sycl::device{TestUtils::default_selector}));
@@ -94,7 +109,7 @@ main()
94109
test_policy_instance(oneapi::dpl::execution::make_device_policy<Kernel<16>>());
95110

96111
// device_policy
97-
EXPECT_TRUE(device_policy<Kernel<1>>(q).queue() == q, "wrong result for queue()");
112+
EXPECT_TRUE(device_policy<Kernel<20>>(q).queue() == q, "wrong result for queue()");
98113
test_policy_instance(device_policy<Kernel<21>>(q));
99114
test_policy_instance(device_policy<Kernel<22>>(sycl::device{TestUtils::default_selector}));
100115
test_policy_instance(device_policy<Kernel<23>>(dpcpp_default));

0 commit comments

Comments
 (0)