diff options
author | Mehdi Goli <mehdi.goli@codeplay.com> | 2016-11-25 16:19:07 +0000 |
---|---|---|
committer | Mehdi Goli <mehdi.goli@codeplay.com> | 2016-11-25 16:19:07 +0000 |
commit | 7318daf887c4f06fa62e59e29fa675e48ad168f9 (patch) | |
tree | 0b8dc515ab65b704059b0bcac171fc39fdbdd86d /unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h | |
parent | b8cc5635d581d3b3ea9950ce8359681ae01491a2 (diff) |
Fixing LLVM error on TensorMorphingSycl.h on GPU; fixing int64_t crash for tensor_broadcast_sycl on GPU; adding get_sycl_supported_devices() on syclDevice.h.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h index b24cdebf1..ca45b542e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h @@ -68,7 +68,13 @@ struct fixed_size_tensor_index_extraction_helper const Dimensions& dimensions) { const Index mult = (index == n-1) ? 1 : 0; - return array_get<n-1>(dimensions) * mult + + return +#ifdef EIGEN_USE_SYCL + utility::tuple::get<n-1>(dimensions) +#else + array_get<n-1>(dimensions) +#endif + * mult + fixed_size_tensor_index_extraction_helper<Index, n - 1>::run(index, dimensions); } }; @@ -92,6 +98,9 @@ struct fixed_size_tensor_index_extraction_helper<Index, 0> template <typename std::ptrdiff_t... Indices> struct Sizes : internal::numeric_list<std::ptrdiff_t, Indices...> { typedef internal::numeric_list<std::ptrdiff_t, Indices...> Base; + #ifdef EIGEN_USE_SYCL + const decltype(utility::tuple::make_tuple(Indices...)) t= utility::tuple::make_tuple(Indices...); + #endif static const std::ptrdiff_t total_size = internal::arg_prod(Indices...); EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t rank() const { @@ -120,7 +129,11 @@ struct Sizes : internal::numeric_list<std::ptrdiff_t, Indices...> { } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t operator[] (const std::size_t index) const { +#ifdef EIGEN_USE_SYCL + return internal::fixed_size_tensor_index_extraction_helper<std::ptrdiff_t, Base::count>::run(index, t); +#else return internal::fixed_size_tensor_index_extraction_helper<std::ptrdiff_t, Base::count>::run(index, *this); +#endif } template <typename DenseIndex> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE |