mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Fixed the sycl benchmarking code
This commit is contained in:
parent
8b1c2108ba
commit
3eda02d78d
@ -5,29 +5,12 @@
|
|||||||
|
|
||||||
#include "tensor_benchmarks.h"
|
#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) \
|
#define BM_FuncGPU(FUNC) \
|
||||||
static void BM_##FUNC(int iters, int N) { \
|
static void BM_##FUNC(int iters, int N) { \
|
||||||
StopBenchmarkTiming(); \
|
StopBenchmarkTiming(); \
|
||||||
cl::sycl::queue q = sycl_queue<cl::sycl::gpu_selector>(); \
|
cl::sycl::gpu_selector selector; \
|
||||||
Eigen::SyclDevice device(q); \
|
Eigen::QueueInterface queue(selector); \
|
||||||
|
Eigen::SyclDevice device(&queue); \
|
||||||
BenchmarkSuite<Eigen::SyclDevice, float> suite(device, N); \
|
BenchmarkSuite<Eigen::SyclDevice, float> suite(device, N); \
|
||||||
suite.FUNC(iters); \
|
suite.FUNC(iters); \
|
||||||
} \
|
} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user