Modifying TensorDeviceSycl.h to always create buffer of type uint8_t and convert them to the actual type at the execution on the device; adding the queue interface class to separate the lifespan of sycl queue and buffers,created for that queue, from Eigen::SyclDevice; modifying sycl tests to support the evaluation of the results for both row major and column major data layout on all different devices that are supported by Sycl{CPU; GPU; and Host}.

This commit is contained in:
Mehdi Goli
2016-11-18 16:20:42 +00:00
parent 5159675c33
commit 622805a0c5
13 changed files with 439 additions and 358 deletions

View File

@@ -100,7 +100,7 @@ template <typename T> T inverse(T x) { return 1 / x; }
#define TEST_IS_THAT_RETURNS_BOOL(SCALAR, FUNC) \
{ \
/* out OPERATOR in.FUNC() */ \
/* out = in.FUNC() */ \
Tensor<SCALAR, 3> in(tensorRange); \
Tensor<bool, 3> out(tensorRange); \
in = in.random() + static_cast<SCALAR>(0.01); \
@@ -136,11 +136,13 @@ static void test_builtin_unary_sycl(const Eigen::SyclDevice &sycl_device) {
array<int, 3> tensorRange = {{sizeDim1, sizeDim2, sizeDim3}};
TEST_UNARY_BUILTINS(float)
/// your GPU must support double. Otherwise, disable the double test.
TEST_UNARY_BUILTINS(double)
}
void test_cxx11_tensor_builtins_sycl() {
cl::sycl::gpu_selector s;
Eigen::SyclDevice sycl_device(s);
QueueInterface queueInterface(s);
Eigen::SyclDevice sycl_device(&queueInterface);
CALL_SUBTEST(test_builtin_unary_sycl(sycl_device));
}