Fixed another compilation problem with TensorIntDiv.h

This commit is contained in:
Benoit Steiner 2015-02-26 11:14:23 -08:00
parent 57154fdb32
commit f074bb4b5f

View File

@ -33,17 +33,17 @@ namespace {
template <typename T> template <typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE int count_leading_zeros(const T val) EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE int count_leading_zeros(const T val)
{ {
#ifndef __CUDA_ARCH__ #ifdef __CUDA_ARCH__
return __builtin_clz(static_cast<uint32_t>(val)); return __clz(val);
#elif EIGEN_COMP_MSVC #elif EIGEN_COMP_MSVC
DWORD leading_zero = 0; DWORD leading_zero = 0;
_BitScanReverse( &leading_zero, value); _BitScanReverse( &leading_zero, value);
return 31 - leading_zero; return 31 - leading_zero;
#else #else
return __clz(val); return __builtin_clz(static_cast<uint32_t>(val));
#endif #endif
} }
}; }
template <typename T> template <typename T>
struct TensorIntDivisor { struct TensorIntDivisor {