diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h index 4eebbe70f..e8fb85d83 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h @@ -655,13 +655,11 @@ EIGEN_STRONG_INLINE void TensorExecutor(device.getNumGpuMultiProcessors() * - device.maxGpuThreadsPerMultiProcessor(), - NumTraits::highest()) / - block_size; + static_cast(numext::mini(device.getNumGpuMultiProcessors() * device.maxGpuThreadsPerMultiProcessor(), + NumTraits::highest()) / block_size); const StorageIndex size = array_prod(evaluator.dimensions()); // Create a least one block to ensure we won't crash when tensorflow calls with tensors of size 0. - const int num_blocks = numext::maxi(numext::mini(max_blocks, numext::div_ceil(size, block_size)), 1); + const int num_blocks = numext::maxi(numext::mini(max_blocks, static_cast(numext::div_ceil(size, block_size))), 1); LAUNCH_GPU_KERNEL( (EigenMetaKernel, StorageIndex>),