diff options
Diffstat (limited to 'eigen/bench/tensors/tensor_benchmarks_sycl.cc')
-rw-r--r-- | eigen/bench/tensors/tensor_benchmarks_sycl.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/eigen/bench/tensors/tensor_benchmarks_sycl.cc b/eigen/bench/tensors/tensor_benchmarks_sycl.cc index 6df1908..7eca4d9 100644 --- a/eigen/bench/tensors/tensor_benchmarks_sycl.cc +++ b/eigen/bench/tensors/tensor_benchmarks_sycl.cc @@ -5,12 +5,29 @@ #include "tensor_benchmarks.h" +using Eigen::array; +using Eigen::SyclDevice; +using Eigen::Tensor; +using Eigen::TensorMap; +// Simple functions +template <typename device_selector> +cl::sycl::queue sycl_queue() { + return cl::sycl::queue(device_selector(), [=](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; + } + } + }); +} + #define BM_FuncGPU(FUNC) \ static void BM_##FUNC(int iters, int N) { \ StopBenchmarkTiming(); \ - cl::sycl::gpu_selector selector; \ - Eigen::QueueInterface queue(selector); \ - Eigen::SyclDevice device(&queue); \ + cl::sycl::queue q = sycl_queue<cl::sycl::gpu_selector>(); \ + Eigen::SyclDevice device(q); \ BenchmarkSuite<Eigen::SyclDevice, float> suite(device, N); \ suite.FUNC(iters); \ } \ |