mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
21 lines
737 B
C++
21 lines
737 B
C++
#define EIGEN_USE_SYCL
|
|
|
|
#include <SYCL/sycl.hpp>
|
|
#include <iostream>
|
|
|
|
#include "tensor_benchmarks.h"
|
|
|
|
#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); \
|
|
BenchmarkSuite<Eigen::SyclDevice, float> suite(device, N); \
|
|
suite.FUNC(iters); \
|
|
} \
|
|
BENCHMARK_RANGE(BM_##FUNC, 10, 5000);
|
|
|
|
BM_FuncGPU(broadcasting);
|
|
BM_FuncGPU(coeffWiseOp);
|