From ca754caa232411a064d607c212ad677e6caab770 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 18 Nov 2016 16:31:14 -0800 Subject: Only runs the cxx11_tensor_reduction_sycl on devices that are available. --- unsupported/test/cxx11_tensor_reduction_sycl.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'unsupported/test/cxx11_tensor_reduction_sycl.cpp') diff --git a/unsupported/test/cxx11_tensor_reduction_sycl.cpp b/unsupported/test/cxx11_tensor_reduction_sycl.cpp index 6b62737b8..9e20f9cd0 100644 --- a/unsupported/test/cxx11_tensor_reduction_sycl.cpp +++ b/unsupported/test/cxx11_tensor_reduction_sycl.cpp @@ -128,9 +128,11 @@ static void test_last_dim_reductions_sycl(const Eigen::SyclDevice &sycl_device) sycl_device.deallocate(gpu_out_data); } -template void sycl_reduction_test_per_device(dev_Selector s){ - QueueInterface queueInterface(s); +template void sycl_reduction_test_per_device(const cl::sycl::device& d){ + std::cout << "Running on " << d.template get_info() << std::endl; + QueueInterface queueInterface(d); auto sycl_device = Eigen::SyclDevice(&queueInterface); + test_full_reductions_sycl(sycl_device); test_first_dim_reductions_sycl(sycl_device); test_last_dim_reductions_sycl(sycl_device); @@ -139,11 +141,7 @@ template void sycl_reduction_test_per_ test_last_dim_reductions_sycl(sycl_device); } void test_cxx11_tensor_reduction_sycl() { - printf("Test on GPU: OpenCL\n"); - CALL_SUBTEST(sycl_reduction_test_per_device((cl::sycl::gpu_selector()))); - printf("repeating the test on CPU: OpenCL\n"); - CALL_SUBTEST(sycl_reduction_test_per_device((cl::sycl::cpu_selector()))); - printf("repeating the test on CPU: HOST\n"); - CALL_SUBTEST(sycl_reduction_test_per_device((cl::sycl::host_selector()))); - printf("Test Passed******************\n" ); + for (const auto& device : cl::sycl::device::get_devices()) { + CALL_SUBTEST(sycl_reduction_test_per_device(device)); + } } -- cgit v1.2.3