From b223dae2fa66d1fe5a8c591dba6d82560777942d Mon Sep 17 00:00:00 2001 From: Tamas Bela Feher Date: Mon, 6 Nov 2023 01:38:01 +0100 Subject: [PATCH] Remove debug printouts and improve docstrings --- cpp/bench/ann/src/common/cuda_huge_page_resource.hpp | 6 ++++-- cpp/bench/ann/src/raft/raft_cagra_wrapper.h | 11 ++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cpp/bench/ann/src/common/cuda_huge_page_resource.hpp b/cpp/bench/ann/src/common/cuda_huge_page_resource.hpp index c0eb6378cc..a09691d0b3 100644 --- a/cpp/bench/ann/src/common/cuda_huge_page_resource.hpp +++ b/cpp/bench/ann/src/common/cuda_huge_page_resource.hpp @@ -26,8 +26,10 @@ namespace rmm::mr { /** - * @brief `device_memory_resource` derived class that uses cudaMallocHost/Free for - * allocation/deallocation. + * @brief `device_memory_resource` derived class that uses mmap to allocate memory. + * This class enables memory allocation using huge pages. + * It is assumed that the allocated memory is directly accessible on device. This currently only + * works on GH systems. */ class cuda_huge_page_resource final : public device_memory_resource { public: diff --git a/cpp/bench/ann/src/raft/raft_cagra_wrapper.h b/cpp/bench/ann/src/raft/raft_cagra_wrapper.h index 9da86ba570..da348170a7 100644 --- a/cpp/bench/ann/src/raft/raft_cagra_wrapper.h +++ b/cpp/bench/ann/src/raft/raft_cagra_wrapper.h @@ -163,15 +163,11 @@ void RaftCagra::set_search_param(const AnnSearchParam& param) if (search_param.graph_mem != graph_mem_) { // Move graph to correct memory space graph_mem_ = search_param.graph_mem; - std::cout << "Moving graph to new memory space " << allocator_to_string(graph_mem_) - << std::endl; // We create a new graph and copy to it from existing graph auto mr = get_mr(graph_mem_); auto new_graph = make_device_mdarray( handle_, mr, make_extents(index_->graph().extent(0), index_->graph_degree())); - std::cout << "new_grap " << new_graph.extent(0) << "x" << new_graph.extent(1) << std::endl; - std::cout << "graph size " << index_->graph().size() << std::endl; raft::copy(new_graph.data_handle(), index_->graph().data_handle(), index_->graph().size(), @@ -198,11 +194,8 @@ void RaftCagra::set_search_dataset(const T* dataset, size_t nrow) dataset_ = make_device_matrix(handle_, 0, 0); index_->update_dataset(handle_, make_const_mdspan(dataset_.view())); - // Allocate space using the correcct memory resource - auto mr = get_mr(dataset_mem_); - - std::cout << "Moving dataset to new memory space " << allocator_to_string(dataset_mem_) - << std::endl; + // Allocate space using the correct memory resource. + auto mr = get_mr(dataset_mem_); auto input_dataset_view = make_device_matrix_view(dataset, nrow, this->dim_); raft::neighbors::cagra::detail::copy_with_padding(handle_, dataset_, input_dataset_view, mr);