]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around a warning with MSVC. 18217/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 11 Mar 2025 20:16:58 +0000 (14:16 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 22 Apr 2025 17:17:56 +0000 (11:17 -0600)
bundled/kokkos-4.5.01/core/src/Kokkos_MemoryPool.hpp

index f7e9e2a78c4516b6be1d26c5575321f025c1c178..8a4482a7d79014d748a1b4d0a86c9e16000c90e9 100644 (file)
@@ -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);
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.