diff options
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h index 785321666..6af2d45d4 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h @@ -24,6 +24,11 @@ const T2& choose(Cond<false>, const T1&, const T2& second) { return second; } +template <typename T> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T divup(const T x, const T y) { + return (x + y - 1) / y; +} + template <size_t n> struct max_n_1 { static const size_t size = n; }; @@ -36,7 +41,7 @@ template <> struct max_n_1<0> { template <typename Scalar, typename Device> struct PacketType { typedef typename internal::packet_traits<Scalar>::type type; - static const int size = internal::unpacket_traits<type>::size; + enum { size = internal::unpacket_traits<type>::size }; }; // For CUDA packet types when using a GpuDevice @@ -101,13 +106,18 @@ bool operator!=(const Tuple<U, V>& x, const Tuple<U, V>& y) { #ifdef EIGEN_HAS_SFINAE -namespace internal{ +namespace internal { template<typename IndexType, Index... Is> EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array<Index, sizeof...(Is)> customIndices2Array(IndexType& idx, numeric_list<Index, Is...>) { return { idx[Is]... }; } + template<typename IndexType> + EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + array<Index, 0> customIndices2Array(IndexType&, numeric_list<Index>) { + return array<Index, 0>(); + } /** Make an array (for index/dimensions) out of a custom index */ template<typename Index, std::size_t NumIndices, typename IndexType> |