From 120d4780a1f00106e86e86aed4949a42c8119d39 Mon Sep 17 00:00:00 2001 From: Micka <9810050+lowener@users.noreply.github.com> Date: Thu, 26 May 2022 03:08:25 +0200 Subject: [PATCH] Revert print vector changes because of std::vector (#681) The specialization of `std::vector` when `T=bool` is unfortunately causing compilation issue in cuml because the `data()` function member is not implemented. And the elements may not be stored contiguously. (Link to the CI failure: https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/cuml/job/prb/job/cuml-cpu-cuda-build-arm64/CUDA=11.5/1364/console) cc @achirkin Authors: - Micka (https://github.com/lowener) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: https://github.com/rapidsai/raft/pull/681 --- 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; } /**