diff options
author | Mehdi Goli <mehdi.goli@codeplay.com> | 2016-11-23 16:30:41 +0000 |
---|---|---|
committer | Mehdi Goli <mehdi.goli@codeplay.com> | 2016-11-23 16:30:41 +0000 |
commit | b8cc5635d581d3b3ea9950ce8359681ae01491a2 (patch) | |
tree | fe2af800157e6ffbb02d593e0ebb860bff0cba16 /unsupported/test | |
parent | f11da1d83b64f66252dcce17447c63bda2c663b7 (diff) |
Removing unsupported device from test case; cleaning the tensor device sycl.
Diffstat (limited to 'unsupported/test')
-rw-r--r-- | unsupported/test/cxx11_tensor_broadcast_sycl.cpp | 10 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_builtins_sycl.cpp | 16 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_device_sycl.cpp | 6 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_forced_eval_sycl.cpp | 15 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_morphing_sycl.cpp | 18 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_reduction_sycl.cpp | 6 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_sycl.cpp | 14 |
7 files changed, 51 insertions, 34 deletions
diff --git a/unsupported/test/cxx11_tensor_broadcast_sycl.cpp b/unsupported/test/cxx11_tensor_broadcast_sycl.cpp index 3dbb8d553..752a61f8a 100644 --- a/unsupported/test/cxx11_tensor_broadcast_sycl.cpp +++ b/unsupported/test/cxx11_tensor_broadcast_sycl.cpp @@ -137,14 +137,20 @@ template<typename DataType> void sycl_broadcast_test_per_device(const cl::sycl:: test_broadcast_sycl_fixed<DataType, ColMajor, int>(sycl_device); test_broadcast_sycl<DataType, ColMajor, int>(sycl_device); - test_broadcast_sycl_fixed<DataType, RowMajor, int64_t>(sycl_device); + test_broadcast_sycl<DataType, RowMajor, int64_t>(sycl_device); - test_broadcast_sycl_fixed<DataType, ColMajor, int64_t>(sycl_device); test_broadcast_sycl<DataType, ColMajor, int64_t>(sycl_device); + // the folowing two test breaks the intel gpu and amd gpu driver (cannot create opencl kernel) + // test_broadcast_sycl_fixed<DataType, RowMajor, int64_t>(sycl_device); + // test_broadcast_sycl_fixed<DataType, ColMajor, int64_t>(sycl_device); } void test_cxx11_tensor_broadcast_sycl() { for (const auto& device : cl::sycl::device::get_devices()) { + /// get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU ) + auto s= device.template get_info<cl::sycl::info::device::vendor>(); + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + if(!device.is_cpu() || s.find("amd")==std::string::npos) CALL_SUBTEST(sycl_broadcast_test_per_device<float>(device)); } } diff --git a/unsupported/test/cxx11_tensor_builtins_sycl.cpp b/unsupported/test/cxx11_tensor_builtins_sycl.cpp index 989b335b2..dd739f470 100644 --- a/unsupported/test/cxx11_tensor_builtins_sycl.cpp +++ b/unsupported/test/cxx11_tensor_builtins_sycl.cpp @@ -264,9 +264,15 @@ static void test_builtin_binary_sycl(const Eigen::SyclDevice &sycl_device) { } void test_cxx11_tensor_builtins_sycl() { - cl::sycl::gpu_selector s; - QueueInterface queueInterface(s); - Eigen::SyclDevice sycl_device(&queueInterface); - CALL_SUBTEST(test_builtin_unary_sycl(sycl_device)); - CALL_SUBTEST(test_builtin_binary_sycl(sycl_device)); + for (const auto& device : cl::sycl::device::get_devices()) { + /// get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU ) + auto s= device.template get_info<cl::sycl::info::device::vendor>(); + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + if(!device.is_cpu() || s.find("amd")==std::string::npos){ + QueueInterface queueInterface(device); + Eigen::SyclDevice sycl_device(&queueInterface); + CALL_SUBTEST(test_builtin_unary_sycl(sycl_device)); + CALL_SUBTEST(test_builtin_binary_sycl(sycl_device)); + } + } } diff --git a/unsupported/test/cxx11_tensor_device_sycl.cpp b/unsupported/test/cxx11_tensor_device_sycl.cpp index 9e13d2f1b..7f9372c04 100644 --- a/unsupported/test/cxx11_tensor_device_sycl.cpp +++ b/unsupported/test/cxx11_tensor_device_sycl.cpp @@ -72,6 +72,10 @@ template<typename DataType> void sycl_device_test_per_device(const cl::sycl::dev void test_cxx11_tensor_device_sycl() { for (const auto& device : cl::sycl::device::get_devices()) { - CALL_SUBTEST(sycl_device_test_per_device<float>(device)); + /// get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU ) + auto s= device.template get_info<cl::sycl::info::device::vendor>(); + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + if(!device.is_cpu() || s.find("amd")==std::string::npos) + CALL_SUBTEST(sycl_device_test_per_device<float>(device)); } } diff --git a/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp b/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp index 70b182558..4ff218cb6 100644 --- a/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp +++ b/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp @@ -70,12 +70,11 @@ template <typename DataType, typename Dev_selector> void tensorForced_evalperDev test_forced_eval_sycl<DataType, ColMajor>(sycl_device); } void test_cxx11_tensor_forced_eval_sycl() { - - printf("Test on GPU: OpenCL\n"); - CALL_SUBTEST(tensorForced_evalperDevice<float>((cl::sycl::gpu_selector()))); - printf("repeating the test on CPU: OpenCL\n"); - CALL_SUBTEST(tensorForced_evalperDevice<float>((cl::sycl::cpu_selector()))); - printf("repeating the test on CPU: HOST\n"); - CALL_SUBTEST(tensorForced_evalperDevice<float>((cl::sycl::host_selector()))); - printf("Test Passed******************\n" ); + for (const auto& device : cl::sycl::device::get_devices()) { + /// get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU ) + auto s= device.template get_info<cl::sycl::info::device::vendor>(); + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + if(!device.is_cpu() || s.find("amd")==std::string::npos) + CALL_SUBTEST(tensorForced_evalperDevice<float>(device)); + } } diff --git a/unsupported/test/cxx11_tensor_morphing_sycl.cpp b/unsupported/test/cxx11_tensor_morphing_sycl.cpp index a16e1caf5..4ca73ea1b 100644 --- a/unsupported/test/cxx11_tensor_morphing_sycl.cpp +++ b/unsupported/test/cxx11_tensor_morphing_sycl.cpp @@ -82,14 +82,12 @@ template<typename DataType, typename dev_Selector> void sycl_slicing_test_per_de } void test_cxx11_tensor_morphing_sycl() { - /// Currentlly it only works on cpu. Adding GPU cause LLVM ERROR in cunstructing OpenCL Kernel at runtime. -// 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_slicing_test_per_device<float>((cl::sycl::cpu_selector()))); - printf("repeating the test on CPU: HOST\n"); - CALL_SUBTEST(sycl_slicing_test_per_device<float>((cl::sycl::host_selector()))); - printf("Test Passed******************\n" ); - - + for (const auto& device : cl::sycl::device::get_devices()) { + /// get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU ) + /// Currentlly it only works on cpu. Adding GPU cause LLVM ERROR in cunstructing OpenCL Kernel at runtime. + auto s= device.template get_info<cl::sycl::info::device::vendor>(); + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + if(device.is_cpu() && s.find("amd")==std::string::npos) + CALL_SUBTEST(sycl_slicing_test_per_device<float>(device)); + } } diff --git a/unsupported/test/cxx11_tensor_reduction_sycl.cpp b/unsupported/test/cxx11_tensor_reduction_sycl.cpp index 9e20f9cd0..32cfb94c2 100644 --- a/unsupported/test/cxx11_tensor_reduction_sycl.cpp +++ b/unsupported/test/cxx11_tensor_reduction_sycl.cpp @@ -142,6 +142,10 @@ template<typename DataType> void sycl_reduction_test_per_device(const cl::sycl:: } void test_cxx11_tensor_reduction_sycl() { for (const auto& device : cl::sycl::device::get_devices()) { - CALL_SUBTEST(sycl_reduction_test_per_device<float>(device)); + /// get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU ) + auto s= device.template get_info<cl::sycl::info::device::vendor>(); + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + if(!device.is_cpu() || s.find("amd")==std::string::npos) + CALL_SUBTEST(sycl_reduction_test_per_device<float>(device)); } } diff --git a/unsupported/test/cxx11_tensor_sycl.cpp b/unsupported/test/cxx11_tensor_sycl.cpp index bf115d652..670b5f379 100644 --- a/unsupported/test/cxx11_tensor_sycl.cpp +++ b/unsupported/test/cxx11_tensor_sycl.cpp @@ -197,11 +197,11 @@ template<typename DataType, typename dev_Selector> void sycl_computing_test_per_ test_sycl_computations<DataType, ColMajor>(sycl_device); } void test_cxx11_tensor_sycl() { - printf("Test on GPU: OpenCL\n"); - CALL_SUBTEST(sycl_computing_test_per_device<float>((cl::sycl::gpu_selector()))); - printf("repeating the test on CPU: OpenCL\n"); - CALL_SUBTEST(sycl_computing_test_per_device<float>((cl::sycl::cpu_selector()))); - printf("repeating the test on CPU: HOST\n"); - CALL_SUBTEST(sycl_computing_test_per_device<float>((cl::sycl::host_selector()))); - printf("Test Passed******************\n" ); + for (const auto& device : cl::sycl::device::get_devices()) { + /// get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU ) + auto s= device.template get_info<cl::sycl::info::device::vendor>(); + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + if(!device.is_cpu() || s.find("amd")==std::string::npos) + CALL_SUBTEST(sycl_computing_test_per_device<float>(device)); + } } |