From: Daniel Arndt Date: Fri, 4 Jan 2019 21:34:02 +0000 (+0100) Subject: Fix nvcc warnings X-Git-Tag: v9.1.0-rc1~466^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b202bdfc1eb11b996b32500339c832d3b87ea85d;p=dealii.git Fix nvcc warnings --- diff --git a/include/deal.II/base/numbers.h b/include/deal.II/base/numbers.h index 55a2f77cf6..68bf74bef4 100644 --- a/include/deal.II/base/numbers.h +++ b/include/deal.II/base/numbers.h @@ -602,9 +602,9 @@ namespace internal // Type T is constructible from F. template - 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::type, typename std::decay::type>::value && std::is_constructible::value>::type * = nullptr) diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index dcbf10d1e4..4ae118090e 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -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; }