]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix nvcc warnings 7562/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 4 Jan 2019 21:34:02 +0000 (22:34 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 4 Jan 2019 21:34:40 +0000 (22:34 +0100)
include/deal.II/base/numbers.h
include/deal.II/base/utilities.h

index 55a2f77cf656b935986cddcdd9a6c2351b6acb02..68bf74bef411a7306060130f29138d2640252ea6 100644 (file)
@@ -602,9 +602,9 @@ namespace internal
 
     // Type T is constructible from F.
     template <typename F>
-    static T
-    value(const F &f,
-          typename std::enable_if<
+    static DEAL_II_CUDA_HOST_DEV T
+                                 value(const F &f,
+                                       typename std::enable_if<
             !std::is_same<typename std::decay<T>::type,
                           typename std::decay<F>::type>::value &&
             std::is_constructible<T, F>::value>::type * = nullptr)
index dcbf10d1e432650c37e2dbce71c805d2e9fe4a50..4ae118090ebaee6ddc32940278bb0fd9e5c08061 100644 (file)
@@ -1138,6 +1138,8 @@ namespace Utilities
     // the data is never compressed when we can't use zlib.
     (void)allow_compression;
 
+    size_t size = 0;
+
     // see if the object is small and copyable via memcpy. if so, use
     // this fast path. otherwise, we have to go through the BOOST
     // serialization machinery
@@ -1160,7 +1162,7 @@ namespace Utilities
 
         std::memcpy(dest_buffer.data() + previous_size, &object, sizeof(T));
 
-        return sizeof(T);
+        size = sizeof(T);
       }
     else
       {
@@ -1192,12 +1194,10 @@ namespace Utilities
             std::move(s.begin(), s.end(), std::back_inserter(dest_buffer));
           }
 
-        return (dest_buffer.size() - previous_size);
+        size = dest_buffer.size() - previous_size;
       }
 
-    // We should never get here
-    Assert(false, ExcInternalError());
-    return 0;
+    return size;
   }
 
 

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.