aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/cxx11_tensor_device_sycl.cpp
diff options
context:
space:
mode:
authorGravatar Mehdi Goli <mehdi.goli@codeplay.com>2016-11-08 17:08:02 +0000
committerGravatar Mehdi Goli <mehdi.goli@codeplay.com>2016-11-08 17:08:02 +0000
commitd57430dd73ab2f88aa5e45c370f6ab91103ff18a (patch)
treed3d46d788686c38b1da1cb696807d51334829e5a /unsupported/test/cxx11_tensor_device_sycl.cpp
parentdad177be010b45ba42425ab04af6dde6c479453b (diff)
Converting all sycl buffers to uninitialised device only buffers; adding memcpyHostToDevice and memcpyDeviceToHost on syclDevice; modifying all examples to obey the new rules; moving sycl queue creating to the device based on Benoit suggestion; removing the sycl specefic condition for returning m_result in TensorReduction.h according to Benoit suggestion.
Diffstat (limited to 'unsupported/test/cxx11_tensor_device_sycl.cpp')
-rw-r--r--unsupported/test/cxx11_tensor_device_sycl.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/unsupported/test/cxx11_tensor_device_sycl.cpp b/unsupported/test/cxx11_tensor_device_sycl.cpp
index f54fc8786..7f79753c5 100644
--- a/unsupported/test/cxx11_tensor_device_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_device_sycl.cpp
@@ -20,20 +20,12 @@
#include "main.h"
#include <unsupported/Eigen/CXX11/Tensor>
-void test_device_sycl() {
- cl::sycl::gpu_selector s;
- cl::sycl::queue q(s, [=](cl::sycl::exception_list l) {
- for (const auto& e : l) {
- try {
- std::rethrow_exception(e);
- } catch (cl::sycl::exception e) {
- std::cout << e.what() << std::endl;
- }
- }
- });
- Eigen::SyclDevice sycl_device(q);
- printf("Helo from ComputeCpp: Device Exists\n");
+void test_device_sycl(const Eigen::SyclDevice &sycl_device) {
+ std::cout <<"Helo from ComputeCpp: the requested device exists and the device name is : "
+ << sycl_device.m_queue.get_device(). template get_info<cl::sycl::info::device::name>() <<std::endl;;
}
void test_cxx11_tensor_device_sycl() {
- CALL_SUBTEST(test_device_sycl());
+ cl::sycl::gpu_selector s;
+ Eigen::SyclDevice sycl_device(s);
+ CALL_SUBTEST(test_device_sycl(sycl_device));
}