]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use integers in cudaMemset 7969/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 25 Apr 2019 22:10:05 +0000 (16:10 -0600)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 25 Apr 2019 22:11:28 +0000 (16:11 -0600)
include/deal.II/lac/la_parallel_vector.templates.h
include/deal.II/lac/vector_operations_internal.h
source/lac/cuda_vector.cu

index b2e890c30ee504deca0ad308f57166b7fa76e9b6..22bfea55313ac863929b8656ef49508115afe0e9 100644 (file)
@@ -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 *
index 542c31499fa1feea2c992f891d2d74f0f676118f..47bef5ac61c6d574356aa066ed39888d5f1e8e59 100644 (file)
@@ -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);
index 0787cb679c708d34b4e3a1cdbc56493f9170e63a..a0adad92809091d5024a6f2883297d361e92627a 100644 (file)
@@ -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<Number, kernel::DotProduct<Number>>
@@ -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<Number, kernel::ElemSum<Number>>
@@ -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<Number, kernel::L1Norm<Number>>
@@ -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<Number, kernel::LInfty<Number>>
@@ -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);

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.