diff options
author | Mehdi Goli <mehdi.goli@codeplay.com> | 2016-11-25 16:19:07 +0000 |
---|---|---|
committer | Mehdi Goli <mehdi.goli@codeplay.com> | 2016-11-25 16:19:07 +0000 |
commit | 7318daf887c4f06fa62e59e29fa675e48ad168f9 (patch) | |
tree | 0b8dc515ab65b704059b0bcac171fc39fdbdd86d /unsupported/test | |
parent | b8cc5635d581d3b3ea9950ce8359681ae01491a2 (diff) |
Fixing LLVM error on TensorMorphingSycl.h on GPU; fixing int64_t crash for tensor_broadcast_sycl on GPU; adding get_sycl_supported_devices() on syclDevice.h.
Diffstat (limited to 'unsupported/test')
-rw-r--r-- | unsupported/test/cxx11_tensor_broadcast_sycl.cpp | 13 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_builtins_sycl.cpp | 15 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_device_sycl.cpp | 8 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_forced_eval_sycl.cpp | 8 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_morphing_sycl.cpp | 9 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_reduction_sycl.cpp | 8 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_sycl.cpp | 9 |
7 files changed, 19 insertions, 51 deletions
diff --git a/unsupported/test/cxx11_tensor_broadcast_sycl.cpp b/unsupported/test/cxx11_tensor_broadcast_sycl.cpp index 752a61f8a..c426549f1 100644 --- a/unsupported/test/cxx11_tensor_broadcast_sycl.cpp +++ b/unsupported/test/cxx11_tensor_broadcast_sycl.cpp @@ -136,21 +136,14 @@ template<typename DataType> void sycl_broadcast_test_per_device(const cl::sycl:: test_broadcast_sycl<DataType, RowMajor, int>(sycl_device); test_broadcast_sycl_fixed<DataType, ColMajor, int>(sycl_device); test_broadcast_sycl<DataType, ColMajor, int>(sycl_device); - - test_broadcast_sycl<DataType, RowMajor, 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); + 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) + for (const auto& device :Eigen::get_sycl_supported_devices()) { 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 dd739f470..d8c2898ca 100644 --- a/unsupported/test/cxx11_tensor_builtins_sycl.cpp +++ b/unsupported/test/cxx11_tensor_builtins_sycl.cpp @@ -264,15 +264,10 @@ static void test_builtin_binary_sycl(const Eigen::SyclDevice &sycl_device) { } void test_cxx11_tensor_builtins_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){ - QueueInterface queueInterface(device); - 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 :Eigen::get_sycl_supported_devices()) { + 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 7f9372c04..190dba862 100644 --- a/unsupported/test/cxx11_tensor_device_sycl.cpp +++ b/unsupported/test/cxx11_tensor_device_sycl.cpp @@ -71,11 +71,7 @@ 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()) { - /// 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)); + for (const auto& device :Eigen::get_sycl_supported_devices()) { + 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 4ff218cb6..4d19a3b2a 100644 --- a/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp +++ b/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp @@ -70,11 +70,7 @@ template <typename DataType, typename Dev_selector> void tensorForced_evalperDev test_forced_eval_sycl<DataType, ColMajor>(sycl_device); } void test_cxx11_tensor_forced_eval_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(tensorForced_evalperDevice<float>(device)); + for (const auto& device :Eigen::get_sycl_supported_devices()) { + 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 4ca73ea1b..9074c8331 100644 --- a/unsupported/test/cxx11_tensor_morphing_sycl.cpp +++ b/unsupported/test/cxx11_tensor_morphing_sycl.cpp @@ -82,12 +82,7 @@ template<typename DataType, typename dev_Selector> void sycl_slicing_test_per_de } void test_cxx11_tensor_morphing_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 ) - /// 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)); + for (const auto& device :Eigen::get_sycl_supported_devices()) { + 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 32cfb94c2..941469029 100644 --- a/unsupported/test/cxx11_tensor_reduction_sycl.cpp +++ b/unsupported/test/cxx11_tensor_reduction_sycl.cpp @@ -141,11 +141,7 @@ template<typename DataType> void sycl_reduction_test_per_device(const cl::sycl:: test_last_dim_reductions_sycl<DataType, ColMajor>(sycl_device); } void test_cxx11_tensor_reduction_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_reduction_test_per_device<float>(device)); + for (const auto& device :Eigen::get_sycl_supported_devices()) { + 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 670b5f379..150414f15 100644 --- a/unsupported/test/cxx11_tensor_sycl.cpp +++ b/unsupported/test/cxx11_tensor_sycl.cpp @@ -197,11 +197,8 @@ template<typename DataType, typename dev_Selector> void sycl_computing_test_per_ test_sycl_computations<DataType, ColMajor>(sycl_device); } void test_cxx11_tensor_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_computing_test_per_device<float>(device)); + auto devices =Eigen::get_sycl_supported_devices(); + for (const auto& device :Eigen::get_sycl_supported_devices()) { + CALL_SUBTEST(sycl_computing_test_per_device<float>(device)); } } |