diff options
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorSycl.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorSycl.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorSycl.h index 3d6270614..7b8bd2df7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorSycl.h @@ -34,12 +34,26 @@ struct MakeLocalPointer { namespace Eigen { template<typename StrideDims, typename XprType> class TensorTupleReducerDeviceOp; template<typename StrideDims, typename ArgType> struct TensorEvaluator<const TensorTupleReducerDeviceOp<StrideDims, ArgType>, SyclKernelDevice>; -namespace TensorSycl { namespace internal { - template<typename CoeffReturnType, typename OP, typename OutputAccessor, typename InputAccessor, typename LocalAccessor> struct GenericKernelReducer; +#ifdef __SYCL_DEVICE_ONLY__ +template<typename A, typename B> struct TypeConversion { + template<typename T> + static typename MakeGlobalPointer<A>::Type get_address_space_pointer(typename MakeGlobalPointer<T>::Type p); + template<typename T> + static typename MakeLocalPointer<A>::Type get_address_space_pointer(typename MakeLocalPointer<T>::Type p); + + template<typename T> + static A* get_address_space_pointer(T* p); + typedef decltype(get_address_space_pointer(B())) type; +}; +#endif +} +namespace TensorSycl { +namespace internal { + template<typename CoeffReturnType, typename OP, typename OutputAccessor, typename InputAccessor, typename LocalAccessor> struct GenericKernelReducer; /// This struct is used for special expression nodes with no operations (for example assign and selectOP). struct NoOP; @@ -51,10 +65,10 @@ template<typename T> struct GetType<false, T>{ }; template <bool Conds, size_t X , size_t Y > struct ValueCondition { - static const size_t Res =X; + static constexpr size_t Res =X; }; -template<size_t X, size_t Y> struct ValueCondition<false, X , Y> { - static const size_t Res =Y; +template<size_t X, size_t Y> struct ValueCondition<false, X, Y> { + static constexpr size_t Res =Y; }; } |