]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename functions allocating and deleting 7094/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 21 Aug 2018 14:51:51 +0000 (16:51 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 21 Aug 2018 14:51:51 +0000 (16:51 +0200)
source/lac/cuda_sparse_matrix.cu

index d4411b8319d4ca5cf017478be8a6ea1c6f46f6fd..c409b68ff7e1cc9a9bb4b2f615721b9199ee50ae 100644 (file)
@@ -31,7 +31,7 @@ namespace CUDAWrappers
   {
     template <typename Number>
     void
-    delete_device_vector(Number *device_ptr) noexcept
+    delete_device_data(Number *device_ptr) noexcept
     {
       const cudaError_t error_code = cudaFree(device_ptr);
       (void)error_code;
@@ -41,7 +41,7 @@ namespace CUDAWrappers
 
     template <typename Number>
     Number *
-    allocate_device_vector(const std::size_t size)
+    allocate_device_data(const std::size_t size)
     {
       Number *device_ptr;
       Utilities::CUDA::malloc(device_ptr, size);
@@ -190,9 +190,9 @@ namespace CUDAWrappers
   SparseMatrix<Number>::SparseMatrix()
     : nnz(0)
     , n_rows(0)
-    , val_dev(nullptr, delete_device_vector<Number>)
-    , column_index_dev(nullptr, delete_device_vector<int>)
-    , row_ptr_dev(nullptr, delete_device_vector<int>)
+    , val_dev(nullptr, delete_device_data<Number>)
+    , column_index_dev(nullptr, delete_device_data<int>)
+    , row_ptr_dev(nullptr, delete_device_data<int>)
     , descr(nullptr)
   {}
 
@@ -202,9 +202,9 @@ namespace CUDAWrappers
   SparseMatrix<Number>::SparseMatrix(
     Utilities::CUDA::Handle &             handle,
     const ::dealii::SparseMatrix<Number> &sparse_matrix_host)
-    : val_dev(nullptr, delete_device_vector<Number>)
-    , column_index_dev(nullptr, delete_device_vector<int>)
-    , row_ptr_dev(nullptr, delete_device_vector<int>)
+    : val_dev(nullptr, delete_device_data<Number>)
+    , column_index_dev(nullptr, delete_device_data<int>)
+    , row_ptr_dev(nullptr, delete_device_data<int>)
     , descr(nullptr)
   {
     reinit(handle, sparse_matrix_host);
@@ -318,7 +318,7 @@ namespace CUDAWrappers
       }
 
     // Copy the elements to the gpu
-    val_dev.reset(allocate_device_vector<Number>(nnz));
+    val_dev.reset(allocate_device_data<Number>(nnz));
     cudaError_t error_code = cudaMemcpy(val_dev.get(),
                                         &val[0],
                                         nnz * sizeof(Number),
@@ -326,7 +326,7 @@ namespace CUDAWrappers
     AssertCuda(error_code);
 
     // Copy the column indices to the gpu
-    column_index_dev.reset(allocate_device_vector<int>(nnz));
+    column_index_dev.reset(allocate_device_data<int>(nnz));
     AssertCuda(error_code);
     error_code = cudaMemcpy(column_index_dev.get(),
                             &column_index[0],
@@ -335,7 +335,7 @@ namespace CUDAWrappers
     AssertCuda(error_code);
 
     // Copy the row pointer to the gpu
-    row_ptr_dev.reset(allocate_device_vector<int>(row_ptr_size));
+    row_ptr_dev.reset(allocate_device_data<int>(row_ptr_size));
     AssertCuda(error_code);
     error_code = cudaMemcpy(row_ptr_dev.get(),
                             &row_ptr[0],

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.