From: Daniel Arndt Date: Thu, 6 Sep 2018 07:39:49 +0000 (+0200) Subject: Avoid some warnings compiling with CUDA support X-Git-Tag: v9.1.0-rc1~751^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4fbfb32dff3c192f983a30e523909eaea21736a;p=dealii.git Avoid some warnings compiling with CUDA support --- diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 8f73c8d486..6b297418e2 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -1744,7 +1744,7 @@ namespace LinearAlgebra typename Vector::real_type Vector::lp_norm_local(const real_type p) const { - real_type sum; + real_type sum = 0.; dealii::internal::VectorOperations:: functions::norm_p( diff --git a/source/lac/cuda_precondition.cu b/source/lac/cuda_precondition.cu index 01343ce43b..8573fbb16e 100644 --- a/source/lac/cuda_precondition.cu +++ b/source/lac/cuda_precondition.cu @@ -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);