From 02518f30112d90b850c59340bbff3c4b7ba5b188 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Thu, 16 Jul 2026 12:43:59 +0000 Subject: [PATCH 1/2] Export nvtx stack and host mem resource symbols --- cpp/include/raft/core/detail/nvtx_range_stack.hpp | 4 ++-- cpp/include/raft/mr/host_memory_resource.hpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/include/raft/core/detail/nvtx_range_stack.hpp b/cpp/include/raft/core/detail/nvtx_range_stack.hpp index b0145a6904..d8c8559b51 100644 --- a/cpp/include/raft/core/detail/nvtx_range_stack.hpp +++ b/cpp/include/raft/core/detail/nvtx_range_stack.hpp @@ -76,7 +76,7 @@ struct nvtx_range_name_stack { std::shared_ptr current_{std::make_shared()}; }; -inline thread_local nvtx_range_name_stack range_name_stack_instance{}; +RAFT_EXPORT inline thread_local nvtx_range_name_stack range_name_stack_instance{}; } // namespace detail @@ -85,7 +85,7 @@ inline thread_local nvtx_range_name_stack range_name_stack_instance{}; * Pass the returned shared_ptr to another thread to read this thread's current NVTX range name at * any time. */ -inline auto thread_local_current_range() -> std::shared_ptr +RAFT_EXPORT inline auto thread_local_current_range() -> std::shared_ptr { return detail::range_name_stack_instance.current(); } diff --git a/cpp/include/raft/mr/host_memory_resource.hpp b/cpp/include/raft/mr/host_memory_resource.hpp index b17411f31c..af729cd45a 100644 --- a/cpp/include/raft/mr/host_memory_resource.hpp +++ b/cpp/include/raft/mr/host_memory_resource.hpp @@ -46,7 +46,7 @@ struct default_host_resource_holder { } }; -inline default_host_resource_holder default_host_resource_holder_{}; +RAFT_EXPORT inline default_host_resource_holder default_host_resource_holder_{}; } // namespace detail @@ -56,7 +56,7 @@ inline default_host_resource_holder default_host_resource_holder_{}; * Returns raft::mr::host_resource_ref pointing to the resource installed * via set_default_host_resource(), or new_delete_resource() if none was set. */ -inline auto get_default_host_resource() -> raft::mr::host_resource_ref +RAFT_EXPORT inline auto get_default_host_resource() -> raft::mr::host_resource_ref { return detail::default_host_resource_holder_.get(); } @@ -69,7 +69,7 @@ inline auto get_default_host_resource() -> raft::mr::host_resource_ref * @param res The resource to install. * @return The previous default host resource. */ -inline auto set_default_host_resource(raft::mr::host_resource res) -> raft::mr::host_resource +RAFT_EXPORT inline auto set_default_host_resource(raft::mr::host_resource res) -> raft::mr::host_resource { return detail::default_host_resource_holder_.set(res); } From 812921fb489d8fdad72abaf03b6c31dcee800d4c Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Thu, 16 Jul 2026 14:38:31 +0000 Subject: [PATCH 2/2] pre-commit run --all-files --- cpp/include/raft/core/detail/nvtx_range_stack.hpp | 2 +- cpp/include/raft/mr/host_memory_resource.hpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/include/raft/core/detail/nvtx_range_stack.hpp b/cpp/include/raft/core/detail/nvtx_range_stack.hpp index d8c8559b51..cb10f986f6 100644 --- a/cpp/include/raft/core/detail/nvtx_range_stack.hpp +++ b/cpp/include/raft/core/detail/nvtx_range_stack.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/cpp/include/raft/mr/host_memory_resource.hpp b/cpp/include/raft/mr/host_memory_resource.hpp index af729cd45a..e2805a0143 100644 --- a/cpp/include/raft/mr/host_memory_resource.hpp +++ b/cpp/include/raft/mr/host_memory_resource.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -69,7 +69,8 @@ RAFT_EXPORT inline auto get_default_host_resource() -> raft::mr::host_resource_r * @param res The resource to install. * @return The previous default host resource. */ -RAFT_EXPORT inline auto set_default_host_resource(raft::mr::host_resource res) -> raft::mr::host_resource +RAFT_EXPORT inline auto set_default_host_resource(raft::mr::host_resource res) + -> raft::mr::host_resource { return detail::default_host_resource_holder_.set(res); }