From 6f9ad7da6122fdb4197c0b43dfec09ec3525305e Mon Sep 17 00:00:00 2001 From: Charles Schlosser Date: Fri, 27 Oct 2023 15:52:00 +0000 Subject: [PATCH] fix Wshorten-64-to-32 warnings in div_ceil --- .../Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h | 4 ++-- unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 757680868..9567d3b5c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1548,10 +1548,10 @@ struct TensorEvaluator(new_tasks) / - (numext::div_ceil(new_tasks, num_threads) * num_threads); + (numext::div_ceil(new_tasks, num_threads) * num_threads); Index old_tasks = numext::div_ceil(nm0, oldgm) * numext::div_ceil(nn0, oldgn); double old_parallelism = static_cast(old_tasks) / - (numext::div_ceil(old_tasks, num_threads) * num_threads); + (numext::div_ceil(old_tasks, num_threads) * num_threads); if (new_parallelism > old_parallelism || new_parallelism == 1) return 1; return 0; } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 53b66c02e..abf68345e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -373,7 +373,7 @@ struct ThreadPoolDevice { // computations: double max_efficiency = static_cast(block_count) / - (numext::div_ceil(block_count, numThreads()) * numThreads()); + (numext::div_ceil(block_count, numThreads()) * numThreads()); // Now try to increase block size up to max_block_size as long as it // doesn't decrease parallel efficiency. @@ -396,7 +396,7 @@ struct ThreadPoolDevice { prev_block_count = coarser_block_count; const double coarser_efficiency = static_cast(coarser_block_count) / - (numext::div_ceil(coarser_block_count, numThreads()) * numThreads()); + (numext::div_ceil(coarser_block_count, numThreads()) * numThreads()); if (coarser_efficiency + 0.01 >= max_efficiency) { // Taking it. block_size = coarser_block_size;