From: Daniel Arndt Date: Thu, 16 Aug 2018 14:17:16 +0000 (+0200) Subject: Fix wrong symbol in CUDAWrappers::Vector::print() X-Git-Tag: v9.1.0-rc1~817^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7069%2Fhead;p=dealii.git Fix wrong symbol in CUDAWrappers::Vector::print() --- diff --git a/source/lac/cuda_vector.cu b/source/lac/cuda_vector.cu index 1809c51f6f..58bdbe4972 100644 --- a/source/lac/cuda_vector.cu +++ b/source/lac/cuda_vector.cu @@ -13,6 +13,7 @@ // // --------------------------------------------------------------------- +#include #include #include @@ -688,18 +689,11 @@ namespace LinearAlgebra out << std::endl; // Copy the vector to the host - Number * cpu_val = new Number[n_elements]; - cudaError_t error_code = cudaMemcpy(cpu_val, - val, - n_elements * sizeof(Number), - cudaMemcpyHostToDevice); - AssertCuda(error_code); + std::vector cpu_val(n_elements); + Utilities::CUDA::copy_to_host(val, cpu_val); for (unsigned int i = 0; i < n_elements; ++i) out << cpu_val[i] << std::endl; out << std::flush; - delete[] cpu_val; - cpu_val = nullptr; - AssertThrow(out, ExcIO()); // reset output format