From 11330ba4f4acf620d6e212cef0ffece530fccee8 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 16 Aug 2018 16:17:16 +0200 Subject: [PATCH] Fix wrong symbol in CUDAWrappers::Vector::print() --- source/lac/cuda_vector.cu | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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 -- 2.39.5