Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ if(RAFT_COMPILE_LIBRARY)
CUDA_STANDARD_REQUIRED ON
POSITION_INDEPENDENT_CODE ON
)
set_target_properties(
raft_objs
PROPERTIES CXX_VISIBILITY_PRESET hidden
CUDA_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
)

target_compile_definitions(raft_objs PRIVATE "RAFT_EXPLICIT_INSTANTIATE_ONLY")
target_compile_options(
Expand Down
9 changes: 6 additions & 3 deletions cpp/include/raft/common/detail/scatter.cuh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <raft/core/detail/macros.hpp>
#include <raft/util/cuda_utils.cuh>
#include <raft/util/vectorized.cuh>

namespace raft::detail {
namespace RAFT_EXPORT raft {
Copy link
Copy Markdown
Contributor

@csadorf csadorf Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the raft::detail namespace is not considered part of the public API. I think we should roll this out in stages though and maybe drop that in a follow-up to minimize discruption.

namespace detail {

template <typename DataT, int VecLen, typename Lambda, typename IdxT>
RAFT_KERNEL scatterKernel(DataT* out, const DataT* in, const IdxT* idx, IdxT len, Lambda op)
Expand Down Expand Up @@ -38,4 +40,5 @@ void scatterImpl(
RAFT_CUDA_TRY(cudaGetLastError());
}

} // namespace raft::detail
} // namespace detail
} // namespace RAFT_EXPORT raft
5 changes: 3 additions & 2 deletions cpp/include/raft/comms/comms_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

#include <raft/comms/detail/test.hpp>
#include <raft/core/comms.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/resources.hpp>

namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {

/**
Expand Down Expand Up @@ -156,4 +157,4 @@ bool test_commsplit(raft::resources const& h, int n_colors)
return detail::test_commsplit(h, n_colors);
}
} // namespace comms
}; // namespace raft
}; // namespace RAFT_EXPORT raft
5 changes: 3 additions & 2 deletions cpp/include/raft/comms/detail/mpi_comms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <raft/comms/detail/util.hpp>
#include <raft/core/comms.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/error.hpp>
#include <raft/core/resources.hpp>
#include <raft/util/cudart_utils.hpp>
Expand Down Expand Up @@ -59,7 +60,7 @@
#ifndef MPI_TRY_NO_THROW
#define MPI_TRY_NO_THROW(call) RAFT_MPI_TRY_NO_THROW(call)
#endif
namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {
namespace detail {

Expand Down Expand Up @@ -456,4 +457,4 @@ class mpi_comms : public comms_iface {

} // end namespace detail
}; // end namespace comms
}; // end namespace raft
}; // namespace RAFT_EXPORT raft
5 changes: 3 additions & 2 deletions cpp/include/raft/comms/detail/std_comms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <raft/comms/detail/ucp_helper.hpp>
#include <raft/comms/detail/util.hpp>
#include <raft/core/comms.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/error.hpp>
#include <raft/core/resources.hpp>
#include <raft/util/cudart_utils.hpp>
Expand Down Expand Up @@ -35,7 +36,7 @@
#include <unordered_set>
#include <utility>

namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {
namespace detail {

Expand Down Expand Up @@ -596,4 +597,4 @@ class std_comms : public comms_iface {
};
} // namespace detail
} // end namespace comms
} // end namespace raft
} // namespace RAFT_EXPORT raft
5 changes: 3 additions & 2 deletions cpp/include/raft/comms/detail/test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once

#include <raft/core/comms.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/resource/comms.hpp>
#include <raft/core/resource/cuda_stream.hpp>
#include <raft/core/resources.hpp>
Expand All @@ -16,7 +17,7 @@
#include <iostream>
#include <numeric>

namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {
namespace detail {

Expand Down Expand Up @@ -530,4 +531,4 @@ bool test_commsplit(raft::resources const& h, int n_colors)

} // namespace detail
} // namespace comms
}; // namespace raft
}; // namespace RAFT_EXPORT raft
7 changes: 4 additions & 3 deletions cpp/include/raft/comms/detail/ucp_helper.hpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <raft/core/detail/macros.hpp>
#include <raft/util/cudart_utils.hpp>

#include <stdio.h>
#include <ucp/api/ucp.h>
#include <ucp/api/ucp_def.h>

namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {
namespace detail {

Expand Down Expand Up @@ -150,4 +151,4 @@ class comms_ucp_handler {
};
} // end namespace detail
} // end namespace comms
} // end namespace raft
} // namespace RAFT_EXPORT raft
5 changes: 3 additions & 2 deletions cpp/include/raft/comms/detail/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@

#include <raft/common/nccl_macros.hpp>
#include <raft/core/comms.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/error.hpp>
#include <raft/core/interruptible.hpp>

#include <nccl.h>

#include <string>

namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {
namespace detail {

Expand Down Expand Up @@ -96,4 +97,4 @@ inline status_t nccl_sync_stream(ncclComm_t comm, cudaStream_t stream)

}; // namespace detail
}; // namespace comms
}; // namespace raft
}; // namespace RAFT_EXPORT raft
5 changes: 3 additions & 2 deletions cpp/include/raft/comms/mpi_comms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

#include <raft/comms/detail/mpi_comms.hpp>
#include <raft/core/comms.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/resource/comms.hpp>
#include <raft/core/resource/cuda_stream.hpp>

namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {

using mpi_comms = detail::mpi_comms;
Expand Down Expand Up @@ -58,4 +59,4 @@ inline void initialize_mpi_comms(resources* handle, MPI_Comm comm)
*/

}; // namespace comms
}; // end namespace raft
}; // namespace RAFT_EXPORT raft
5 changes: 3 additions & 2 deletions cpp/include/raft/comms/std_comms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <raft/comms/detail/std_comms.hpp>
#include <raft/core/comms.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/resource/comms.hpp>
#include <raft/core/resource/cuda_stream.hpp>
#include <raft/core/resources.hpp>
Expand All @@ -17,7 +18,7 @@

#include <iostream>

namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {

using std_comms = detail::std_comms;
Expand Down Expand Up @@ -173,4 +174,4 @@ inline void get_nccl_unique_id(char* uid)
memcpy(uid, id.internal, NCCL_UNIQUE_ID_BYTES);
}
}; // namespace comms
}; // end namespace raft
}; // namespace RAFT_EXPORT raft
9 changes: 6 additions & 3 deletions cpp/include/raft/core/bitmap.cuh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <raft/core/bitmap.hpp>
#include <raft/core/bitset.cuh>
#include <raft/core/detail/macros.hpp>
#include <raft/core/detail/mdspan_util.cuh>
#include <raft/core/device_container_policy.hpp>
#include <raft/core/device_mdarray.hpp>
Expand All @@ -15,7 +16,8 @@

#include <type_traits>

namespace raft::core {
namespace RAFT_EXPORT raft {
namespace core {

template <typename bitmap_t, typename index_t>
_RAFT_HOST_DEVICE inline bool bitmap_view<bitmap_t, index_t>::test(const index_t row,
Expand All @@ -39,4 +41,5 @@ void bitmap_view<bitmap_t, index_t>::to_csr(const raft::resources& res, csr_matr
raft::sparse::convert::bitmap_to_csr(res, *this, csr);
}

} // end namespace raft::core
} // namespace core
} // namespace RAFT_EXPORT raft
9 changes: 6 additions & 3 deletions cpp/include/raft/core/bitmap.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <raft/core/bitset.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/detail/mdspan_util.cuh>
#include <raft/core/device_container_policy.hpp>
#include <raft/core/device_mdarray.hpp>
#include <raft/core/resources.hpp>

#include <type_traits>

namespace raft::core {
namespace RAFT_EXPORT raft {
namespace core {
/**
* @defgroup bitmap Bitmap
* @{
Expand Down Expand Up @@ -148,4 +150,5 @@ struct bitmap_view : public bitset_view<bitmap_t, index_t> {
};

/** @} */
} // end namespace raft::core
} // namespace core
} // namespace RAFT_EXPORT raft
7 changes: 5 additions & 2 deletions cpp/include/raft/core/bitset.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once

#include <raft/core/bitset.hpp>
#include <raft/core/detail/macros.hpp>
#include <raft/core/device_container_policy.hpp>
#include <raft/core/device_mdarray.hpp>
#include <raft/core/operators.hpp>
Expand All @@ -19,7 +20,8 @@
#include <rmm/device_scalar.hpp>
#include <rmm/device_uvector.hpp>

namespace raft::core {
namespace RAFT_EXPORT raft {
namespace core {

template <typename index_t>
_RAFT_HOST_DEVICE void inline compute_original_nbits_position(const index_t original_nbits,
Expand Down Expand Up @@ -306,4 +308,5 @@ void bitset<bitset_t, index_t>::count(const raft::resources& res,
raft::popc(res, values, max_len, count_gpu_scalar);
}

} // end namespace raft::core
} // namespace core
} // namespace RAFT_EXPORT raft
9 changes: 6 additions & 3 deletions cpp/include/raft/core/bitset.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <raft/core/detail/macros.hpp>
#include <raft/core/device_container_policy.hpp>
#include <raft/core/device_mdarray.hpp>
#include <raft/core/resource/thrust_policy.hpp>
Expand All @@ -13,7 +14,8 @@

#include <cmath>

namespace raft::core {
namespace RAFT_EXPORT raft {
namespace core {
/**
* @defgroup bitset Bitset
* @{
Expand Down Expand Up @@ -433,4 +435,5 @@ struct bitset {
};

/** @} */
} // end namespace raft::core
} // namespace core
} // namespace RAFT_EXPORT raft
7 changes: 4 additions & 3 deletions cpp/include/raft/core/comms.hpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <raft/core/detail/macros.hpp>
#include <raft/core/error.hpp>

#include <cuda_runtime.h>

#include <memory>
#include <vector>

namespace raft {
namespace RAFT_EXPORT raft {
namespace comms {

/**
Expand Down Expand Up @@ -667,4 +668,4 @@ class comms_t {
*/

} // namespace comms
} // namespace raft
} // namespace RAFT_EXPORT raft
7 changes: 4 additions & 3 deletions cpp/include/raft/core/coo_matrix.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

/*
* SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once

#include <raft/core/detail/macros.hpp>
#include <raft/core/logger.hpp>
#include <raft/core/resources.hpp>
#include <raft/core/span.hpp>
#include <raft/core/sparse_types.hpp>

namespace raft {
namespace RAFT_EXPORT raft {

/**
* \defgroup coo_matrix COO Matrix
Expand Down Expand Up @@ -284,4 +285,4 @@ class coo_matrix

/** @} */

} // namespace raft
} // namespace RAFT_EXPORT raft
Loading
Loading