aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported
diff options
context:
space:
mode:
authorGravatar a-doumoulakis <anonymous@invalid.net>2017-05-24 17:45:29 +0100
committerGravatar a-doumoulakis <anonymous@invalid.net>2017-05-24 17:45:29 +0100
commit7a8ba565f83e17ed04f4b00ede03a9f2be27c9ee (patch)
treed795d30ccded92602221242ccba83c760e7a9c97 /unsupported
parenta5226ce4f77f68a7f8590174ed3cdebb89cbe127 (diff)
parent615733381ec4b5a073d0a4c72e3cc749d3c5d579 (diff)
Merge changed from upstream
Diffstat (limited to 'unsupported')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h34
-rw-r--r--unsupported/test/CMakeLists.txt4
2 files changed, 18 insertions, 20 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h
index c5142b7c9..3105cc122 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h
@@ -81,28 +81,26 @@ struct memsetCghFunctor{
}
};
- //get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU and intel GPU)
+ //get_devices returns all the available opencl devices. Either use device_selector or exclude devices that computecpp does not support (AMD OpenCL for CPU and intel GPU)
EIGEN_STRONG_INLINE auto get_sycl_supported_devices()->decltype(cl::sycl::device::get_devices()){
- auto devices = cl::sycl::device::get_devices();
- std::vector<cl::sycl::device>::iterator it =devices.begin();
- while(it!=devices.end()) {
- ///FIXME: Currently there is a bug in amd cpu OpenCL
- auto name = (*it).template get_info<cl::sycl::info::device::name>();
- std::transform(name.begin(), name.end(), name.begin(), ::tolower);
- auto vendor = (*it).template get_info<cl::sycl::info::device::vendor>();
+std::vector<cl::sycl::device> supported_devices;
+auto plafrom_list =cl::sycl::platform::get_platforms();
+for(const auto& platform : plafrom_list){
+ auto device_list = platform.get_devices();
+ auto platform_name =platform.template get_info<cl::sycl::info::platform::name>();
+ std::transform(platform_name.begin(), platform_name.end(), platform_name.begin(), ::tolower);
+ for(const auto& device : device_list){
+ auto vendor = device.template get_info<cl::sycl::info::device::vendor>();
std::transform(vendor.begin(), vendor.end(), vendor.begin(), ::tolower);
-
- if((*it).is_cpu() && vendor.find("amd")!=std::string::npos && vendor.find("apu") == std::string::npos){ // remove amd cpu as it is not supported by computecpp allow APUs
- it = devices.erase(it);
- //FIXME: currently there is a bug in intel gpu driver regarding memory allignment issue.
- }else if((*it).is_gpu() && name.find("intel")!=std::string::npos){
- it = devices.erase(it);
- }
- else{
- ++it;
+ bool unsuported_condition = (device.is_cpu() && platform_name.find("amd")!=std::string::npos && vendor.find("apu") == std::string::npos) ||
+ (device.is_gpu() && platform_name.find("intel")!=std::string::npos);
+ if(!unsuported_condition){
+ std::cout << "Platform name "<< platform_name << std::endl;
+ supported_devices.push_back(device);
}
}
- return devices;
+}
+return supported_devices;
}
class QueueInterface {
diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt
index 9a9124640..e639e7056 100644
--- a/unsupported/test/CMakeLists.txt
+++ b/unsupported/test/CMakeLists.txt
@@ -181,8 +181,8 @@ if(EIGEN_TEST_CXX11)
ei_add_test_sycl(cxx11_tensor_inflation_sycl ${STD_CXX_FLAG})
ei_add_test_sycl(cxx11_tensor_generator_sycl ${STD_CXX_FLAG})
ei_add_test_sycl(cxx11_tensor_patch_sycl ${STD_CXX_FLAG})
- #ei_add_test_sycl(cxx11_tensor_image_patch_sycl ${STD_CXX_FLAG})
- #ei_add_test_sycl(cxx11_tensor_volume_patch_sycl ${STD_CXX_FLAG})
+ ei_add_test_sycl(cxx11_tensor_image_patch_sycl ${STD_CXX_FLAG})
+ ei_add_test_sycl(cxx11_tensor_volume_patch_sycl ${STD_CXX_FLAG})
ei_add_test_sycl(cxx11_tensor_argmax_sycl ${STD_CXX_FLAG})
ei_add_test_sycl(cxx11_tensor_custom_op_sycl ${STD_CXX_FLAG})
endif(EIGEN_TEST_SYCL)