From: Wolfgang Bangerth Date: Tue, 11 Mar 2025 20:16:58 +0000 (-0600) Subject: Work around a warning with MSVC. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79650ea2ed6bad4abec3e908b3776a43933d0bc5;p=dealii.git Work around a warning with MSVC. --- diff --git a/bundled/kokkos-4.5.01/core/src/Kokkos_MemoryPool.hpp b/bundled/kokkos-4.5.01/core/src/Kokkos_MemoryPool.hpp index f7e9e2a78c..8a4482a7d7 100644 --- a/bundled/kokkos-4.5.01/core/src/Kokkos_MemoryPool.hpp +++ b/bundled/kokkos-4.5.01/core/src/Kokkos_MemoryPool.hpp @@ -458,7 +458,7 @@ class MemoryPool { /* Return 0 for invalid block size */ KOKKOS_INLINE_FUNCTION uint32_t allocate_block_size(uint64_t alloc_size) const noexcept { - return alloc_size <= (1UL << m_max_block_size_lg2) + return alloc_size <= (uint64_t(1) << m_max_block_size_lg2) ? (1UL << get_block_size_lg2(uint32_t(alloc_size))) : 0; } @@ -475,7 +475,7 @@ class MemoryPool { */ KOKKOS_FUNCTION void *allocate(size_t alloc_size, int32_t attempt_limit = 1) const noexcept { - if (size_t(1LU << m_max_block_size_lg2) < alloc_size) { + if ((size_t(1) << m_max_block_size_lg2) < alloc_size) { Kokkos::abort( "Kokkos MemoryPool allocation request exceeded specified maximum " "allocation size"); @@ -740,7 +740,7 @@ class MemoryPool { // mask into superblock and then shift down for block index const uint32_t bit = - (d & (ptrdiff_t(1LU << m_sb_size_lg2) - 1)) >> block_size_lg2; + (d & ((ptrdiff_t(1) << m_sb_size_lg2) - 1)) >> block_size_lg2; const int result = CB::release(sb_state_array, bit, block_state);