From 1c6eafb46b8b3a0fb5dd583ed546588c8869a6be Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 18 Nov 2016 16:43:27 -0800 Subject: Updated cxx11_tensor_device_sycl to run only on the OpenCL devices available on the host --- unsupported/test/cxx11_tensor_device_sycl.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'unsupported/test/cxx11_tensor_device_sycl.cpp') diff --git a/unsupported/test/cxx11_tensor_device_sycl.cpp b/unsupported/test/cxx11_tensor_device_sycl.cpp index 95da83c6f..a41fd37c2 100644 --- a/unsupported/test/cxx11_tensor_device_sycl.cpp +++ b/unsupported/test/cxx11_tensor_device_sycl.cpp @@ -55,8 +55,9 @@ void test_device_exceptions(const Eigen::SyclDevice &sycl_device) { sycl_device.deallocate(gpu_data); } -template void sycl_device_test_per_device(dev_Selector s){ - QueueInterface queueInterface(s); +template void sycl_device_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_device_memory(sycl_device); test_device_memory(sycl_device); @@ -67,11 +68,7 @@ template void sycl_device_test_per_dev } void test_cxx11_tensor_device_sycl() { - printf("Test on GPU: OpenCL\n"); - CALL_SUBTEST(sycl_device_test_per_device((cl::sycl::gpu_selector()))); - // printf("repeating the test on CPU: OpenCL\n"); - // CALL_SUBTEST(sycl_device_test_per_device((cl::sycl::cpu_selector()))); - printf("repeating the test on CPU: HOST\n"); - CALL_SUBTEST(sycl_device_test_per_device((cl::sycl::host_selector()))); - printf("Test Passed******************\n" ); + for (const auto& device : cl::sycl::device::get_devices()) { + CALL_SUBTEST(sycl_device_test_per_device(device)); + } } -- cgit v1.2.3