mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 20:26:03 +08:00
Fixed another compilation problem with TensorIntDiv.h
This commit is contained in:
parent
57154fdb32
commit
f074bb4b5f
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user