From 099597406ff022bc29311fd3246d749dc04bd861 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 29 Jul 2015 10:02:42 -0700 Subject: Simplified and generalized the DividerTraits code --- unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h index e44678226..b2e570ed1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h @@ -57,32 +57,13 @@ namespace { template struct DividerTraits { #if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) - typedef T type; + typedef typename conditional::type type; static const int N = sizeof(T) * 8; #else typedef uint32_t type; static const int N = 32; #endif }; - template <> - struct DividerTraits { - typedef uint32_t type; - static const int N = 32; - }; - template <> - struct DividerTraits { -#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) - typedef uint64_t type; - static const int N = 64; -#else - typedef uint32_t type; - static const int N = 32; -#endif - }; - // In C++, long is not int32_t nor int64_t, so we need a specialization for it: - template <> - struct DividerTraits : internal::conditional,DividerTraits >::type - {}; template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE uint32_t muluh(const uint32_t a, const T b) { -- cgit v1.2.3