From a86ef51f6253fc5a875a0270bce65ecdb401130f Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 26 Apr 2023 16:51:33 -0400 Subject: [PATCH] Remove include statements from inside namespace (#1467) Bringing in the below headers into the `raft::common::nvtx::detail` namespace breaks downstream users that need to use global symbols they provide. In the direct case I encountered the dlopen and dlclose functions became unusable. ``` #include #include #include #include #include #include #include ``` Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - Corey J. Nolet (https://github.com/cjnolet) URL: https://github.com/rapidsai/raft/pull/1467 --- cpp/include/raft/core/detail/nvtx.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cpp/include/raft/core/detail/nvtx.hpp b/cpp/include/raft/core/detail/nvtx.hpp index ca4c5e4a08..e734c99029 100644 --- a/cpp/include/raft/core/detail/nvtx.hpp +++ b/cpp/include/raft/core/detail/nvtx.hpp @@ -18,8 +18,6 @@ #include -namespace raft::common::nvtx::detail { - #ifdef NVTX_ENABLED #include @@ -30,6 +28,8 @@ namespace raft::common::nvtx::detail { #include #include +namespace raft::common::nvtx::detail { + /** * @brief An internal struct to store associated state with the color * generator @@ -191,8 +191,12 @@ inline void pop_range() nvtxDomainRangePop(domain_store::value()); } +} // namespace raft::common::nvtx::detail + #else // NVTX_ENABLED +namespace raft::common::nvtx::detail { + template inline void push_range(const char* format, Args... args) { @@ -203,6 +207,6 @@ inline void pop_range() { } -#endif // NVTX_ENABLED - } // namespace raft::common::nvtx::detail + +#endif // NVTX_ENABLED