From: Daniel Arndt Date: Thu, 25 Apr 2019 22:10:05 +0000 (-0600) Subject: Use integers in cudaMemset X-Git-Tag: v9.1.0-rc1~169^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb975f018c4fb380eb30cf54b79b5513fa9e6c5;p=dealii.git Use integers in cudaMemset --- diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index b2e890c30e..22bfea5531 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -349,7 +349,7 @@ namespace LinearAlgebra Number * result_device; cudaError_t error_code = cudaMalloc(&result_device, sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, Number(), sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); const int n_blocks = 1 + (size - 1) / (::dealii::CUDAWrappers::chunk_size * diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index 542c31499f..47bef5ac61 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -2363,7 +2363,7 @@ namespace internal cudaError_t error_code = cudaMalloc(&result_device, size * sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, Number(), sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); const int n_blocks = 1 + (size - 1) / (chunk_size * block_size); ::dealii::LinearAlgebra::CUDAWrappers::kernel::double_vector_reduction< @@ -2414,7 +2414,7 @@ namespace internal Number * result_device; cudaError_t error_code = cudaMalloc(&result_device, sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, Number(), sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); const int n_blocks = 1 + (size - 1) / (chunk_size * block_size); ::dealii::LinearAlgebra::CUDAWrappers::kernel::reduction< @@ -2451,7 +2451,7 @@ namespace internal Number * result_device; cudaError_t error_code = cudaMalloc(&result_device, sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, Number(), sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); const int n_blocks = 1 + (size - 1) / (chunk_size * block_size); ::dealii::LinearAlgebra::CUDAWrappers::kernel::reduction< @@ -2501,7 +2501,7 @@ namespace internal Number * res_d; cudaError_t error_code = cudaMalloc(&res_d, sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(res_d, 0., sizeof(Number)); + error_code = cudaMemset(res_d, 0, sizeof(Number)); AssertCuda(error_code); const int n_blocks = 1 + (size - 1) / (chunk_size * block_size); diff --git a/source/lac/cuda_vector.cu b/source/lac/cuda_vector.cu index 0787cb679c..a0adad9280 100644 --- a/source/lac/cuda_vector.cu +++ b/source/lac/cuda_vector.cu @@ -313,7 +313,7 @@ namespace LinearAlgebra cudaError_t error_code = cudaMalloc(&result_device, n_elements * sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, Number(), sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); kernel::double_vector_reduction> @@ -540,7 +540,7 @@ namespace LinearAlgebra Number * result_device; cudaError_t error_code = cudaMalloc(&result_device, sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, Number(), sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); kernel::reduction> @@ -571,7 +571,7 @@ namespace LinearAlgebra Number * result_device; cudaError_t error_code = cudaMalloc(&result_device, sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, Number(), sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); kernel::reduction> @@ -619,7 +619,7 @@ namespace LinearAlgebra Number * result_device; cudaError_t error_code = cudaMalloc(&result_device, sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, Number(), sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); kernel::reduction> @@ -667,7 +667,7 @@ namespace LinearAlgebra Number * result_device; cudaError_t error_code = cudaMalloc(&result_device, sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemset(result_device, 0., sizeof(Number)); + error_code = cudaMemset(result_device, 0, sizeof(Number)); AssertCuda(error_code); const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size);