aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h
diff options
context:
space:
mode:
authorGravatar Mehdi Goli <mehdi.goli@codeplay.com>2017-01-18 10:45:28 +0000
committerGravatar Mehdi Goli <mehdi.goli@codeplay.com>2017-01-18 10:45:28 +0000
commitc6f7b338343ead9617558857c91fd3e03e347c3f (patch)
treec9c918874106a910eca40518608b27e42d8fa57e /unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h
parente46e7223817cfd982edec6d8e25c77e8e2493d78 (diff)
Applying Benoit's comment. Embedding synchronisation inside device memcpy so there is no need to externally call synchronise() for device memcopy.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h
index 93615e5c2..2237140e7 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h
@@ -121,11 +121,7 @@ struct TensorEvaluator<const TensorStridingOp<Strides, ArgType>, Device>
{
m_dimensions = m_impl.dimensions();
for (int i = 0; i < NumDims; ++i) {
-#ifndef __SYCL_DEVICE_ONLY__
- m_dimensions[i] = ceilf(static_cast<float>(m_dimensions[i]) / op.strides()[i]);
-#else
- m_dimensions[i] = cl::sycl::ceil(static_cast<float>(m_dimensions[i]) / op.strides()[i]);
-#endif
+ m_dimensions[i] =Eigen::numext::ceil(static_cast<float>(m_dimensions[i]) / op.strides()[i]);
}
const typename TensorEvaluator<ArgType, Device>::Dimensions& input_dims = m_impl.dimensions();
@@ -233,8 +229,6 @@ struct TensorEvaluator<const TensorStridingOp<Strides, ArgType>, Device>
/// required by sycl in order to extract the accessor
Strides functor() const { return m_strides; }
-
-
protected:
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const
{
@@ -264,7 +258,6 @@ struct TensorEvaluator<const TensorStridingOp<Strides, ArgType>, Device>
const Strides m_strides;
};
-
// Eval as lvalue
template<typename Strides, typename ArgType, typename Device>
struct TensorEvaluator<TensorStridingOp<Strides, ArgType>, Device>
@@ -299,10 +292,9 @@ struct TensorEvaluator<TensorStridingOp<Strides, ArgType>, Device>
}
/// required by sycl in order to extract the accessor
- const TensorEvaluator<ArgType, Device>& impl() const { return this->m_impl; }
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorEvaluator<ArgType, Device>& impl() const { return this->m_impl; }
/// required by sycl in order to extract the accessor
- Strides functor() const { return this->m_strides; }
-
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Strides functor() const { return this->m_strides; }
template <int StoreMode> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void writePacket(Index index, const PacketReturnType& x)