From 9cac91b32a09e453f265fdc05350c920f774e465 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 21 Aug 2018 16:51:51 +0200 Subject: [PATCH] Rename functions allocating and deleting --- source/lac/cuda_sparse_matrix.cu | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/lac/cuda_sparse_matrix.cu b/source/lac/cuda_sparse_matrix.cu index d4411b8319..c409b68ff7 100644 --- a/source/lac/cuda_sparse_matrix.cu +++ b/source/lac/cuda_sparse_matrix.cu @@ -31,7 +31,7 @@ namespace CUDAWrappers { template 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 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::SparseMatrix() : nnz(0) , n_rows(0) - , val_dev(nullptr, delete_device_vector) - , column_index_dev(nullptr, delete_device_vector) - , row_ptr_dev(nullptr, delete_device_vector) + , val_dev(nullptr, delete_device_data) + , column_index_dev(nullptr, delete_device_data) + , row_ptr_dev(nullptr, delete_device_data) , descr(nullptr) {} @@ -202,9 +202,9 @@ namespace CUDAWrappers SparseMatrix::SparseMatrix( Utilities::CUDA::Handle & handle, const ::dealii::SparseMatrix &sparse_matrix_host) - : val_dev(nullptr, delete_device_vector) - , column_index_dev(nullptr, delete_device_vector) - , row_ptr_dev(nullptr, delete_device_vector) + : val_dev(nullptr, delete_device_data) + , column_index_dev(nullptr, delete_device_data) + , row_ptr_dev(nullptr, delete_device_data) , 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(nnz)); + val_dev.reset(allocate_device_data(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(nnz)); + column_index_dev.reset(allocate_device_data(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(row_ptr_size)); + row_ptr_dev.reset(allocate_device_data(row_ptr_size)); AssertCuda(error_code); error_code = cudaMemcpy(row_ptr_dev.get(), &row_ptr[0], -- 2.39.5