aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/cxx11_tensor_reduction_sycl.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-11-18 16:31:14 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-11-18 16:31:14 -0800
commitca754caa232411a064d607c212ad677e6caab770 (patch)
treefdbe252bcd8ab3903cc0c54606a92aa39f164c87 /unsupported/test/cxx11_tensor_reduction_sycl.cpp
parentdc601d79d14b82bf54b2e90cfa32ee0ce955e3e4 (diff)
Only runs the cxx11_tensor_reduction_sycl on devices that are available.
Diffstat (limited to 'unsupported/test/cxx11_tensor_reduction_sycl.cpp')
-rw-r--r--unsupported/test/cxx11_tensor_reduction_sycl.cpp16
1 files changed, 7 insertions, 9 deletions
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<typename DataType, typename dev_Selector> void sycl_reduction_test_per_device(dev_Selector s){
- QueueInterface queueInterface(s);
+template<typename DataType> void sycl_reduction_test_per_device(const cl::sycl::device& d){
+ std::cout << "Running on " << d.template get_info<cl::sycl::info::device::name>() << std::endl;
+ QueueInterface queueInterface(d);
auto sycl_device = Eigen::SyclDevice(&queueInterface);
+
test_full_reductions_sycl<DataType, RowMajor>(sycl_device);
test_first_dim_reductions_sycl<DataType, RowMajor>(sycl_device);
test_last_dim_reductions_sycl<DataType, RowMajor>(sycl_device);
@@ -139,11 +141,7 @@ template<typename DataType, typename dev_Selector> void sycl_reduction_test_per_
test_last_dim_reductions_sycl<DataType, ColMajor>(sycl_device);
}
void test_cxx11_tensor_reduction_sycl() {
- printf("Test on GPU: OpenCL\n");
- CALL_SUBTEST(sycl_reduction_test_per_device<float>((cl::sycl::gpu_selector())));
- printf("repeating the test on CPU: OpenCL\n");
- CALL_SUBTEST(sycl_reduction_test_per_device<float>((cl::sycl::cpu_selector())));
- printf("repeating the test on CPU: HOST\n");
- CALL_SUBTEST(sycl_reduction_test_per_device<float>((cl::sycl::host_selector())));
- printf("Test Passed******************\n" );
+ for (const auto& device : cl::sycl::device::get_devices()) {
+ CALL_SUBTEST(sycl_reduction_test_per_device<float>(device));
+ }
}