From 251f1e6916d0532278f91f3baf665b0f6a41f369 Mon Sep 17 00:00:00 2001 From: Mickael Ide Date: Wed, 25 May 2022 17:52:52 +0200 Subject: [PATCH] Revert print vector changes because of std::vector --- cpp/include/raft/core/cudart_utils.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cpp/include/raft/core/cudart_utils.hpp b/cpp/include/raft/core/cudart_utils.hpp index a1e7e6bc32..ce0d2a7025 100644 --- a/cpp/include/raft/core/cudart_utils.hpp +++ b/cpp/include/raft/core/cudart_utils.hpp @@ -36,7 +36,6 @@ #include #include #include -#include ///@todo: enable once logging has been enabled in raft //#include "logger.hpp" @@ -303,10 +302,10 @@ void print_device_vector(const char* variable_name, size_t componentsCount, OutStream& out) { - std::vector host_mem(componentsCount); - CUDA_CHECK( - cudaMemcpy(host_mem.data(), devMem, componentsCount * sizeof(T), cudaMemcpyDeviceToHost)); - print_host_vector(variable_name, host_mem.data(), componentsCount, out); + T* host_mem = new T[componentsCount]; + CUDA_CHECK(cudaMemcpy(host_mem, devMem, componentsCount * sizeof(T), cudaMemcpyDeviceToHost)); + print_host_vector(variable_name, host_mem, componentsCount, out); + delete[] host_mem; } /**