]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid some warnings compiling with CUDA support 7154/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 6 Sep 2018 07:39:49 +0000 (09:39 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 6 Sep 2018 07:39:49 +0000 (09:39 +0200)
include/deal.II/lac/la_parallel_vector.templates.h
source/lac/cuda_precondition.cu

index 8f73c8d486796e5af95fe2c607d025dab9487178..6b297418e2cbc0ce214697fb4cb6bba69b202c0a 100644 (file)
@@ -1744,7 +1744,7 @@ namespace LinearAlgebra
     typename Vector<Number, MemorySpace>::real_type
     Vector<Number, MemorySpace>::lp_norm_local(const real_type p) const
     {
-      real_type sum;
+      real_type sum = 0.;
 
       dealii::internal::VectorOperations::
         functions<Number, Number, MemorySpace>::norm_p(
index 01343ce43b0a552326d9f86c71f230be069d42de..8573fbb16eb09401c9a0c4ba05b13c27ff047c91 100644 (file)
@@ -1210,13 +1210,12 @@ namespace CUDAWrappers
     , n_rows(0)
     , n_nonzero_elements(0)
   {
-    cusparseStatus_t status;
     // step 1: create a descriptor which contains
     // - matrix M is base-0
     // - matrix L is base-0
     // - matrix L is lower triangular
     // - matrix L has non-unit diagonal
-    status = cusparseCreateMatDescr(&descr_M);
+    cusparseStatus_t status = cusparseCreateMatDescr(&descr_M);
     AssertCusparse(status);
     status = cusparseSetMatIndexBase(descr_M, CUSPARSE_INDEX_BASE_ZERO);
     AssertCusparse(status);
@@ -1515,7 +1514,6 @@ namespace CUDAWrappers
     , n_rows(0)
     , n_nonzero_elements(0)
   {
-    cusparseStatus_t status;
     // step 1: create a descriptor which contains
     // - matrix M is base-0
     // - matrix L is base-0
@@ -1524,7 +1522,7 @@ namespace CUDAWrappers
     // - matrix U is base-0
     // - matrix U is upper triangular
     // - matrix U has non-unit diagonal
-    status = cusparseCreateMatDescr(&descr_M);
+    cusparseStatus_t status = cusparseCreateMatDescr(&descr_M);
     AssertCusparse(status);
     status = cusparseSetMatIndexBase(descr_M, CUSPARSE_INDEX_BASE_ZERO);
     AssertCusparse(status);

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.