Skip to content

Commit

Permalink
Remove include statements from inside namespace (#1467)
Browse files Browse the repository at this point in the history
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 <cstdint>
#include <cstdlib>
#include <mutex>
#include <nvtx3/nvToolsExt.h>
#include <string>
#include <type_traits>
#include <unordered_map>
```

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #1467
  • Loading branch information
robertmaynard authored Apr 26, 2023
1 parent de19c17 commit a86ef51
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cpp/include/raft/core/detail/nvtx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#include <rmm/cuda_stream_view.hpp>

namespace raft::common::nvtx::detail {

#ifdef NVTX_ENABLED

#include <cstdint>
Expand All @@ -30,6 +28,8 @@ namespace raft::common::nvtx::detail {
#include <type_traits>
#include <unordered_map>

namespace raft::common::nvtx::detail {

/**
* @brief An internal struct to store associated state with the color
* generator
Expand Down Expand Up @@ -191,8 +191,12 @@ inline void pop_range()
nvtxDomainRangePop(domain_store<Domain>::value());
}

} // namespace raft::common::nvtx::detail

#else // NVTX_ENABLED

namespace raft::common::nvtx::detail {

template <typename Domain, typename... Args>
inline void push_range(const char* format, Args... args)
{
Expand All @@ -203,6 +207,6 @@ inline void pop_range()
{
}

#endif // NVTX_ENABLED

} // namespace raft::common::nvtx::detail

#endif // NVTX_ENABLED

0 comments on commit a86ef51

Please sign in to comment.