diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 2b8c6934f9..3e43b91560 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -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( diff --git a/cpp/include/raft/common/detail/scatter.cuh b/cpp/include/raft/common/detail/scatter.cuh index 866162a198..015da6a507 100644 --- a/cpp/include/raft/common/detail/scatter.cuh +++ b/cpp/include/raft/common/detail/scatter.cuh @@ -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 #include #include -namespace raft::detail { +namespace RAFT_EXPORT raft { +namespace detail { template RAFT_KERNEL scatterKernel(DataT* out, const DataT* in, const IdxT* idx, IdxT len, Lambda op) @@ -38,4 +40,5 @@ void scatterImpl( RAFT_CUDA_TRY(cudaGetLastError()); } -} // namespace raft::detail +} // namespace detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/comms/comms_test.hpp b/cpp/include/raft/comms/comms_test.hpp index e71080cb74..309f4a2550 100644 --- a/cpp/include/raft/comms/comms_test.hpp +++ b/cpp/include/raft/comms/comms_test.hpp @@ -7,9 +7,10 @@ #include #include +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace comms { /** @@ -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 diff --git a/cpp/include/raft/comms/detail/mpi_comms.hpp b/cpp/include/raft/comms/detail/mpi_comms.hpp index d0de62c461..a83794434b 100644 --- a/cpp/include/raft/comms/detail/mpi_comms.hpp +++ b/cpp/include/raft/comms/detail/mpi_comms.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -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 { @@ -456,4 +457,4 @@ class mpi_comms : public comms_iface { } // end namespace detail }; // end namespace comms -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/comms/detail/std_comms.hpp b/cpp/include/raft/comms/detail/std_comms.hpp index 40ac0cbc51..5efc686eb3 100644 --- a/cpp/include/raft/comms/detail/std_comms.hpp +++ b/cpp/include/raft/comms/detail/std_comms.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace comms { namespace detail { @@ -596,4 +597,4 @@ class std_comms : public comms_iface { }; } // namespace detail } // end namespace comms -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/comms/detail/test.hpp b/cpp/include/raft/comms/detail/test.hpp index 83306b6204..6f1eecae15 100644 --- a/cpp/include/raft/comms/detail/test.hpp +++ b/cpp/include/raft/comms/detail/test.hpp @@ -6,6 +6,7 @@ #pragma once #include +#include #include #include #include @@ -16,7 +17,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace comms { namespace detail { @@ -530,4 +531,4 @@ bool test_commsplit(raft::resources const& h, int n_colors) } // namespace detail } // namespace comms -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/comms/detail/ucp_helper.hpp b/cpp/include/raft/comms/detail/ucp_helper.hpp index 901904fc3b..c4a5b3a635 100644 --- a/cpp/include/raft/comms/detail/ucp_helper.hpp +++ b/cpp/include/raft/comms/detail/ucp_helper.hpp @@ -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 #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace comms { namespace detail { @@ -150,4 +151,4 @@ class comms_ucp_handler { }; } // end namespace detail } // end namespace comms -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/comms/detail/util.hpp b/cpp/include/raft/comms/detail/util.hpp index 3f68c635c6..d48d9197b0 100644 --- a/cpp/include/raft/comms/detail/util.hpp +++ b/cpp/include/raft/comms/detail/util.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -14,7 +15,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace comms { namespace detail { @@ -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 diff --git a/cpp/include/raft/comms/mpi_comms.hpp b/cpp/include/raft/comms/mpi_comms.hpp index 999035ec18..8a65c2a00b 100644 --- a/cpp/include/raft/comms/mpi_comms.hpp +++ b/cpp/include/raft/comms/mpi_comms.hpp @@ -7,10 +7,11 @@ #include #include +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace comms { using mpi_comms = detail::mpi_comms; @@ -58,4 +59,4 @@ inline void initialize_mpi_comms(resources* handle, MPI_Comm comm) */ }; // namespace comms -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/comms/std_comms.hpp b/cpp/include/raft/comms/std_comms.hpp index e09f70f158..7a26293b8c 100644 --- a/cpp/include/raft/comms/std_comms.hpp +++ b/cpp/include/raft/comms/std_comms.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -17,7 +18,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace comms { using std_comms = detail::std_comms; @@ -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 diff --git a/cpp/include/raft/core/bitmap.cuh b/cpp/include/raft/core/bitmap.cuh index 12c8ee4b8c..33cbcddf90 100644 --- a/cpp/include/raft/core/bitmap.cuh +++ b/cpp/include/raft/core/bitmap.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -15,7 +16,8 @@ #include -namespace raft::core { +namespace RAFT_EXPORT raft { +namespace core { template _RAFT_HOST_DEVICE inline bool bitmap_view::test(const index_t row, @@ -39,4 +41,5 @@ void bitmap_view::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 diff --git a/cpp/include/raft/core/bitmap.hpp b/cpp/include/raft/core/bitmap.hpp index 4b7867b83f..0e763a8aee 100644 --- a/cpp/include/raft/core/bitmap.hpp +++ b/cpp/include/raft/core/bitmap.hpp @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #include @@ -13,7 +14,8 @@ #include -namespace raft::core { +namespace RAFT_EXPORT raft { +namespace core { /** * @defgroup bitmap Bitmap * @{ @@ -148,4 +150,5 @@ struct bitmap_view : public bitset_view { }; /** @} */ -} // end namespace raft::core +} // namespace core +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/bitset.cuh b/cpp/include/raft/core/bitset.cuh index 37b8375197..5616a9019c 100644 --- a/cpp/include/raft/core/bitset.cuh +++ b/cpp/include/raft/core/bitset.cuh @@ -6,6 +6,7 @@ #pragma once #include +#include #include #include #include @@ -19,7 +20,8 @@ #include #include -namespace raft::core { +namespace RAFT_EXPORT raft { +namespace core { template _RAFT_HOST_DEVICE void inline compute_original_nbits_position(const index_t original_nbits, @@ -306,4 +308,5 @@ void bitset::count(const raft::resources& res, raft::popc(res, values, max_len, count_gpu_scalar); } -} // end namespace raft::core +} // namespace core +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/bitset.hpp b/cpp/include/raft/core/bitset.hpp index d6b3fb7b63..fe47557ce4 100644 --- a/cpp/include/raft/core/bitset.hpp +++ b/cpp/include/raft/core/bitset.hpp @@ -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 #include #include #include @@ -13,7 +14,8 @@ #include -namespace raft::core { +namespace RAFT_EXPORT raft { +namespace core { /** * @defgroup bitset Bitset * @{ @@ -433,4 +435,5 @@ struct bitset { }; /** @} */ -} // end namespace raft::core +} // namespace core +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/comms.hpp b/cpp/include/raft/core/comms.hpp index 7ff91a6cb1..bdea4684db 100644 --- a/cpp/include/raft/core/comms.hpp +++ b/cpp/include/raft/core/comms.hpp @@ -1,10 +1,11 @@ /* - * 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 #include #include @@ -12,7 +13,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace comms { /** @@ -667,4 +668,4 @@ class comms_t { */ } // namespace comms -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/coo_matrix.hpp b/cpp/include/raft/core/coo_matrix.hpp index 62ad6fda0a..45bf3d3d54 100644 --- a/cpp/include/raft/core/coo_matrix.hpp +++ b/cpp/include/raft/core/coo_matrix.hpp @@ -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 #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * \defgroup coo_matrix COO Matrix @@ -284,4 +285,4 @@ class coo_matrix /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/copy.cuh b/cpp/include/raft/core/copy.cuh index dc384e706f..34c97d15ee 100644 --- a/cpp/include/raft/core/copy.cuh +++ b/cpp/include/raft/core/copy.cuh @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include -namespace raft { +#include +namespace RAFT_EXPORT raft { /** * @brief Copy data from one mdspan to another with the same extents * @@ -60,4 +61,4 @@ detail::mdspan_copyable_not_with_kernel_t copy(resources const detail::copy(res, std::forward(dst), std::forward(src)); } #endif -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/copy.hpp b/cpp/include/raft/core/copy.hpp index b6fa655bad..dd82ffeb1c 100644 --- a/cpp/include/raft/core/copy.hpp +++ b/cpp/include/raft/core/copy.hpp @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include -namespace raft { +#include +namespace RAFT_EXPORT raft { #ifndef RAFT_NON_CUDA_COPY_IMPLEMENTED #define RAFT_NON_CUDA_COPY_IMPLEMENTED @@ -55,4 +56,4 @@ detail::mdspan_copyable_not_with_kernel_t copy(resources const } #endif -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/csr_matrix.hpp b/cpp/include/raft/core/csr_matrix.hpp index bd385f7e15..0cc177dab0 100644 --- a/cpp/include/raft/core/csr_matrix.hpp +++ b/cpp/include/raft/core/csr_matrix.hpp @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * \defgroup csr_matrix CSR Matrix @@ -296,4 +297,4 @@ class csr_matrix /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/cublas_macros.hpp b/cpp/include/raft/core/cublas_macros.hpp index 0d70c6f382..ac596e562a 100644 --- a/cpp/include/raft/core/cublas_macros.hpp +++ b/cpp/include/raft/core/cublas_macros.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #pragma once +#include #include #include @@ -17,7 +18,7 @@ #define _CUBLAS_ERR_TO_STR(err) \ case err: return #err -namespace raft { +namespace RAFT_EXPORT raft { /** * @addtogroup error_handling @@ -58,7 +59,7 @@ inline const char* cublas_error_to_string(cublasStatus_t err) } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft #undef _CUBLAS_ERR_TO_STR diff --git a/cpp/include/raft/core/cuda_support.hpp b/cpp/include/raft/core/cuda_support.hpp index d4c6eeece9..db81ad07a8 100644 --- a/cpp/include/raft/core/cuda_support.hpp +++ b/cpp/include/raft/core/cuda_support.hpp @@ -1,12 +1,13 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft { +#include +namespace RAFT_EXPORT raft { #ifndef RAFT_DISABLE_CUDA auto constexpr static const CUDA_ENABLED = true; #else auto constexpr static const CUDA_ENABLED = false; #endif -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/cusolver_macros.hpp b/cpp/include/raft/core/cusolver_macros.hpp index 20b2a0e505..f25c23c139 100644 --- a/cpp/include/raft/core/cusolver_macros.hpp +++ b/cpp/include/raft/core/cusolver_macros.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #pragma once +#include #include #include @@ -18,7 +19,7 @@ #define _CUSOLVER_ERR_TO_STR(err) \ case err: return #err; -namespace raft { +namespace RAFT_EXPORT raft { /** * @ingroup error_handling @@ -59,7 +60,7 @@ inline const char* cusolver_error_to_string(cusolverStatus_t err) } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft #undef _CUSOLVER_ERR_TO_STR diff --git a/cpp/include/raft/core/cusparse_macros.hpp b/cpp/include/raft/core/cusparse_macros.hpp index b6bf1a494c..7e374ecf86 100644 --- a/cpp/include/raft/core/cusparse_macros.hpp +++ b/cpp/include/raft/core/cusparse_macros.hpp @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include @@ -23,7 +24,7 @@ // #define CUDA_VER_12_4_UP (CUDART_VERSION >= 12040) -namespace raft { +namespace RAFT_EXPORT raft { /** * @ingroup error_handling @@ -51,7 +52,7 @@ inline const char* cusparse_error_to_string(cusparseStatus_t err) } // namespace detail } // namespace sparse -} // namespace raft +} // namespace RAFT_EXPORT raft #undef _CUSPARSE_ERR_TO_STR diff --git a/cpp/include/raft/core/detail/copy.hpp b/cpp/include/raft/core/detail/copy.hpp index 8905f4c29b..67fb87c003 100644 --- a/cpp/include/raft/core/detail/copy.hpp +++ b/cpp/include/raft/core/detail/copy.hpp @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include #include @@ -26,7 +27,7 @@ #endif #endif -namespace raft { +namespace RAFT_EXPORT raft { namespace detail { template copy(resources const& res, DstType&& dst, Sr } } } // namespace detail -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/detail/fail_container_policy.hpp b/cpp/include/raft/core/detail/fail_container_policy.hpp index 2df25b739a..6c36151800 100644 --- a/cpp/include/raft/core/detail/fail_container_policy.hpp +++ b/cpp/include/raft/core/detail/fail_container_policy.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -12,7 +13,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace detail { template @@ -134,4 +135,4 @@ struct fail_container_policy { }; } // namespace detail -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/detail/macros.hpp b/cpp/include/raft/core/detail/macros.hpp index ba025ef9d4..776d1dd971 100644 --- a/cpp/include/raft/core/detail/macros.hpp +++ b/cpp/include/raft/core/detail/macros.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -75,14 +75,22 @@ // as a weak symbol rather than a global." #define RAFT_WEAK_FUNCTION __attribute__((weak)) -// The RAFT_HIDDEN_FUNCTION specificies that the function will be hidden -// and therefore not callable by consumers of raft when compiled as -// a shared library. +// Macros for controlling symbol visibility in shared libraries. +// When CXX_VISIBILITY_PRESET is set to hidden (the default for raft_objs), +// only symbols explicitly marked with RAFT_EXPORT will be visible in the +// shared library. RAFT_HIDDEN can be used to explicitly mark symbols as +// hidden (redundant with the default, but useful for clarity). // // Hidden visibility also ensures that the linker doesn't de-duplicate the // symbol across multiple `.so`. This allows multiple libraries to embed raft -// without issue -#define RAFT_HIDDEN_FUNCTION __attribute__((visibility("hidden"))) +// without issue. +#if (defined(__GNUC__) && !defined(__MINGW32__) && !defined(__MINGW64__)) +#define RAFT_EXPORT __attribute__((visibility("default"))) +#define RAFT_HIDDEN __attribute__((visibility("hidden"))) +#else +#define RAFT_EXPORT +#define RAFT_HIDDEN +#endif // The RAFT_KERNEL specificies that a kernel has hidden visibility // @@ -100,7 +108,7 @@ // // https://github.com/rapidsai/raft/issues/1722 #if defined(__CUDACC_RDC__) -#define RAFT_KERNEL RAFT_HIDDEN_FUNCTION __global__ void +#define RAFT_KERNEL RAFT_HIDDEN __global__ void #elif defined(_RAFT_HAS_CUDA) #define RAFT_KERNEL static __global__ void #else diff --git a/cpp/include/raft/core/detail/mdspan_numpy_serializer.hpp b/cpp/include/raft/core/detail/mdspan_numpy_serializer.hpp index 0dc986ff70..6ccae7ef54 100644 --- a/cpp/include/raft/core/detail/mdspan_numpy_serializer.hpp +++ b/cpp/include/raft/core/detail/mdspan_numpy_serializer.hpp @@ -1,11 +1,12 @@ /* * SPDX-FileCopyrightText: Copyright (c) 2021 Leon Merten Lohse - * SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 AND MIT */ #pragma once +#include #include #include #include @@ -25,7 +26,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace detail { @@ -486,4 +487,4 @@ inline T deserialize_scalar(std::istream& is) } // end namespace numpy_serializer } // end namespace detail -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/detail/mdspan_util.cuh b/cpp/include/raft/core/detail/mdspan_util.cuh index c211dabb05..0701ac3a94 100644 --- a/cpp/include/raft/core/detail/mdspan_util.cuh +++ b/cpp/include/raft/core/detail/mdspan_util.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -10,7 +10,8 @@ #include #include -namespace raft::detail { +namespace RAFT_EXPORT raft { +namespace detail { template RAFT_INLINE_FUNCTION constexpr auto arr_to_tup(T (&arr)[N], std::index_sequence) @@ -56,4 +57,5 @@ RAFT_INLINE_FUNCTION auto popc(uint64_t v) -> int32_t #endif // compiler } -} // end namespace raft::detail +} // namespace detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/detail/nvtx.hpp b/cpp/include/raft/core/detail/nvtx.hpp index 99f674a0c5..88bcbe8779 100644 --- a/cpp/include/raft/core/detail/nvtx.hpp +++ b/cpp/include/raft/core/detail/nvtx.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include @@ -20,7 +21,8 @@ #include #include -namespace raft::common::nvtx::detail { +namespace RAFT_EXPORT raft { +namespace common::nvtx::detail { /** * @brief An internal struct to to initialize the color generator @@ -175,11 +177,13 @@ inline void pop_range() nvtxDomainRangePop(domain_store::value()); } -} // namespace raft::common::nvtx::detail +} // namespace common::nvtx::detail +} // namespace RAFT_EXPORT raft #else // NVTX_ENABLED -namespace raft::common::nvtx::detail { +namespace RAFT_EXPORT raft { +namespace common::nvtx::detail { template inline void push_range(const char* format, Args... args) @@ -191,5 +195,6 @@ inline void pop_range() { } -} // namespace raft::common::nvtx::detail +} // namespace common::nvtx::detail +} // namespace RAFT_EXPORT raft #endif // NVTX_ENABLED diff --git a/cpp/include/raft/core/detail/nvtx_range_stack.hpp b/cpp/include/raft/core/detail/nvtx_range_stack.hpp index 9be81be958..e3825c8fa2 100644 --- a/cpp/include/raft/core/detail/nvtx_range_stack.hpp +++ b/cpp/include/raft/core/detail/nvtx_range_stack.hpp @@ -4,6 +4,8 @@ */ #pragma once +#include + #include #include #include @@ -11,7 +13,8 @@ #include #include -namespace raft::common::nvtx { +namespace RAFT_EXPORT raft { +namespace common::nvtx { namespace detail { struct nvtx_range_name_stack; @@ -87,4 +90,5 @@ inline auto thread_local_current_range() -> std::shared_ptr return detail::range_name_stack_instance.current(); } -} // namespace raft::common::nvtx +} // namespace common::nvtx +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/detail/span.hpp b/cpp/include/raft/core/detail/span.hpp index 69cc3bfc1a..9debe1ff82 100644 --- a/cpp/include/raft/core/detail/span.hpp +++ b/cpp/include/raft/core/detail/span.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -10,7 +10,7 @@ #include // numeric_limits #include -namespace raft { +namespace RAFT_EXPORT raft { template class span; @@ -95,4 +95,4 @@ struct span_storage { [[nodiscard]] constexpr auto data() const noexcept -> T* { return ptr_; } }; } // namespace detail -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/device_container_policy.hpp b/cpp/include/raft/core/device_container_policy.hpp index 9a9871a3ab..30233b69e6 100644 --- a/cpp/include/raft/core/device_container_policy.hpp +++ b/cpp/include/raft/core/device_container_policy.hpp @@ -11,6 +11,7 @@ */ #pragma once +#include #ifndef RAFT_DISABLE_CUDA #include // dynamic_extent #include @@ -26,7 +27,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief A simplified version of thrust::device_reference with support for CUDA stream. */ @@ -173,10 +174,10 @@ class device_container_policy { rmm::device_async_resource_ref mr_{rmm::mr::get_current_device_resource_ref()}; }; -} // namespace raft +} // namespace RAFT_EXPORT raft #else #include -namespace raft { +namespace RAFT_EXPORT raft { // Provide placeholders that will allow CPU-GPU interoperable codebases to // compile in non-CUDA mode but which will throw exceptions at runtime on any @@ -191,5 +192,5 @@ using device_uvector = detail::fail_container; template using device_container_policy = detail::fail_container_policy; -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/core/device_coo_matrix.hpp b/cpp/include/raft/core/device_coo_matrix.hpp index 46abc0e330..93b46dca17 100644 --- a/cpp/include/raft/core/device_coo_matrix.hpp +++ b/cpp/include/raft/core/device_coo_matrix.hpp @@ -5,12 +5,13 @@ #pragma once #include +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * \defgroup device_coo_matrix Device COO Matrix @@ -383,4 +384,4 @@ auto make_device_coordinate_structure_view(raft::device_span rows, /** @} */ -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/device_csr_matrix.hpp b/cpp/include/raft/core/device_csr_matrix.hpp index 7f69b5a825..a5166f62f6 100644 --- a/cpp/include/raft/core/device_csr_matrix.hpp +++ b/cpp/include/raft/core/device_csr_matrix.hpp @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include #include @@ -13,7 +14,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * \defgroup device_csr_matrix Device CSR Matrix Types @@ -410,4 +411,4 @@ auto make_device_compressed_structure_view(raft::device_span indptr, /** @} */ -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/device_mdarray.hpp b/cpp/include/raft/core/device_mdarray.hpp index c575546be2..f7f564283c 100644 --- a/cpp/include/raft/core/device_mdarray.hpp +++ b/cpp/include/raft/core/device_mdarray.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -14,7 +15,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief mdarray with device container policy @@ -185,4 +186,4 @@ auto make_device_vector(raft::resources const& handle, IndexType n) make_extents(n)); } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/device_mdspan.hpp b/cpp/include/raft/core/device_mdspan.hpp index 4de5f7ec47..c118a89ada 100644 --- a/cpp/include/raft/core/device_mdspan.hpp +++ b/cpp/include/raft/core/device_mdspan.hpp @@ -1,17 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { template using device_accessor = host_device_accessor; @@ -263,4 +264,4 @@ auto make_vector_strided_layout(IndexType n, IndexType stride) { return make_strided_layout(vector_extent{n}, cuda::std::array{stride}); } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/device_resources.hpp b/cpp/include/raft/core/device_resources.hpp index 753ac769d3..c48c21badc 100644 --- a/cpp/include/raft/core/device_resources.hpp +++ b/cpp/include/raft/core/device_resources.hpp @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include @@ -43,7 +44,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief Main resource container object that stores all necessary resources @@ -248,6 +249,6 @@ class stream_syncer { const device_resources& handle_; }; // class stream_syncer -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/core/device_resources_manager.hpp b/cpp/include/raft/core/device_resources_manager.hpp index b400546281..b9123324c4 100644 --- a/cpp/include/raft/core/device_resources_manager.hpp +++ b/cpp/include/raft/core/device_resources_manager.hpp @@ -4,6 +4,7 @@ */ #pragma once +#include #include #include @@ -18,7 +19,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief A singleton used to easily generate a raft::device_resources object @@ -553,4 +554,4 @@ struct device_resources_manager { get_manager().set_workspace_memory_resource_(std::move(mr), device_id); } }; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/device_resources_snmg.hpp b/cpp/include/raft/core/device_resources_snmg.hpp index 01c2ab51d5..3b6ba128ef 100644 --- a/cpp/include/raft/core/device_resources_snmg.hpp +++ b/cpp/include/raft/core/device_resources_snmg.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -17,7 +18,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { const std::unordered_set snmg_related_resources = { raft::resource::MULTI_GPU, raft::resource::NCCL_COMM, raft::resource::ROOT_RANK}; @@ -153,4 +154,4 @@ class device_resources_snmg : public device_resources { std::vector pool_device_ids_; }; // class device_resources_snmg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/device_setter.hpp b/cpp/include/raft/core/device_setter.hpp index 11d1040384..4be777d1c2 100644 --- a/cpp/include/raft/core/device_setter.hpp +++ b/cpp/include/raft/core/device_setter.hpp @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief A scoped setter for the active CUDA device @@ -53,4 +54,4 @@ struct device_setter { int prev_device_; }; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/device_span.hpp b/cpp/include/raft/core/device_span.hpp index ac5ceeeb95..40ad28ae03 100644 --- a/cpp/include/raft/core/device_span.hpp +++ b/cpp/include/raft/core/device_span.hpp @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup device_span one-dimensional device span type @@ -23,4 +24,4 @@ using device_span = span; /** * @} */ -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/error.hpp b/cpp/include/raft/core/error.hpp index bae84d1c6b..9cfbe699d0 100644 --- a/cpp/include/raft/core/error.hpp +++ b/cpp/include/raft/core/error.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #pragma once +#include #if defined(__GNUC__) && __has_include() && __has_include() #define ENABLE_COLLECT_CALLSTACK #endif @@ -26,7 +27,7 @@ #include #endif -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup error_handling Exceptions & Error Handling @@ -152,7 +153,7 @@ struct non_cuda_build_error : public raft::exception { * @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft // FIXME: Need to be replaced with RAFT_FAIL /** macro to throw a runtime error */ diff --git a/cpp/include/raft/core/handle.hpp b/cpp/include/raft/core/handle.hpp index ac2b5705b6..d967372c9f 100644 --- a/cpp/include/raft/core/handle.hpp +++ b/cpp/include/raft/core/handle.hpp @@ -5,9 +5,10 @@ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * raft::handle_t is being kept around for backwards @@ -51,4 +52,4 @@ class handle_t : public raft::device_resources { ~handle_t() override {} }; -} // end NAMESPACE raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/host_container_policy.hpp b/cpp/include/raft/core/host_container_policy.hpp index 47db081771..6839431945 100644 --- a/cpp/include/raft/core/host_container_policy.hpp +++ b/cpp/include/raft/core/host_container_policy.hpp @@ -12,11 +12,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief A container backed by a host-accessible cuda::mr::synchronous_resource. @@ -150,4 +151,4 @@ class host_container_policy { raft::mr::host_resource_ref ref_ = raft::mr::get_default_host_resource(); }; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/host_coo_matrix.hpp b/cpp/include/raft/core/host_coo_matrix.hpp index 8634919f8c..5a3979c5af 100644 --- a/cpp/include/raft/core/host_coo_matrix.hpp +++ b/cpp/include/raft/core/host_coo_matrix.hpp @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * \defgroup host_coo_matrix Host COO Matrix @@ -381,4 +382,4 @@ auto make_host_coordinate_structure_view(raft::host_span rows, /** @} */ -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/host_csr_matrix.hpp b/cpp/include/raft/core/host_csr_matrix.hpp index 02de5a30f1..0a14f5b40a 100644 --- a/cpp/include/raft/core/host_csr_matrix.hpp +++ b/cpp/include/raft/core/host_csr_matrix.hpp @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #include @@ -12,7 +13,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * \defgroup host_csr_matrix Host CSR Matrix @@ -411,4 +412,4 @@ auto make_host_compressed_structure_view(raft::host_span indptr, /** @} */ -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/host_device_accessor.hpp b/cpp/include/raft/core/host_device_accessor.hpp index df445da15e..7ee360f50e 100644 --- a/cpp/include/raft/core/host_device_accessor.hpp +++ b/cpp/include/raft/core/host_device_accessor.hpp @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief A mixin to distinguish host and device memory. This is the primary @@ -44,4 +45,4 @@ struct host_device_accessor : public AccessorPolicy { } }; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/host_mdarray.hpp b/cpp/include/raft/core/host_mdarray.hpp index 535d4f47bf..712170b00e 100644 --- a/cpp/include/raft/core/host_mdarray.hpp +++ b/cpp/include/raft/core/host_mdarray.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -12,7 +13,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief mdarray with host container policy * @tparam ElementType the data type of the elements @@ -290,4 +291,4 @@ auto make_host_vector(IndexType n) return make_host_mdarray(make_extents(n)); } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/host_mdspan.hpp b/cpp/include/raft/core/host_mdspan.hpp index bde1564522..d0555d7321 100644 --- a/cpp/include/raft/core/host_mdspan.hpp +++ b/cpp/include/raft/core/host_mdspan.hpp @@ -1,17 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { template using host_accessor = host_device_accessor; @@ -221,4 +222,4 @@ auto constexpr make_host_vector_view(ElementType* ptr, IndexType n) { return host_vector_view{ptr, n}; } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/host_span.hpp b/cpp/include/raft/core/host_span.hpp index a41ad3a67d..6cb48af1a2 100644 --- a/cpp/include/raft/core/host_span.hpp +++ b/cpp/include/raft/core/host_span.hpp @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup host_span one-dimensional device span type @@ -24,4 +25,4 @@ using host_span = span; * @} */ -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/interruptible.hpp b/cpp/include/raft/core/interruptible.hpp index 59f192e7ef..cf6d8a10b1 100644 --- a/cpp/include/raft/core/interruptible.hpp +++ b/cpp/include/raft/core/interruptible.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #pragma once +#include #include #include @@ -19,7 +20,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup interruptible definitions and classes related to the interruptible API @@ -297,6 +298,6 @@ class interruptible { * @} // end doxygen group interruptible */ -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/core/kvp.hpp b/cpp/include/raft/core/kvp.hpp index 07360e4e1a..d6464dc6b1 100644 --- a/cpp/include/raft/core/kvp.hpp +++ b/cpp/include/raft/core/kvp.hpp @@ -12,7 +12,7 @@ #include #endif -namespace raft { +namespace RAFT_EXPORT raft { /** * \brief A key identifier paired with a corresponding value * @@ -72,4 +72,4 @@ RAFT_INLINE_FUNCTION KeyValuePair<_Key, _Value> shfl_xor(const KeyValuePair<_Key shfl_xor(input.value, laneMask, width, mask)); } #endif -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/logger.hpp b/cpp/include/raft/core/logger.hpp index 612d6cd87f..43bfb385a5 100644 --- a/cpp/include/raft/core/logger.hpp +++ b/cpp/include/raft/core/logger.hpp @@ -1,17 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief Returns the default sink for the global logger. @@ -52,7 +53,7 @@ inline rapids_logger::logger& default_logger() return logger_; } -} // namespace raft +} // namespace RAFT_EXPORT raft #if (RAFT_LOG_ACTIVE_LEVEL <= RAPIDS_LOGGER_LOG_LEVEL_TRACE) #define RAFT_LOG_TRACE_VEC(ptr, len) \ diff --git a/cpp/include/raft/core/managed_container_policy.hpp b/cpp/include/raft/core/managed_container_policy.hpp index 5611038179..c31a56ed27 100644 --- a/cpp/include/raft/core/managed_container_policy.hpp +++ b/cpp/include/raft/core/managed_container_policy.hpp @@ -3,11 +3,12 @@ * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #ifndef RAFT_DISABLE_CUDA #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief A container policy for managed mdarray. * @@ -44,10 +45,10 @@ struct managed_container_policy { [[nodiscard]] auto make_accessor_policy() const noexcept { return const_accessor_policy{}; } }; -} // namespace raft +} // namespace RAFT_EXPORT raft #else #include -namespace raft { +namespace RAFT_EXPORT raft { // Provide placeholders that will allow CPU-GPU interoperable codebases to // compile in non-CUDA mode but which will throw exceptions at runtime on any @@ -56,5 +57,5 @@ namespace raft { template using managed_container_policy = detail::fail_container_policy; -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/core/managed_mdarray.hpp b/cpp/include/raft/core/managed_mdarray.hpp index 21db4b52aa..d6084a69ad 100644 --- a/cpp/include/raft/core/managed_mdarray.hpp +++ b/cpp/include/raft/core/managed_mdarray.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -12,7 +13,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief mdarray with managed container policy @@ -139,4 +140,4 @@ auto make_managed_vector(raft::resources const& handle, IndexType n) make_extents(n)); } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/managed_mdspan.hpp b/cpp/include/raft/core/managed_mdspan.hpp index 75c21b6d79..5738aa75cf 100644 --- a/cpp/include/raft/core/managed_mdspan.hpp +++ b/cpp/include/raft/core/managed_mdspan.hpp @@ -1,17 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { template using managed_accessor = host_device_accessor; @@ -258,4 +259,4 @@ auto constexpr make_managed_mdspan(ElementType* ptr, extents(ptr, exts); } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/math.hpp b/cpp/include/raft/core/math.hpp index 405bf06f7b..c8e1a0000e 100644 --- a/cpp/include/raft/core/math.hpp +++ b/cpp/include/raft/core/math.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -17,7 +17,7 @@ #include #endif -namespace raft { +namespace RAFT_EXPORT raft { // Clang is pretty aggressive when instantiating templates, so we need host // functions for `__half` and `nv_bfloat16`, which are instantiated, but never @@ -702,4 +702,4 @@ RAFT_INLINE_FUNCTION auto sgn(T val) -> int #undef INSTANTIATED_BUT_NEVER_CALLED -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/mdarray.hpp b/cpp/include/raft/core/mdarray.hpp index fc1cd87b7a..a9f430b576 100644 --- a/cpp/include/raft/core/mdarray.hpp +++ b/cpp/include/raft/core/mdarray.hpp @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: Copyright (2019) Sandia Corporation - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause */ /* @@ -21,7 +21,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup mdarray_apis multi-dimensional memory-owning type @@ -357,4 +357,4 @@ auto reshape(const array_interface_type& mda, extents new /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/mdbuffer.cuh b/cpp/include/raft/core/mdbuffer.cuh index 405b313ac8..161db31e0c 100644 --- a/cpp/include/raft/core/mdbuffer.cuh +++ b/cpp/include/raft/core/mdbuffer.cuh @@ -6,6 +6,7 @@ #pragma once #include #include +#include #include #include #include @@ -33,7 +34,7 @@ #include #endif -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup mdbuffer_apis multi-dimensional maybe-owning type @@ -992,4 +993,4 @@ using enable_if_output_mdbuffer = std::enable_if_t>; /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/mdspan.hpp b/cpp/include/raft/core/mdspan.hpp index 795c13ce3b..e04040ffa2 100644 --- a/cpp/include/raft/core/mdspan.hpp +++ b/cpp/include/raft/core/mdspan.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -17,7 +17,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { template mds) /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/mdspan_types.hpp b/cpp/include/raft/core/mdspan_types.hpp index 2a0cc0530b..965e2514cb 100644 --- a/cpp/include/raft/core/mdspan_types.hpp +++ b/cpp/include/raft/core/mdspan_types.hpp @@ -1,13 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include -namespace raft { +namespace RAFT_EXPORT raft { using cuda::std::dynamic_extent; using cuda::std::extents; @@ -60,4 +62,4 @@ using extent_5d = cuda::std::extents; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/memory_type.hpp b/cpp/include/raft/core/memory_type.hpp index 9de9fa7dce..60c03ace16 100644 --- a/cpp/include/raft/core/memory_type.hpp +++ b/cpp/include/raft/core/memory_type.hpp @@ -1,8 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include #include #ifndef RAFT_DISABLE_CUDA @@ -15,7 +17,7 @@ #include #endif -namespace raft { +namespace RAFT_EXPORT raft { enum class memory_type : std::uint8_t { host = std::uint8_t{0}, pinned = std::uint8_t{1}, @@ -90,4 +92,4 @@ auto memory_type_from_pointer(T* ptr) #endif return result; } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/nvtx.hpp b/cpp/include/raft/core/nvtx.hpp index 002668e261..645688bb7a 100644 --- a/cpp/include/raft/core/nvtx.hpp +++ b/cpp/include/raft/core/nvtx.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include @@ -54,7 +55,8 @@ * } * \endcode */ -namespace raft::common::nvtx { +namespace RAFT_EXPORT raft { +namespace common::nvtx { namespace domain { @@ -142,4 +144,5 @@ class range { static auto operator new[](std::size_t) -> void* = delete; }; -} // namespace raft::common::nvtx +} // namespace common::nvtx +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/operators.cuh b/cpp/include/raft/core/operators.cuh index 74bab42c31..1f5e1d3fd8 100644 --- a/cpp/include/raft/core/operators.cuh +++ b/cpp/include/raft/core/operators.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,7 +8,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup DeviceFunctors Commonly used device-only functors. @@ -40,4 +40,4 @@ struct atomic_min_op { }; /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/operators.hpp b/cpp/include/raft/core/operators.hpp index bbd2688ee6..813f733b4a 100644 --- a/cpp/include/raft/core/operators.hpp +++ b/cpp/include/raft/core/operators.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,7 +16,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup operators Commonly used functors. @@ -423,4 +423,4 @@ struct map_args_op { }; /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/pinned_container_policy.hpp b/cpp/include/raft/core/pinned_container_policy.hpp index db2c13a38a..2714e74af1 100644 --- a/cpp/include/raft/core/pinned_container_policy.hpp +++ b/cpp/include/raft/core/pinned_container_policy.hpp @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -13,7 +14,7 @@ #include #endif -namespace raft { +namespace RAFT_EXPORT raft { #ifndef RAFT_DISABLE_CUDA /** * @brief A container policy for pinned mdarray. @@ -51,4 +52,4 @@ struct pinned_container_policy { template using pinned_container_policy = detail::fail_container_policy; #endif -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/pinned_mdarray.hpp b/cpp/include/raft/core/pinned_mdarray.hpp index f01f00f897..287430b69a 100644 --- a/cpp/include/raft/core/pinned_mdarray.hpp +++ b/cpp/include/raft/core/pinned_mdarray.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -12,7 +13,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief mdarray with pinned container policy @@ -139,4 +140,4 @@ auto make_pinned_vector(raft::resources const& handle, IndexType n) make_extents(n)); } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/pinned_mdspan.hpp b/cpp/include/raft/core/pinned_mdspan.hpp index 19349d9d4a..4aa4ce5ed7 100644 --- a/cpp/include/raft/core/pinned_mdspan.hpp +++ b/cpp/include/raft/core/pinned_mdspan.hpp @@ -1,17 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { template using pinned_accessor = host_device_accessor; @@ -255,4 +256,4 @@ auto constexpr make_pinned_mdspan(ElementType* ptr, extents(ptr, exts); } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/comms.hpp b/cpp/include/raft/core/resource/comms.hpp index 58e7cffd9f..fce72085ac 100644 --- a/cpp/include/raft/core/resource/comms.hpp +++ b/cpp/include/raft/core/resource/comms.hpp @@ -1,14 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class comms_resource : public resource { public: comms_resource(std::shared_ptr comnumicator) : communicator_(comnumicator) {} @@ -64,4 +66,5 @@ inline void set_comms(resources const& res, std::shared_ptr comm /** * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/cublas_handle.hpp b/cpp/include/raft/core/resource/cublas_handle.hpp index ba7443f708..bf31ed812d 100644 --- a/cpp/include/raft/core/resource/cublas_handle.hpp +++ b/cpp/include/raft/core/resource/cublas_handle.hpp @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class cublas_resource : public resource { public: @@ -70,4 +72,5 @@ inline cublasHandle_t get_cublas_handle(resources const& res) * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/cublaslt_handle.hpp b/cpp/include/raft/core/resource/cublaslt_handle.hpp index 074393b18b..4cd12c9aed 100644 --- a/cpp/include/raft/core/resource/cublaslt_handle.hpp +++ b/cpp/include/raft/core/resource/cublaslt_handle.hpp @@ -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 +#include #include #include @@ -12,7 +13,8 @@ #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class cublaslt_resource : public resource { public: @@ -55,4 +57,5 @@ inline auto get_cublaslt_handle(resources const& res) -> cublasLtHandle_t * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/cuda_event.hpp b/cpp/include/raft/core/resource/cuda_event.hpp index e893df3db2..c2a2df682f 100644 --- a/cpp/include/raft/core/resource/cuda_event.hpp +++ b/cpp/include/raft/core/resource/cuda_event.hpp @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class cuda_event_resource : public resource { public: @@ -25,4 +27,5 @@ class cuda_event_resource : public resource { private: cudaEvent_t event_; }; -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/cuda_stream.hpp b/cpp/include/raft/core/resource/cuda_stream.hpp index 690bd610f9..b66c16f199 100644 --- a/cpp/include/raft/core/resource/cuda_stream.hpp +++ b/cpp/include/raft/core/resource/cuda_stream.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -13,7 +14,8 @@ #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class cuda_stream_resource : public resource { public: cuda_stream_resource(rmm::cuda_stream_view stream_view = rmm::cuda_stream_per_thread) @@ -94,4 +96,5 @@ inline void sync_stream(const resources& res) { sync_stream(res, get_cuda_stream * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/cuda_stream_pool.hpp b/cpp/include/raft/core/resource/cuda_stream_pool.hpp index 0df76aa13f..ced93ab174 100644 --- a/cpp/include/raft/core/resource/cuda_stream_pool.hpp +++ b/cpp/include/raft/core/resource/cuda_stream_pool.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -14,7 +15,8 @@ #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class cuda_stream_pool_resource : public resource { public: @@ -178,4 +180,5 @@ inline void wait_stream_pool_on_stream(const resources& res) * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/cusolver_dn_handle.hpp b/cpp/include/raft/core/resource/cusolver_dn_handle.hpp index 66b09a108b..7d47998c84 100644 --- a/cpp/include/raft/core/resource/cusolver_dn_handle.hpp +++ b/cpp/include/raft/core/resource/cusolver_dn_handle.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -7,6 +7,7 @@ #include "cuda_stream.hpp" #include +#include #include #include @@ -14,7 +15,8 @@ #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { /** * @@ -74,4 +76,5 @@ inline cusolverDnHandle_t get_cusolver_dn_handle(resources const& res) * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/cusolver_sp_handle.hpp b/cpp/include/raft/core/resource/cusolver_sp_handle.hpp index 9568274ef0..44c3e193c1 100644 --- a/cpp/include/raft/core/resource/cusolver_sp_handle.hpp +++ b/cpp/include/raft/core/resource/cusolver_sp_handle.hpp @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { /** * @@ -71,4 +73,5 @@ inline cusolverSpHandle_t get_cusolver_sp_handle(resources const& res) * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/cusparse_handle.hpp b/cpp/include/raft/core/resource/cusparse_handle.hpp index 364f617e13..c3ed645e21 100644 --- a/cpp/include/raft/core/resource/cusparse_handle.hpp +++ b/cpp/include/raft/core/resource/cusparse_handle.hpp @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class cusparse_resource : public resource { public: cusparse_resource(rmm::cuda_stream_view stream) @@ -66,4 +68,5 @@ inline cusparseHandle_t get_cusparse_handle(resources const& res) * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/custom_resource.hpp b/cpp/include/raft/core/resource/custom_resource.hpp index bde81055d4..f9ced59320 100644 --- a/cpp/include/raft/core/resource/custom_resource.hpp +++ b/cpp/include/raft/core/resource/custom_resource.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include @@ -11,7 +12,8 @@ #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class custom_resource : public resource { public: @@ -79,4 +81,5 @@ auto get_custom_resource(resources const& res) -> ResourceT* * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/detail/stream_sync_event.hpp b/cpp/include/raft/core/resource/detail/stream_sync_event.hpp index d34e60fe72..e3109ea59e 100644 --- a/cpp/include/raft/core/resource/detail/stream_sync_event.hpp +++ b/cpp/include/raft/core/resource/detail/stream_sync_event.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -11,7 +12,8 @@ #include -namespace raft::resource::detail { +namespace RAFT_EXPORT raft { +namespace resource::detail { /** * Factory that knows how to construct a specific raft::resource to populate @@ -37,4 +39,5 @@ inline cudaEvent_t& get_cuda_stream_sync_event(resources const& res) return *res.get_resource(resource_type::CUDA_STREAM_SYNC_EVENT); }; -} // namespace raft::resource::detail +} // namespace resource::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/device_id.hpp b/cpp/include/raft/core/resource/device_id.hpp index e710f28b89..16d29c4b39 100644 --- a/cpp/include/raft/core/resource/device_id.hpp +++ b/cpp/include/raft/core/resource/device_id.hpp @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class device_id_resource : public resource { public: @@ -62,4 +64,5 @@ inline int get_device_id(resources const& res) /** * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/device_memory_resource.hpp b/cpp/include/raft/core/resource/device_memory_resource.hpp index 17c929aae9..8cab2df92c 100644 --- a/cpp/include/raft/core/resource/device_memory_resource.hpp +++ b/cpp/include/raft/core/resource/device_memory_resource.hpp @@ -4,6 +4,7 @@ */ #pragma once +#include #include #include #include @@ -20,7 +21,8 @@ #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { /** * \defgroup device_memory_resource Device memory resources @@ -320,4 +322,5 @@ inline void set_large_workspace_resource(resources const& res, raft::mr::device_ /** @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/device_properties.hpp b/cpp/include/raft/core/resource/device_properties.hpp index 5bdab71d79..d702d42d08 100644 --- a/cpp/include/raft/core/resource/device_properties.hpp +++ b/cpp/include/raft/core/resource/device_properties.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -11,7 +12,8 @@ #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class device_properties_resource : public resource { public: @@ -64,4 +66,5 @@ inline cudaDeviceProp& get_device_properties(resources const& res) /** * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/managed_memory_resource.hpp b/cpp/include/raft/core/resource/managed_memory_resource.hpp index 171d0b4cd4..a629cd7172 100644 --- a/cpp/include/raft/core/resource/managed_memory_resource.hpp +++ b/cpp/include/raft/core/resource/managed_memory_resource.hpp @@ -4,13 +4,15 @@ */ #pragma once +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { /** * @defgroup managed_memory_resource Managed memory resource @@ -77,4 +79,5 @@ inline void set_managed_memory_resource(resources const& res, raft::mr::host_dev /** @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/multi_gpu.hpp b/cpp/include/raft/core/resource/multi_gpu.hpp index 841743e222..ce26dbe6a1 100644 --- a/cpp/include/raft/core/resource/multi_gpu.hpp +++ b/cpp/include/raft/core/resource/multi_gpu.hpp @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class multi_gpu_resource : public resource { public: @@ -124,4 +126,5 @@ inline void set_root_rank(resources const& res, int root_rank) root_rank_ = root_rank; }; -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/nccl_comm.hpp b/cpp/include/raft/core/resource/nccl_comm.hpp index 885112c571..6150da84ba 100644 --- a/cpp/include/raft/core/resource/nccl_comm.hpp +++ b/cpp/include/raft/core/resource/nccl_comm.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #include @@ -12,7 +13,8 @@ #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class nccl_comm_resource : public resource { public: @@ -96,4 +98,5 @@ inline ncclComm_t& get_nccl_comm_for_rank(const resources& res, int rank) * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/pinned_memory_resource.hpp b/cpp/include/raft/core/resource/pinned_memory_resource.hpp index fda7af292e..1e676a54fa 100644 --- a/cpp/include/raft/core/resource/pinned_memory_resource.hpp +++ b/cpp/include/raft/core/resource/pinned_memory_resource.hpp @@ -4,13 +4,15 @@ */ #pragma once +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { /** * @defgroup pinned_memory_resource Pinned memory resource @@ -75,4 +77,5 @@ inline void set_pinned_memory_resource(resources const& res, raft::mr::host_devi /** @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/resource_types.hpp b/cpp/include/raft/core/resource/resource_types.hpp index cda3c8ecae..e3af719eda 100644 --- a/cpp/include/raft/core/resource/resource_types.hpp +++ b/cpp/include/raft/core/resource/resource_types.hpp @@ -5,7 +5,9 @@ #pragma once -namespace raft::resource { +#include +namespace RAFT_EXPORT raft { +namespace resource { /** * @defgroup resource_types Core resource vocabulary types @@ -113,4 +115,5 @@ class empty_resource_factory : public resource_factory { * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/stream_view.hpp b/cpp/include/raft/core/resource/stream_view.hpp index b2df678220..c50706e638 100644 --- a/cpp/include/raft/core/resource/stream_view.hpp +++ b/cpp/include/raft/core/resource/stream_view.hpp @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #ifndef RAFT_DISABLE_CUDA #include #endif -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { struct stream_view_resource : public resource { stream_view_resource(raft::stream_view view = raft::stream_view_per_thread) : stream(view) {} void* get_resource() override { return &stream; } @@ -87,4 +89,5 @@ inline void sync_stream_view(const resources& res) { sync_stream_view(res, get_s * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/sub_comms.hpp b/cpp/include/raft/core/resource/sub_comms.hpp index 9feec30105..d1d07036bb 100644 --- a/cpp/include/raft/core/resource/sub_comms.hpp +++ b/cpp/include/raft/core/resource/sub_comms.hpp @@ -1,14 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class sub_comms_resource : public resource { public: sub_comms_resource() : communicators_() {} @@ -68,4 +70,5 @@ inline void set_subcomm(resources const& res, * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resource/thrust_policy.hpp b/cpp/include/raft/core/resource/thrust_policy.hpp index 93a68fcec3..4257cdc6ac 100644 --- a/cpp/include/raft/core/resource/thrust_policy.hpp +++ b/cpp/include/raft/core/resource/thrust_policy.hpp @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::resource { +namespace RAFT_EXPORT raft { +namespace resource { class thrust_policy_resource : public resource { public: thrust_policy_resource(rmm::cuda_stream_view stream_view) @@ -62,4 +64,5 @@ inline rmm::exec_policy_nosync& get_thrust_policy(resources const& res) * @} */ -} // namespace raft::resource +} // namespace resource +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/resources.hpp b/cpp/include/raft/core/resources.hpp index dbf1c701ee..a512e10179 100644 --- a/cpp/include/raft/core/resources.hpp +++ b/cpp/include/raft/core/resources.hpp @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include "resource/resource_types.hpp" +#include #include // RAFT_EXPECTS #include @@ -14,7 +15,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief Resource container which allows lazy-loading and registration @@ -126,4 +127,4 @@ class resources { mutable std::vector factories_; mutable std::vector resources_; }; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/serialize.hpp b/cpp/include/raft/core/serialize.hpp index d84e8d16f0..410faaeef0 100644 --- a/cpp/include/raft/core/serialize.hpp +++ b/cpp/include/raft/core/serialize.hpp @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -19,7 +20,7 @@ * Collection of serialization functions for RAFT data types */ -namespace raft { +namespace RAFT_EXPORT raft { template inline void serialize_mdspan( @@ -155,4 +156,4 @@ inline T deserialize_scalar(const raft::resources&, std::istream& is) return detail::numpy_serializer::deserialize_scalar(is); } -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/span.hpp b/cpp/include/raft/core/span.hpp index cfd9adf739..45e210af7c 100644 --- a/cpp/include/raft/core/span.hpp +++ b/cpp/include/raft/core/span.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -16,7 +16,7 @@ #include // std::byte #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup span one-dimensional span type @@ -267,4 +267,4 @@ auto as_writable_bytes(span s) noexcept /* @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/sparse_types.hpp b/cpp/include/raft/core/sparse_types.hpp index c0de7ca673..1657a8e494 100644 --- a/cpp/include/raft/core/sparse_types.hpp +++ b/cpp/include/raft/core/sparse_types.hpp @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * \defgroup sparse_types Sparse API vocabulary @@ -210,4 +211,4 @@ class sparse_matrix { /* @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/stream_view.hpp b/cpp/include/raft/core/stream_view.hpp index 8737887abe..d7ec816208 100644 --- a/cpp/include/raft/core/stream_view.hpp +++ b/cpp/include/raft/core/stream_view.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #ifndef RAFT_DISABLE_CUDA @@ -12,7 +13,7 @@ #include #endif -namespace raft { +namespace RAFT_EXPORT raft { namespace detail { struct fail_stream_view { @@ -96,4 +97,4 @@ struct stream_view { auto static const stream_view_per_thread = stream_view{}; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/temporary_device_buffer.hpp b/cpp/include/raft/core/temporary_device_buffer.hpp index 4bd43c4437..7bea49bf5d 100644 --- a/cpp/include/raft/core/temporary_device_buffer.hpp +++ b/cpp/include/raft/core/temporary_device_buffer.hpp @@ -8,12 +8,13 @@ #include "device_mdarray.hpp" #include "device_mdspan.hpp" +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * \defgroup temporary_device_buffer `raft::temporary_device_buffer` @@ -262,4 +263,4 @@ auto make_writeback_temporary_device_buffer(raft::resources const& handle, /**@}*/ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/type_traits.hpp b/cpp/include/raft/core/type_traits.hpp index ff3712b940..751d218f73 100644 --- a/cpp/include/raft/core/type_traits.hpp +++ b/cpp/include/raft/core/type_traits.hpp @@ -1,14 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * Extension of std::is_floating_point to support CUDA types like __half. @@ -21,4 +23,4 @@ struct is_floating_point { template inline constexpr bool is_floating_point_v = is_floating_point::value; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/core/types.hpp b/cpp/include/raft/core/types.hpp index 5df47cf011..1f3d6cdc34 100644 --- a/cpp/include/raft/core/types.hpp +++ b/cpp/include/raft/core/types.hpp @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft { +#include +namespace RAFT_EXPORT raft { /** * @brief Enum for reduction/broadcast where an operation is to be performed along @@ -14,4 +15,4 @@ namespace raft { */ enum class Apply { ALONG_ROWS, ALONG_COLUMNS }; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/label/classlabels.cuh b/cpp/include/raft/label/classlabels.cuh index 6e299182da..de66756bc5 100644 --- a/cpp/include/raft/label/classlabels.cuh +++ b/cpp/include/raft/label/classlabels.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __CLASS_LABELS_H @@ -7,9 +7,10 @@ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace label { /** @@ -105,6 +106,5 @@ void make_monotonic(Type* out, Type* in, size_t N, cudaStream_t stream, bool zer detail::make_monotonic(out, in, N, stream, zero_based); } }; // namespace label -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/label/detail/classlabels.cuh b/cpp/include/raft/label/detail/classlabels.cuh index 8b0a296eb3..a3991f6cae 100644 --- a/cpp/include/raft/label/detail/classlabels.cuh +++ b/cpp/include/raft/label/detail/classlabels.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -18,7 +19,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace label { namespace detail { @@ -191,4 +192,4 @@ void make_monotonic(Type* out, Type* in, size_t N, cudaStream_t stream, bool zer }; // namespace detail }; // namespace label -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/label/detail/merge_labels.cuh b/cpp/include/raft/label/detail/merge_labels.cuh index 168f010733..2c47ca4419 100644 --- a/cpp/include/raft/label/detail/merge_labels.cuh +++ b/cpp/include/raft/label/detail/merge_labels.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -13,7 +14,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace label { namespace detail { @@ -144,4 +145,4 @@ void merge_labels(value_idx* labels_a, } // namespace detail }; // namespace label -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/label/merge_labels.cuh b/cpp/include/raft/label/merge_labels.cuh index b0fafe9cbe..549aedf37f 100644 --- a/cpp/include/raft/label/merge_labels.cuh +++ b/cpp/include/raft/label/merge_labels.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,9 +8,10 @@ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace label { /** @@ -55,6 +56,5 @@ void merge_labels(value_idx* labels_a, } }; // namespace label -}; // namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/add.cuh b/cpp/include/raft/linalg/add.cuh index b1953470b0..09b7c3b23e 100644 --- a/cpp/include/raft/linalg/add.cuh +++ b/cpp/include/raft/linalg/add.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __ADD_H @@ -9,12 +9,13 @@ #include "detail/add.cuh" +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -192,6 +193,6 @@ void add_scalar(raft::resources const& handle, /** @} */ // end of group add }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/axpy.cuh b/cpp/include/raft/linalg/axpy.cuh index 6a9437dbff..d18fe89336 100644 --- a/cpp/include/raft/linalg/axpy.cuh +++ b/cpp/include/raft/linalg/axpy.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __AXPY_H @@ -9,11 +9,13 @@ #include "detail/axpy.cuh" +#include #include #include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @brief the wrapper of cublas axpy function @@ -111,6 +113,7 @@ void axpy(raft::resources const& handle, /** @} */ // end of group axpy -} // namespace raft::linalg +} // namespace linalg +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/binary_op.cuh b/cpp/include/raft/linalg/binary_op.cuh index 39ba56c9dd..059278be74 100644 --- a/cpp/include/raft/linalg/binary_op.cuh +++ b/cpp/include/raft/linalg/binary_op.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __BINARY_OP_H @@ -7,11 +7,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -72,6 +73,6 @@ void binary_op(raft::resources const& handle, InType in1, InType in2, OutType ou /** @} */ // end of group binary_op }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/cholesky_r1_update.cuh b/cpp/include/raft/linalg/cholesky_r1_update.cuh index 751ca64df0..432af89d02 100644 --- a/cpp/include/raft/linalg/cholesky_r1_update.cuh +++ b/cpp/include/raft/linalg/cholesky_r1_update.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __CHOLESKY_R1_UPDATE_H @@ -9,9 +9,10 @@ #include "detail/cholesky_r1_update.cuh" +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -126,6 +127,6 @@ void choleskyRank1Update(raft::resources const& handle, } }; // namespace linalg -}; // namespace raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/coalesced_reduction.cuh b/cpp/include/raft/linalg/coalesced_reduction.cuh index 3ed5ed7736..36b1a9e78a 100644 --- a/cpp/include/raft/linalg/coalesced_reduction.cuh +++ b/cpp/include/raft/linalg/coalesced_reduction.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __COALESCED_REDUCTION_H @@ -9,12 +9,13 @@ #include "detail/coalesced_reduction.cuh" +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -150,6 +151,6 @@ void coalesced_reduction(raft::resources const& handle, /** @} */ // end of group coalesced_reduction }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/contractions.cuh b/cpp/include/raft/linalg/contractions.cuh index ebec051721..f6f33eb4e7 100644 --- a/cpp/include/raft/linalg/contractions.cuh +++ b/cpp/include/raft/linalg/contractions.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __CONTRACTIONS_H @@ -9,7 +9,9 @@ #include "detail/contractions.cuh" -namespace raft { +#include + +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -236,6 +238,6 @@ struct Policy2x8 { using detail::Contractions_NT; } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/detail/add.cuh b/cpp/include/raft/linalg/detail/add.cuh index f7dfbaa5dd..5f361ed3e7 100644 --- a/cpp/include/raft/linalg/detail/add.cuh +++ b/cpp/include/raft/linalg/detail/add.cuh @@ -1,16 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -49,4 +50,4 @@ void addDevScalar( } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/axpy.cuh b/cpp/include/raft/linalg/detail/axpy.cuh index 1ab690937d..c52b962e22 100644 --- a/cpp/include/raft/linalg/detail/axpy.cuh +++ b/cpp/include/raft/linalg/detail/axpy.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,12 +7,14 @@ #include "cublas_wrappers.hpp" +#include #include #include #include -namespace raft::linalg::detail { +namespace RAFT_EXPORT raft { +namespace linalg::detail { template void axpy(raft::resources const& handle, @@ -29,4 +31,5 @@ void axpy(raft::resources const& handle, RAFT_CUBLAS_TRY(cublasaxpy(cublas_h, n, alpha, x, incx, y, incy, stream)); } -} // namespace raft::linalg::detail +} // namespace linalg::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/cholesky_r1_update.cuh b/cpp/include/raft/linalg/detail/cholesky_r1_update.cuh index b05449f90a..f8c8dfa656 100644 --- a/cpp/include/raft/linalg/detail/cholesky_r1_update.cuh +++ b/cpp/include/raft/linalg/detail/cholesky_r1_update.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,12 +8,13 @@ #include "cublas_wrappers.hpp" #include "cusolver_wrappers.hpp" +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -120,4 +121,4 @@ void choleskyRank1Update(raft::resources const& handle, } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/coalesced_reduction-inl.cuh b/cpp/include/raft/linalg/detail/coalesced_reduction-inl.cuh index 2d513b433d..f59fe1307f 100644 --- a/cpp/include/raft/linalg/detail/coalesced_reduction-inl.cuh +++ b/cpp/include/raft/linalg/detail/coalesced_reduction-inl.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -13,7 +14,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -613,4 +614,4 @@ void coalescedReduction(OutType* dots, } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/contractions.cuh b/cpp/include/raft/linalg/detail/contractions.cuh index 43573ddd78..b6e2c84cf3 100644 --- a/cpp/include/raft/linalg/detail/contractions.cuh +++ b/cpp/include/raft/linalg/detail/contractions.cuh @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -309,4 +310,4 @@ struct Contractions_NT { } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/cublas_wrappers.hpp b/cpp/include/raft/linalg/detail/cublas_wrappers.hpp index 6b94aedff6..6baafdb8b6 100644 --- a/cpp/include/raft/linalg/detail/cublas_wrappers.hpp +++ b/cpp/include/raft/linalg/detail/cublas_wrappers.hpp @@ -1,18 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -1023,4 +1024,4 @@ inline cublasStatus_t cublasscal( } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/cublaslt_wrappers.hpp b/cpp/include/raft/linalg/detail/cublaslt_wrappers.hpp index 469780ba1f..bfdd75e8cd 100644 --- a/cpp/include/raft/linalg/detail/cublaslt_wrappers.hpp +++ b/cpp/include/raft/linalg/detail/cublaslt_wrappers.hpp @@ -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 +#include #include #include #include @@ -19,7 +20,8 @@ #include -namespace raft::linalg::detail { +namespace RAFT_EXPORT raft { +namespace linalg::detail { /** Get the cublas compute type for the combination of input types. */ template @@ -370,4 +372,5 @@ void matmul(raft::resources const& res, resource::get_cuda_stream(res)); } -} // namespace raft::linalg::detail +} // namespace linalg::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/cusolver_wrappers.hpp b/cpp/include/raft/linalg/detail/cusolver_wrappers.hpp index a6a05d1e6f..10bb5306ab 100644 --- a/cpp/include/raft/linalg/detail/cusolver_wrappers.hpp +++ b/cpp/include/raft/linalg/detail/cusolver_wrappers.hpp @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include @@ -13,7 +14,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -1519,4 +1520,4 @@ inline cusolverStatus_t cusolverDnxsyevd( // NOLINT } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/divide.cuh b/cpp/include/raft/linalg/detail/divide.cuh index 82afd5e7c8..00a59e0942 100644 --- a/cpp/include/raft/linalg/detail/divide.cuh +++ b/cpp/include/raft/linalg/detail/divide.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -21,4 +22,4 @@ void divideScalar(OutT* out, const InT* in, InT scalar, IdxType len, cudaStream_ }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/eig.cuh b/cpp/include/raft/linalg/detail/eig.cuh index 5b64add128..39ad2589a5 100644 --- a/cpp/include/raft/linalg/detail/eig.cuh +++ b/cpp/include/raft/linalg/detail/eig.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,7 @@ #include "cusolver_wrappers.hpp" +#include #include #include #include @@ -19,7 +20,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -305,4 +306,4 @@ void eigJacobi(raft::resources const& handle, } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/eltwise.cuh b/cpp/include/raft/linalg/detail/eltwise.cuh index 1cc8b4baca..e317a5adac 100644 --- a/cpp/include/raft/linalg/detail/eltwise.cuh +++ b/cpp/include/raft/linalg/detail/eltwise.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -62,4 +63,4 @@ void eltwiseDivideCheckZero( }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/gemm.cuh b/cpp/include/raft/linalg/detail/gemm.cuh index f3bfdf03d4..c0cb930e53 100644 --- a/cpp/include/raft/linalg/detail/gemm.cuh +++ b/cpp/include/raft/linalg/detail/gemm.cuh @@ -6,9 +6,11 @@ #include "cublaslt_wrappers.hpp" +#include #include -namespace raft::linalg::detail { +namespace RAFT_EXPORT raft { +namespace linalg::detail { template void legacy_gemm(raft::resources const& res, @@ -135,4 +137,5 @@ void legacy_gemm(raft::resources const& res, } } -} // namespace raft::linalg::detail +} // namespace linalg::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/gemv.hpp b/cpp/include/raft/linalg/detail/gemv.hpp index 3233940a66..e9ad06e6fa 100644 --- a/cpp/include/raft/linalg/detail/gemv.hpp +++ b/cpp/include/raft/linalg/detail/gemv.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,12 +7,13 @@ #include "cublas_wrappers.hpp" +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -133,4 +134,4 @@ void gemv(raft::resources const& handle, }; // namespace detail }; // namespace linalg -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/lstsq.cuh b/cpp/include/raft/linalg/detail/lstsq.cuh index 176c7763ba..4a5c50df5e 100644 --- a/cpp/include/raft/linalg/detail/lstsq.cuh +++ b/cpp/include/raft/linalg/detail/lstsq.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -24,7 +25,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -442,4 +443,4 @@ void lstsqQR(raft::resources const& handle, } }; // namespace detail }; // namespace linalg -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/map.cuh b/cpp/include/raft/linalg/detail/map.cuh index 3153de5396..d4e13e0dc9 100644 --- a/cpp/include/raft/linalg/detail/map.cuh +++ b/cpp/include/raft/linalg/detail/map.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -19,7 +20,8 @@ #include -namespace raft::linalg::detail { +namespace RAFT_EXPORT raft { +namespace linalg::detail { template __device__ __forceinline__ auto map_apply(Func f, const IdxT& offset, const InTs&... ins) -> OutT @@ -220,4 +222,5 @@ void map(const raft::resources& res, OutType out, Func f, InTypes... ins) ins.data_handle()...); } -} // namespace raft::linalg::detail +} // namespace linalg::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/map_then_reduce.cuh b/cpp/include/raft/linalg/detail/map_then_reduce.cuh index e6016ad189..7a224aa084 100644 --- a/cpp/include/raft/linalg/detail/map_then_reduce.cuh +++ b/cpp/include/raft/linalg/detail/map_then_reduce.cuh @@ -5,13 +5,14 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -85,4 +86,4 @@ void mapThenReduceImpl(OutType* out, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/matrix_vector_op.cuh b/cpp/include/raft/linalg/detail/matrix_vector_op.cuh index 64de01a3fe..936b01c211 100644 --- a/cpp/include/raft/linalg/detail/matrix_vector_op.cuh +++ b/cpp/include/raft/linalg/detail/matrix_vector_op.cuh @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -90,4 +91,4 @@ void matrixVectorOp(MatT* out, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/mean_squared_error.cuh b/cpp/include/raft/linalg/detail/mean_squared_error.cuh index b0affa990a..9d266d4cc5 100644 --- a/cpp/include/raft/linalg/detail/mean_squared_error.cuh +++ b/cpp/include/raft/linalg/detail/mean_squared_error.cuh @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -24,4 +25,4 @@ void meanSquaredError( }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/multiply.cuh b/cpp/include/raft/linalg/detail/multiply.cuh index 52e20ee9dd..a5fdb00057 100644 --- a/cpp/include/raft/linalg/detail/multiply.cuh +++ b/cpp/include/raft/linalg/detail/multiply.cuh @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -21,4 +22,4 @@ void multiplyScalar( }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/norm.cuh b/cpp/include/raft/linalg/detail/norm.cuh index ea7f5c8d28..3eadddcccf 100644 --- a/cpp/include/raft/linalg/detail/norm.cuh +++ b/cpp/include/raft/linalg/detail/norm.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -61,4 +62,4 @@ void colNormCaller( }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/normalize.cuh b/cpp/include/raft/linalg/detail/normalize.cuh index ab9bccaa9b..f7af638e3c 100644 --- a/cpp/include/raft/linalg/detail/normalize.cuh +++ b/cpp/include/raft/linalg/detail/normalize.cuh @@ -5,11 +5,12 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -175,4 +176,4 @@ void coalesced_normalize(Type* out, } // namespace detail } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/pca.cuh b/cpp/include/raft/linalg/detail/pca.cuh index d3d34c5549..1c2504bfd1 100644 --- a/cpp/include/raft/linalg/detail/pca.cuh +++ b/cpp/include/raft/linalg/detail/pca.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -25,7 +26,8 @@ #include -namespace raft::linalg::detail { +namespace RAFT_EXPORT raft { +namespace linalg::detail { template void trunc_comp_exp_vars(raft::resources const& handle, @@ -318,4 +320,5 @@ void pca_fit_transform(raft::resources const& handle, detail::pca_transform(handle, prms, input, components, singular_vals, mu, trans_input); } -}; // end namespace raft::linalg::detail +}; // end namespace linalg::detail +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/qr.cuh b/cpp/include/raft/linalg/detail/qr.cuh index 63cba5d73c..91652d6769 100644 --- a/cpp/include/raft/linalg/detail/qr.cuh +++ b/cpp/include/raft/linalg/detail/qr.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #include "cublas_wrappers.hpp" #include "cusolver_wrappers.hpp" +#include #include #include #include @@ -17,7 +18,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -150,4 +151,4 @@ void qrGetQR(raft::resources const& handle, }; // namespace detail }; // namespace linalg -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/reduce.cuh b/cpp/include/raft/linalg/detail/reduce.cuh index 4d90e32e99..c1f8273bb6 100644 --- a/cpp/include/raft/linalg/detail/reduce.cuh +++ b/cpp/include/raft/linalg/detail/reduce.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -49,4 +50,4 @@ void reduce(OutType* dots, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/reduce_cols_by_key.cuh b/cpp/include/raft/linalg/detail/reduce_cols_by_key.cuh index c6568a26d3..051c2a49a5 100644 --- a/cpp/include/raft/linalg/detail/reduce_cols_by_key.cuh +++ b/cpp/include/raft/linalg/detail/reduce_cols_by_key.cuh @@ -5,13 +5,14 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -129,4 +130,4 @@ void reduce_cols_by_key(const T* data, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/reduce_rows_by_key.cuh b/cpp/include/raft/linalg/detail/reduce_rows_by_key.cuh index 309d79cf90..59703d315a 100644 --- a/cpp/include/raft/linalg/detail/reduce_rows_by_key.cuh +++ b/cpp/include/raft/linalg/detail/reduce_rows_by_key.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include @@ -13,7 +14,7 @@ #include #define MAX_BLOCKS 65535u -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -399,4 +400,4 @@ void reduce_rows_by_key(const DataIteratorT d_A, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/rsvd.cuh b/cpp/include/raft/linalg/detail/rsvd.cuh index 9dcdd1ed14..f9b581adaa 100644 --- a/cpp/include/raft/linalg/detail/rsvd.cuh +++ b/cpp/include/raft/linalg/detail/rsvd.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -24,7 +25,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -502,4 +503,4 @@ void rsvdPerc(raft::resources const& handle, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/strided_reduction.cuh b/cpp/include/raft/linalg/detail/strided_reduction.cuh index 2c820fba83..b2f7f334d7 100644 --- a/cpp/include/raft/linalg/detail/strided_reduction.cuh +++ b/cpp/include/raft/linalg/detail/strided_reduction.cuh @@ -5,13 +5,14 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -178,4 +179,4 @@ void stridedReduction(OutType* dots, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/subtract.cuh b/cpp/include/raft/linalg/detail/subtract.cuh index 72734ce03a..4b91c5e841 100644 --- a/cpp/include/raft/linalg/detail/subtract.cuh +++ b/cpp/include/raft/linalg/detail/subtract.cuh @@ -1,16 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -54,4 +55,4 @@ void subtractDevScalar(math_t* outDev, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/svd.cuh b/cpp/include/raft/linalg/detail/svd.cuh index ba831822d7..0dc896069a 100644 --- a/cpp/include/raft/linalg/detail/svd.cuh +++ b/cpp/include/raft/linalg/detail/svd.cuh @@ -8,6 +8,7 @@ #include "cublas_wrappers.hpp" #include "cusolver_wrappers.hpp" +#include #include #include #include @@ -27,7 +28,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -332,4 +333,4 @@ bool evaluateSVDByL2Norm(raft::resources const& handle, }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/transpose.cuh b/cpp/include/raft/linalg/detail/transpose.cuh index 9efac50763..b7049434a7 100644 --- a/cpp/include/raft/linalg/detail/transpose.cuh +++ b/cpp/include/raft/linalg/detail/transpose.cuh @@ -7,6 +7,7 @@ #include "cublas_wrappers.hpp" +#include #include #include #include @@ -19,7 +20,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { namespace detail { @@ -268,4 +269,4 @@ void transpose_col_major_impl( }; // end namespace detail }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/detail/tsvd.cuh b/cpp/include/raft/linalg/detail/tsvd.cuh index 8c6ba4cbfe..8a8b3e4b7d 100644 --- a/cpp/include/raft/linalg/detail/tsvd.cuh +++ b/cpp/include/raft/linalg/detail/tsvd.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -37,7 +38,8 @@ #include #include -namespace raft::linalg::detail { +namespace RAFT_EXPORT raft { +namespace linalg::detail { template void cal_comp_exp_vars_svd(raft::resources const& handle, @@ -518,4 +520,5 @@ void tsvd_fit_transform(raft::resources const& handle, explained_var_ratio.data_handle(), explained_var.data_handle(), scalar, n_components, stream); } -}; // end namespace raft::linalg::detail +}; // end namespace linalg::detail +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/divide.cuh b/cpp/include/raft/linalg/divide.cuh index 69600f016c..176cca7c46 100644 --- a/cpp/include/raft/linalg/divide.cuh +++ b/cpp/include/raft/linalg/divide.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __DIVIDE_H @@ -9,12 +9,13 @@ #include "detail/divide.cuh" +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -79,6 +80,6 @@ void divide_scalar(raft::resources const& handle, /** @} */ // end of group add }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/dot.cuh b/cpp/include/raft/linalg/dot.cuh index af40c07459..d2b5085414 100644 --- a/cpp/include/raft/linalg/dot.cuh +++ b/cpp/include/raft/linalg/dot.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __DOT_H @@ -7,6 +7,7 @@ #pragma once +#include #include #include #include @@ -14,7 +15,8 @@ #include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @defgroup dot BLAS dot routine @@ -83,5 +85,6 @@ void dot(raft::resources const& handle, /** @} */ // end of group dot -} // namespace raft::linalg +} // namespace linalg +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/eig.cuh b/cpp/include/raft/linalg/eig.cuh index f7bb54158c..bec4b29a41 100644 --- a/cpp/include/raft/linalg/eig.cuh +++ b/cpp/include/raft/linalg/eig.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __EIG_H @@ -9,10 +9,11 @@ #include "detail/eig.cuh" +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -210,6 +211,6 @@ void eig_jacobi(raft::resources const& handle, /** @} */ // end of eig }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/eltwise.cuh b/cpp/include/raft/linalg/eltwise.cuh index 59c2015258..72a739fdce 100644 --- a/cpp/include/raft/linalg/eltwise.cuh +++ b/cpp/include/raft/linalg/eltwise.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __ELTWISE_H @@ -9,7 +9,9 @@ #include "detail/eltwise.cuh" -namespace raft { +#include + +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -84,6 +86,6 @@ void eltwiseDivideCheckZero( /** @} */ }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/gemm.cuh b/cpp/include/raft/linalg/gemm.cuh index fe2ce5ff5e..93ec0f09d6 100644 --- a/cpp/include/raft/linalg/gemm.cuh +++ b/cpp/include/raft/linalg/gemm.cuh @@ -10,6 +10,7 @@ #include "detail/cublaslt_wrappers.hpp" #include "detail/gemm.cuh" +#include #include #include #include @@ -18,7 +19,8 @@ #include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @brief the wrapper of cublas gemm function @@ -283,6 +285,7 @@ void gemm(raft::resources const& res, /** @} */ // end of gemm -} // namespace raft::linalg +} // namespace linalg +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/gemv.cuh b/cpp/include/raft/linalg/gemv.cuh index 415e2a3769..5cd16895f1 100644 --- a/cpp/include/raft/linalg/gemv.cuh +++ b/cpp/include/raft/linalg/gemv.cuh @@ -9,6 +9,7 @@ #include "detail/gemv.hpp" +#include #include #include #include @@ -16,7 +17,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -295,5 +296,5 @@ void gemv(raft::resources const& handle, /** @} */ // end of gemv }; // namespace linalg -}; // namespace raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/init.cuh b/cpp/include/raft/linalg/init.cuh index f20d071336..d336a4ebe8 100644 --- a/cpp/include/raft/linalg/init.cuh +++ b/cpp/include/raft/linalg/init.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __INIT_H @@ -7,10 +7,12 @@ #pragma once +#include #include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @brief Like Python range. @@ -57,6 +59,7 @@ void zero(T* out, int n, cudaStream_t stream) RAFT_CUDA_TRY(cudaMemsetAsync(static_cast(out), 0, n * sizeof(T), stream)); } -} // namespace raft::linalg +} // namespace linalg +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/linalg_types.hpp b/cpp/include/raft/linalg/linalg_types.hpp index 620f175ff6..453b71f13e 100644 --- a/cpp/include/raft/linalg/linalg_types.hpp +++ b/cpp/include/raft/linalg/linalg_types.hpp @@ -1,11 +1,13 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft::linalg { +#include +namespace RAFT_EXPORT raft { +namespace linalg { /** * @brief Enum for reduction/broadcast where an operation is to be performed along @@ -21,4 +23,5 @@ enum class FillMode { UPPER, LOWER }; */ enum class Operation { NON_TRANSPOSE, TRANSPOSE }; -} // end namespace raft::linalg +} // namespace linalg +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/lstsq.cuh b/cpp/include/raft/linalg/lstsq.cuh index cd7685fd25..0db49f8930 100644 --- a/cpp/include/raft/linalg/lstsq.cuh +++ b/cpp/include/raft/linalg/lstsq.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __LSTSQ_H @@ -7,10 +7,11 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** Solves the linear ordinary least squares problem `Aw = b` @@ -235,6 +236,6 @@ void lstsq_qr(raft::resources const& handle, /** @} */ // end of lstsq }; // namespace linalg -}; // namespace raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/map.cuh b/cpp/include/raft/linalg/map.cuh index 2f681493c8..a161a5892b 100644 --- a/cpp/include/raft/linalg/map.cuh +++ b/cpp/include/raft/linalg/map.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MAP_H @@ -9,10 +9,12 @@ #include "detail/map.cuh" +#include #include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @brief CUDA version of map @@ -300,6 +302,7 @@ void map_offset( /** @} */ // end of map -} // namespace raft::linalg +} // namespace linalg +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/map_reduce.cuh b/cpp/include/raft/linalg/map_reduce.cuh index e5176dda01..1fed50a386 100644 --- a/cpp/include/raft/linalg/map_reduce.cuh +++ b/cpp/include/raft/linalg/map_reduce.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MAP_REDUCE_H @@ -9,10 +9,12 @@ #include "detail/map_then_reduce.cuh" +#include #include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @brief CUDA version of map and then generic reduction operation @@ -102,6 +104,7 @@ void map_reduce(raft::resources const& handle, /** @} */ // end of map_reduce -} // end namespace raft::linalg +} // namespace linalg +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/map_then_reduce.cuh b/cpp/include/raft/linalg/map_then_reduce.cuh index 275854cff6..b7b7d790e4 100644 --- a/cpp/include/raft/linalg/map_then_reduce.cuh +++ b/cpp/include/raft/linalg/map_then_reduce.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MAP_THEN_REDUCE_H @@ -9,7 +9,9 @@ #include "detail/map_then_reduce.cuh" -namespace raft { +#include + +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -78,6 +80,6 @@ template #include #include #include #include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @defgroup matrix_vector Matrix-Vector Operations @@ -198,4 +200,5 @@ void binary_sub(raft::resources const& handle, /** @} */ // end of matrix_vector -} // namespace raft::linalg +} // namespace linalg +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/matrix_vector_op.cuh b/cpp/include/raft/linalg/matrix_vector_op.cuh index 47a3cd9ce8..d689c9c69d 100644 --- a/cpp/include/raft/linalg/matrix_vector_op.cuh +++ b/cpp/include/raft/linalg/matrix_vector_op.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MATRIX_VECTOR_OP_H @@ -10,13 +10,14 @@ #include "detail/matrix_vector_op.cuh" #include "linalg_types.hpp" +#include #include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -234,6 +235,6 @@ void matrix_vector_op(raft::resources const& handle, /** @} */ // end of group matrix_vector_op }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/mean_squared_error.cuh b/cpp/include/raft/linalg/mean_squared_error.cuh index 70c04ccc6b..57a346448f 100644 --- a/cpp/include/raft/linalg/mean_squared_error.cuh +++ b/cpp/include/raft/linalg/mean_squared_error.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MSE_H @@ -9,10 +9,11 @@ #include "detail/mean_squared_error.cuh" +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -70,6 +71,6 @@ void mean_squared_error(raft::resources const& handle, /** @} */ // end of group mean_squared_error }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/multiply.cuh b/cpp/include/raft/linalg/multiply.cuh index 22c89a5883..2dbd2c90cf 100644 --- a/cpp/include/raft/linalg/multiply.cuh +++ b/cpp/include/raft/linalg/multiply.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MULTIPLY_H @@ -9,12 +9,13 @@ #include "detail/multiply.cuh" +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -81,6 +82,6 @@ void multiply_scalar( /** @} */ // end of group multiply }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/norm.cuh b/cpp/include/raft/linalg/norm.cuh index e16fbf4353..9a732da3e7 100644 --- a/cpp/include/raft/linalg/norm.cuh +++ b/cpp/include/raft/linalg/norm.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __NORM_H @@ -10,6 +10,7 @@ #include "detail/norm.cuh" #include "linalg_types.hpp" +#include #include #include #include @@ -18,7 +19,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -149,6 +150,6 @@ void norm(raft::resources const& handle, /** @} */ }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/norm_types.hpp b/cpp/include/raft/linalg/norm_types.hpp index 3664297f5e..b1c6c3ae36 100644 --- a/cpp/include/raft/linalg/norm_types.hpp +++ b/cpp/include/raft/linalg/norm_types.hpp @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft { +#include +namespace RAFT_EXPORT raft { namespace linalg { /** Enum to tell how to compute a norm */ @@ -22,4 +23,4 @@ enum NormType : unsigned short { }; } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/normalize.cuh b/cpp/include/raft/linalg/normalize.cuh index 730d5aff25..c31c10291c 100644 --- a/cpp/include/raft/linalg/normalize.cuh +++ b/cpp/include/raft/linalg/normalize.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,13 +7,14 @@ #include "detail/normalize.cuh" +#include #include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -106,4 +107,4 @@ void row_normalize(raft::resources const& handle, /** @} */ } // namespace linalg -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/pca.cuh b/cpp/include/raft/linalg/pca.cuh index 218d12cf77..e7cf897247 100644 --- a/cpp/include/raft/linalg/pca.cuh +++ b/cpp/include/raft/linalg/pca.cuh @@ -7,9 +7,11 @@ #include "detail/pca.cuh" +#include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @defgroup pca PCA operations @@ -188,4 +190,5 @@ void trunc_comp_exp_vars(raft::resources const& handle, /** @} */ // end group pca -}; // end namespace raft::linalg +}; // end namespace linalg +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/pca_types.hpp b/cpp/include/raft/linalg/pca_types.hpp index cca3b09155..a701daeec5 100644 --- a/cpp/include/raft/linalg/pca_types.hpp +++ b/cpp/include/raft/linalg/pca_types.hpp @@ -5,9 +5,12 @@ #pragma once +#include + #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @brief Solver algorithm for PCA/TSVD eigen decomposition. @@ -33,4 +36,5 @@ struct paramsPCA : paramsTSVD { bool whiten = false; }; -}; // end namespace raft::linalg +}; // end namespace linalg +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/power.cuh b/cpp/include/raft/linalg/power.cuh index ae4820cda3..a070fb7da1 100644 --- a/cpp/include/raft/linalg/power.cuh +++ b/cpp/include/raft/linalg/power.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __POWER_H @@ -7,6 +7,7 @@ #pragma once +#include #include #include #include @@ -14,7 +15,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -130,6 +131,6 @@ void power_scalar( /** @} */ // end of group add }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/qr.cuh b/cpp/include/raft/linalg/qr.cuh index b6fbf0ae3b..88643fa6eb 100644 --- a/cpp/include/raft/linalg/qr.cuh +++ b/cpp/include/raft/linalg/qr.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __QR_H @@ -9,10 +9,11 @@ #include "detail/qr.cuh" +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -110,6 +111,6 @@ void qr_get_qr(raft::resources const& handle, /** @} */ }; // namespace linalg -}; // namespace raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/reduce.cuh b/cpp/include/raft/linalg/reduce.cuh index ce2c324f24..f6804d98a3 100644 --- a/cpp/include/raft/linalg/reduce.cuh +++ b/cpp/include/raft/linalg/reduce.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __REDUCE_H @@ -10,13 +10,14 @@ #include "detail/reduce.cuh" #include "linalg_types.hpp" +#include #include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -181,6 +182,6 @@ void reduce(raft::resources const& handle, /** @} */ // end of group reduction }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/reduce_cols_by_key.cuh b/cpp/include/raft/linalg/reduce_cols_by_key.cuh index e0ac2d6544..91c45a7325 100644 --- a/cpp/include/raft/linalg/reduce_cols_by_key.cuh +++ b/cpp/include/raft/linalg/reduce_cols_by_key.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __REDUCE_COLS_BY_KEY @@ -9,11 +9,12 @@ #include "detail/reduce_cols_by_key.cuh" +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -103,6 +104,6 @@ void reduce_cols_by_key( /** @} */ // end of group reduce_cols_by_key }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/reduce_rows_by_key.cuh b/cpp/include/raft/linalg/reduce_rows_by_key.cuh index 7e7e91bcb9..ee8e93d4d4 100644 --- a/cpp/include/raft/linalg/reduce_rows_by_key.cuh +++ b/cpp/include/raft/linalg/reduce_rows_by_key.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __REDUCE_ROWS_BY_KEY @@ -9,11 +9,12 @@ #include "detail/reduce_rows_by_key.cuh" +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -182,6 +183,6 @@ void reduce_rows_by_key( /** @} */ // end of group reduce_rows_by_key }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/rsvd.cuh b/cpp/include/raft/linalg/rsvd.cuh index a9692f5175..7b8f10efa3 100644 --- a/cpp/include/raft/linalg/rsvd.cuh +++ b/cpp/include/raft/linalg/rsvd.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __RSVD_H @@ -9,10 +9,11 @@ #include "detail/rsvd.cuh" +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -867,6 +868,6 @@ void randomized_svd(const raft::resources& handle, /** @} */ // end of group rsvd }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/sqrt.cuh b/cpp/include/raft/linalg/sqrt.cuh index e0c232e62a..a007ae18d8 100644 --- a/cpp/include/raft/linalg/sqrt.cuh +++ b/cpp/include/raft/linalg/sqrt.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SQRT_H @@ -7,12 +7,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -68,6 +69,6 @@ void sqrt(raft::resources const& handle, InType in, OutType out) /** @} */ // end of group add }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/strided_reduction.cuh b/cpp/include/raft/linalg/strided_reduction.cuh index efbd80126e..109098f00e 100644 --- a/cpp/include/raft/linalg/strided_reduction.cuh +++ b/cpp/include/raft/linalg/strided_reduction.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,6 +10,7 @@ #include "detail/strided_reduction.cuh" +#include #include #include #include @@ -17,7 +18,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -161,6 +162,6 @@ void strided_reduction(raft::resources const& handle, /** @} */ // end of group strided_reduction }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/subtract.cuh b/cpp/include/raft/linalg/subtract.cuh index 1aba864100..8c6c4c50c2 100644 --- a/cpp/include/raft/linalg/subtract.cuh +++ b/cpp/include/raft/linalg/subtract.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,12 +10,13 @@ #include "detail/subtract.cuh" +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -190,6 +191,6 @@ void subtract_scalar( /** @} */ // end of group subtract }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/svd.cuh b/cpp/include/raft/linalg/svd.cuh index e4c08450cc..f4800a042a 100644 --- a/cpp/include/raft/linalg/svd.cuh +++ b/cpp/include/raft/linalg/svd.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SVD_H @@ -9,11 +9,12 @@ #include "detail/svd.cuh" +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -407,6 +408,6 @@ void svd_reconstruction(raft::resources const& handle, /** @} */ // end of group svd }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/ternary_op.cuh b/cpp/include/raft/linalg/ternary_op.cuh index fa9bf7be23..3cb6179ee8 100644 --- a/cpp/include/raft/linalg/ternary_op.cuh +++ b/cpp/include/raft/linalg/ternary_op.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** * @brief perform element-wise ternary operation on the input arrays @@ -73,6 +74,6 @@ void ternary_op( /** @} */ // end of group ternary_op }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/transpose.cuh b/cpp/include/raft/linalg/transpose.cuh index f12ff0fa93..b399c45c10 100644 --- a/cpp/include/raft/linalg/transpose.cuh +++ b/cpp/include/raft/linalg/transpose.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __TRANSPOSE_H @@ -9,11 +9,12 @@ #include "detail/transpose.cuh" +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -96,6 +97,6 @@ auto transpose(raft::resources const& handle, /** @} */ // end of group transpose }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/linalg/tsvd.cuh b/cpp/include/raft/linalg/tsvd.cuh index 8f946d5b39..32598ea42c 100644 --- a/cpp/include/raft/linalg/tsvd.cuh +++ b/cpp/include/raft/linalg/tsvd.cuh @@ -7,9 +7,11 @@ #include "detail/tsvd.cuh" +#include #include -namespace raft::linalg { +namespace RAFT_EXPORT raft { +namespace linalg { /** * @defgroup tsvd Truncated SVD operations @@ -166,4 +168,5 @@ void sign_flip_components(raft::resources const& handle, /** @} */ // end group tsvd -}; // end namespace raft::linalg +}; // end namespace linalg +}; // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/linalg/unary_op.cuh b/cpp/include/raft/linalg/unary_op.cuh index 69e2130adb..fbbca2d25b 100644 --- a/cpp/include/raft/linalg/unary_op.cuh +++ b/cpp/include/raft/linalg/unary_op.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __UNARY_OP_H @@ -7,12 +7,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace linalg { /** @@ -115,6 +116,6 @@ void write_only_unary_op(const raft::resources& handle, OutType out, Lambda op) /** @} */ // end of group unary_op }; // end namespace linalg -}; // end namespace raft +}; // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/matrix/argmax.cuh b/cpp/include/raft/matrix/argmax.cuh index 36a8999b64..c67df3de6a 100644 --- a/cpp/include/raft/matrix/argmax.cuh +++ b/cpp/include/raft/matrix/argmax.cuh @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup argmax Argmax operation @@ -38,4 +40,5 @@ void argmax(raft::resources const& handle, /** @} */ // end of group argmax -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/argmin.cuh b/cpp/include/raft/matrix/argmin.cuh index a168d3969a..951a816439 100644 --- a/cpp/include/raft/matrix/argmin.cuh +++ b/cpp/include/raft/matrix/argmin.cuh @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup argmin Argmin operation @@ -38,4 +40,5 @@ void argmin(raft::resources const& handle, /** @} */ // end of group argmin -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/col_wise_sort.cuh b/cpp/include/raft/matrix/col_wise_sort.cuh index 0347797a4c..6dae536e6d 100644 --- a/cpp/include/raft/matrix/col_wise_sort.cuh +++ b/cpp/include/raft/matrix/col_wise_sort.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __COL_WISE_SORT_H @@ -7,12 +7,14 @@ #pragma once +#include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @brief sort columns within each row of row-major input matrix and return sorted indexes @@ -123,6 +125,6 @@ void sort_cols_per_row(Args... args) /** @} */ // end of group col_wise_sort -}; // end namespace raft::matrix - +}; // namespace matrix +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/matrix/copy.cuh b/cpp/include/raft/matrix/copy.cuh index 8c3f00eca5..574dd17d88 100644 --- a/cpp/include/raft/matrix/copy.cuh +++ b/cpp/include/raft/matrix/copy.cuh @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_copy Matrix copy operations @@ -113,4 +115,5 @@ void trunc_zero_origin(raft::resources const& handle, /** @} */ // end of group matrix_copy -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/columnWiseSort.cuh b/cpp/include/raft/matrix/detail/columnWiseSort.cuh index a8f654557d..e809e0a0ee 100644 --- a/cpp/include/raft/matrix/detail/columnWiseSort.cuh +++ b/cpp/include/raft/matrix/detail/columnWiseSort.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include @@ -21,7 +22,7 @@ devKeyValSortColumnPerRow<<>>( \ keyIn, keyOut, valueInOut, rows, columns, std::numeric_limits::max()) -namespace raft { +namespace RAFT_EXPORT raft { namespace matrix { namespace detail { @@ -336,4 +337,4 @@ void sortColumnsPerRow(const InType* in, } }; // end namespace detail }; // end namespace matrix -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/gather.cuh b/cpp/include/raft/matrix/detail/gather.cuh index 20bbc4271d..f443b9567e 100644 --- a/cpp/include/raft/matrix/detail/gather.cuh +++ b/cpp/include/raft/matrix/detail/gather.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -21,7 +22,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace matrix { namespace detail { @@ -621,4 +622,4 @@ void gather(raft::resources const& res, } // namespace detail } // namespace matrix -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/gather_inplace.cuh b/cpp/include/raft/matrix/detail/gather_inplace.cuh index beaad13657..cec7a0420a 100644 --- a/cpp/include/raft/matrix/detail/gather_inplace.cuh +++ b/cpp/include/raft/matrix/detail/gather_inplace.cuh @@ -4,6 +4,7 @@ */ #pragma once +#include #include #include #include @@ -12,7 +13,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace matrix { namespace detail { @@ -130,4 +131,4 @@ void gather(raft::resources const& handle, } // namespace detail } // namespace matrix -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/linewise_op.cuh b/cpp/include/raft/matrix/detail/linewise_op.cuh index 77ea695eee..a4e20eafa3 100644 --- a/cpp/include/raft/matrix/detail/linewise_op.cuh +++ b/cpp/include/raft/matrix/detail/linewise_op.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -15,7 +16,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace matrix { namespace detail { @@ -806,4 +807,4 @@ struct MatrixLinewiseOp { } // end namespace detail } // end namespace matrix -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/math.cuh b/cpp/include/raft/matrix/detail/math.cuh index 05416d16be..d70e55e3ba 100644 --- a/cpp/include/raft/matrix/detail/math.cuh +++ b/cpp/include/raft/matrix/detail/math.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -18,7 +19,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace matrix { namespace detail { @@ -401,4 +402,4 @@ void signFlip(math_t* inout, int n_rows, int n_cols, cudaStream_t stream) } // end namespace detail } // end namespace matrix -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/matrix.cuh b/cpp/include/raft/matrix/detail/matrix.cuh index af42e12037..c2b8c9d2a3 100644 --- a/cpp/include/raft/matrix/detail/matrix.cuh +++ b/cpp/include/raft/matrix/detail/matrix.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -23,7 +24,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace matrix { namespace detail { @@ -308,4 +309,4 @@ m_t getL2Norm(raft::resources const& handle, const m_t* in, idx_t size, cudaStre } // end namespace detail } // end namespace matrix -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/print.hpp b/cpp/include/raft/matrix/detail/print.hpp index 94418a6ea0..d02b1d5a6a 100644 --- a/cpp/include/raft/matrix/detail/print.hpp +++ b/cpp/include/raft/matrix/detail/print.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -20,7 +21,8 @@ #include #include -namespace raft::matrix::detail { +namespace RAFT_EXPORT raft { +namespace matrix::detail { template void printHost( @@ -33,4 +35,5 @@ void printHost( } } -} // end namespace raft::matrix::detail +} // namespace matrix::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/sample_rows.cuh b/cpp/include/raft/matrix/detail/sample_rows.cuh index fc2e9e4298..1bd16b257f 100644 --- a/cpp/include/raft/matrix/detail/sample_rows.cuh +++ b/cpp/include/raft/matrix/detail/sample_rows.cuh @@ -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 #include #include #include @@ -14,7 +15,8 @@ #include #include -namespace raft::matrix::detail { +namespace RAFT_EXPORT raft { +namespace matrix::detail { /** Select rows randomly from input and copy to output. */ template @@ -63,4 +65,5 @@ void sample_rows(raft::resources const& res, IdxT n_dim = output.extent(1); sample_rows(res, random_state, input, n_dim, n_rows_input, output); } -} // namespace raft::matrix::detail +} // namespace matrix::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/scatter_inplace.cuh b/cpp/include/raft/matrix/detail/scatter_inplace.cuh index 7ffa697f71..ac712505e8 100644 --- a/cpp/include/raft/matrix/detail/scatter_inplace.cuh +++ b/cpp/include/raft/matrix/detail/scatter_inplace.cuh @@ -4,6 +4,7 @@ */ #pragma once +#include #include #include #include @@ -15,7 +16,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace matrix { namespace detail { @@ -116,4 +117,4 @@ void scatter(raft::resources const& handle, } // end namespace detail } // end namespace matrix -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/select_k-inl.cuh b/cpp/include/raft/matrix/detail/select_k-inl.cuh index 37411ba0bd..0d4159e0de 100644 --- a/cpp/include/raft/matrix/detail/select_k-inl.cuh +++ b/cpp/include/raft/matrix/detail/select_k-inl.cuh @@ -9,6 +9,7 @@ #include "select_radix.cuh" #include "select_warpsort.cuh" +#include #include #include #include @@ -19,7 +20,8 @@ #include -namespace raft::matrix::detail { +namespace RAFT_EXPORT raft { +namespace matrix::detail { /** * Predict the fastest select_k algorithm based on the number of rows/cols/k @@ -308,4 +310,5 @@ void select_k(raft::resources const& handle, default: RAFT_FAIL("K-selection Algorithm not supported."); } } -} // namespace raft::matrix::detail +} // namespace matrix::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/select_k_layout.cuh b/cpp/include/raft/matrix/detail/select_k_layout.cuh index 8e7ba70164..6f7f5e579b 100644 --- a/cpp/include/raft/matrix/detail/select_k_layout.cuh +++ b/cpp/include/raft/matrix/detail/select_k_layout.cuh @@ -5,10 +5,13 @@ #pragma once +#include + #include #include -namespace raft::matrix::detail::select { +namespace RAFT_EXPORT raft { +namespace matrix::detail::select { /** * Row-layout policy for dense matrices where every row has the same length. @@ -42,4 +45,5 @@ struct csr_layout { } }; -} // namespace raft::matrix::detail::select +} // namespace matrix::detail::select +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/select_radix.cuh b/cpp/include/raft/matrix/detail/select_radix.cuh index a6dd7e0ce5..80299a6c48 100644 --- a/cpp/include/raft/matrix/detail/select_radix.cuh +++ b/cpp/include/raft/matrix/detail/select_radix.cuh @@ -29,7 +29,8 @@ #include #include -namespace raft::matrix::detail::select::radix { +namespace RAFT_EXPORT raft { +namespace matrix::detail::select::radix { namespace impl { constexpr int VECTORIZED_READ_SIZE = 16; @@ -1314,4 +1315,5 @@ void select_k(raft::resources const& res, } } -} // namespace raft::matrix::detail::select::radix +} // namespace matrix::detail::select::radix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/select_warpsort.cuh b/cpp/include/raft/matrix/detail/select_warpsort.cuh index a480743664..991a4647a7 100644 --- a/cpp/include/raft/matrix/detail/select_warpsort.cuh +++ b/cpp/include/raft/matrix/detail/select_warpsort.cuh @@ -92,7 +92,8 @@ } */ -namespace raft::matrix::detail::select::warpsort { +namespace RAFT_EXPORT raft { +namespace matrix::detail::select::warpsort { static constexpr int kMaxCapacity = 256; @@ -1230,4 +1231,5 @@ void select_k(raft::resources const& res, } } -} // namespace raft::matrix::detail::select::warpsort +} // namespace matrix::detail::select::warpsort +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/detail/shift.cuh b/cpp/include/raft/matrix/detail/shift.cuh index 48aea2ff5a..e8925e8cc7 100644 --- a/cpp/include/raft/matrix/detail/shift.cuh +++ b/cpp/include/raft/matrix/detail/shift.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,8 @@ #include #include -namespace raft::matrix::detail { +namespace RAFT_EXPORT raft { +namespace matrix::detail { enum FillType { CONSTANT, MATRIX, SELF_ID }; template @@ -190,4 +191,5 @@ void shift(raft::resources const& handle, shift_dispatch( handle, in_out, values.data_handle(), k, shift_direction, shift_type); } -} // namespace raft::matrix::detail +} // namespace matrix::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/diagonal.cuh b/cpp/include/raft/matrix/diagonal.cuh index f7f04d9d9e..c45a34b92e 100644 --- a/cpp/include/raft/matrix/diagonal.cuh +++ b/cpp/include/raft/matrix/diagonal.cuh @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_diagonal Matrix diagonal operations @@ -100,4 +102,5 @@ void eye(const raft::resources& handle, raft::device_matrix_view #include #include #include @@ -12,7 +13,8 @@ #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_gather Matrix gather operations @@ -464,4 +466,5 @@ void gather(raft::resources const& handle, /** @} */ // end of group matrix_gather -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/init.cuh b/cpp/include/raft/matrix/init.cuh index fbf5671deb..c506928586 100644 --- a/cpp/include/raft/matrix/init.cuh +++ b/cpp/include/raft/matrix/init.cuh @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_init Matrix initialization operations @@ -63,4 +65,5 @@ void fill(raft::resources const& handle, /** @} */ // end of group matrix_init -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/linewise_op.cuh b/cpp/include/raft/matrix/linewise_op.cuh index 8b49f55d95..2c7c78d14c 100644 --- a/cpp/include/raft/matrix/linewise_op.cuh +++ b/cpp/include/raft/matrix/linewise_op.cuh @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup linewise_op Matrix Linewise Operations @@ -113,4 +115,5 @@ void linewise_op(raft::resources const& handle, /** @} */ // end of group linewise_op -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/matrix_types.hpp b/cpp/include/raft/matrix/matrix_types.hpp index 8962ef2d9b..41408cf8da 100644 --- a/cpp/include/raft/matrix/matrix_types.hpp +++ b/cpp/include/raft/matrix/matrix_types.hpp @@ -1,15 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft::matrix { +#include +namespace RAFT_EXPORT raft { +namespace matrix { struct print_separators { char horizontal = ' '; char vertical = '\n'; }; -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/norm.cuh b/cpp/include/raft/matrix/norm.cuh index 88d5c942f0..842d9f0f66 100644 --- a/cpp/include/raft/matrix/norm.cuh +++ b/cpp/include/raft/matrix/norm.cuh @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_norm Matrix Norm Operations @@ -30,4 +32,5 @@ m_t l2_norm(raft::resources const& handle, raft::device_mdspan /** @} */ // end of group matrix_norm -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/power.cuh b/cpp/include/raft/matrix/power.cuh index 135e2e53a4..f3ece2298e 100644 --- a/cpp/include/raft/matrix/power.cuh +++ b/cpp/include/raft/matrix/power.cuh @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_power Matrix Power Operations @@ -90,4 +92,5 @@ void power(raft::resources const& handle, /** @} */ // end group matrix_power -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/print.cuh b/cpp/include/raft/matrix/print.cuh index 47c10aed9e..54a8a47988 100644 --- a/cpp/include/raft/matrix/print.cuh +++ b/cpp/include/raft/matrix/print.cuh @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_print Matrix print operations @@ -40,4 +42,5 @@ void print(raft::resources const& handle, } /** @} */ // end group matrix_print -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/print.hpp b/cpp/include/raft/matrix/print.hpp index c5b1009c22..38ee42d036 100644 --- a/cpp/include/raft/matrix/print.hpp +++ b/cpp/include/raft/matrix/print.hpp @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @brief Prints the data stored in CPU memory @@ -22,4 +24,5 @@ void print(raft::host_matrix_view in, print_separat detail::printHost( in.data_handle(), in.extent(0), in.extent(1), separators.horizontal, separators.vertical); } -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/ratio.cuh b/cpp/include/raft/matrix/ratio.cuh index 4bf3017791..7b9a94c689 100644 --- a/cpp/include/raft/matrix/ratio.cuh +++ b/cpp/include/raft/matrix/ratio.cuh @@ -5,11 +5,13 @@ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_ratio Matrix ratio operations @@ -90,4 +92,5 @@ void ratio(raft::resources const& handle, raft::device_vector_view #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_reciprocal Matrix Reciprocal Operations @@ -76,4 +78,5 @@ void reciprocal(raft::resources const& handle, /** @} */ // end group matrix_reciprocal -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/reverse.cuh b/cpp/include/raft/matrix/reverse.cuh index 54f86ccfd7..81e8139e62 100644 --- a/cpp/include/raft/matrix/reverse.cuh +++ b/cpp/include/raft/matrix/reverse.cuh @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_reverse Matrix reverse @@ -58,4 +60,5 @@ void row_reverse(raft::resources const& handle, } /** @} */ // end group matrix_reverse -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/sample_rows.cuh b/cpp/include/raft/matrix/sample_rows.cuh index b69a112251..36b67fdc91 100644 --- a/cpp/include/raft/matrix/sample_rows.cuh +++ b/cpp/include/raft/matrix/sample_rows.cuh @@ -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 #include #include #include @@ -12,7 +13,8 @@ #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** @brief Select rows randomly from input and copy to output. * @@ -66,4 +68,5 @@ raft::device_matrix sample_rows( return output; } -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/scatter.cuh b/cpp/include/raft/matrix/scatter.cuh index f435595fee..8502d7f693 100644 --- a/cpp/include/raft/matrix/scatter.cuh +++ b/cpp/include/raft/matrix/scatter.cuh @@ -1,15 +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 #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @brief In-place scatter elements in a row-major matrix according to a * map. The map specifies the new order in which rows of the input matrix are @@ -44,4 +46,5 @@ void scatter(raft::resources const& handle, detail::scatter(handle, inout, map, col_batch_size); } -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/select_k.cuh b/cpp/include/raft/matrix/select_k.cuh index ba83f635d5..631027d03c 100644 --- a/cpp/include/raft/matrix/select_k.cuh +++ b/cpp/include/raft/matrix/select_k.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,7 @@ #include "detail/select_k.cuh" +#include #include #include #include @@ -15,7 +16,8 @@ #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup select_k Batched-select k smallest or largest key/values @@ -107,4 +109,5 @@ void select_k(raft::resources const& handle, /** @} */ // end of group select_k -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/select_k_types.hpp b/cpp/include/raft/matrix/select_k_types.hpp index baf1672d2c..6161e91ae2 100644 --- a/cpp/include/raft/matrix/select_k_types.hpp +++ b/cpp/include/raft/matrix/select_k_types.hpp @@ -1,12 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup select_k Batched-select k smallest or largest key/values @@ -87,4 +90,5 @@ inline auto operator<<(std::ostream& os, const SelectAlgo& algo) -> std::ostream /** @} */ // end of group select_k -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/shift.cuh b/cpp/include/raft/matrix/shift.cuh index 2d3ceb72f8..a10dc703c0 100644 --- a/cpp/include/raft/matrix/shift.cuh +++ b/cpp/include/raft/matrix/shift.cuh @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @brief In-place operation. Shifts rows or columns to shift_direction by k, and fills the empty @@ -107,4 +109,5 @@ void shift(raft::resources const& handle, detail::shift(handle, in_out, values, shift_direction, shift_type); } -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/shift_types.hpp b/cpp/include/raft/matrix/shift_types.hpp index 296e2a57a6..121f5bcb6e 100644 --- a/cpp/include/raft/matrix/shift_types.hpp +++ b/cpp/include/raft/matrix/shift_types.hpp @@ -1,13 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft::matrix { +#include +namespace RAFT_EXPORT raft { +namespace matrix { enum ShiftDirection { TOWARDS_BEGINNING, TOWARDS_END }; enum ShiftType { ROW, COL }; -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/sign_flip.cuh b/cpp/include/raft/matrix/sign_flip.cuh index 5c44db8310..25314dfed0 100644 --- a/cpp/include/raft/matrix/sign_flip.cuh +++ b/cpp/include/raft/matrix/sign_flip.cuh @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_sign_flip Matrix sign flip operations @@ -33,4 +35,5 @@ void sign_flip(raft::resources const& handle, } /** @} */ // end group matrix_sign_flip -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/slice.cuh b/cpp/include/raft/matrix/slice.cuh index 0ed2b14636..aca53bad18 100644 --- a/cpp/include/raft/matrix/slice.cuh +++ b/cpp/include/raft/matrix/slice.cuh @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_slice Matrix slicing @@ -69,4 +71,5 @@ void slice(raft::resources const& handle, /** @} */ // end group matrix_slice -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/sqrt.cuh b/cpp/include/raft/matrix/sqrt.cuh index 8f202c8422..529f6f0389 100644 --- a/cpp/include/raft/matrix/sqrt.cuh +++ b/cpp/include/raft/matrix/sqrt.cuh @@ -5,12 +5,14 @@ #pragma once +#include #include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_sqrt Matrix Square Root @@ -102,4 +104,5 @@ void weighted_sqrt(raft::resources const& handle, /** @} */ // end group matrix_sqrt -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/threshold.cuh b/cpp/include/raft/matrix/threshold.cuh index f499e46dc2..0e0ecfd38f 100644 --- a/cpp/include/raft/matrix/threshold.cuh +++ b/cpp/include/raft/matrix/threshold.cuh @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_threshold Matrix thesholding @@ -57,4 +59,5 @@ void zero_small_values(raft::resources const& handle, /** @} */ // end group matrix_threshold -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/matrix/triangular.cuh b/cpp/include/raft/matrix/triangular.cuh index 768b2ff6ea..b4065a9a5b 100644 --- a/cpp/include/raft/matrix/triangular.cuh +++ b/cpp/include/raft/matrix/triangular.cuh @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::matrix { +namespace RAFT_EXPORT raft { +namespace matrix { /** * @defgroup matrix_triangular Extract Matrix Triangles @@ -38,4 +40,5 @@ void upper_triangular(raft::resources const& handle, } /** @} */ // end group matrix_triangular -} // namespace raft::matrix +} // namespace matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/mr/host_device_resource.hpp b/cpp/include/raft/mr/host_device_resource.hpp index 40feb60fe3..1b2d691a64 100644 --- a/cpp/include/raft/mr/host_device_resource.hpp +++ b/cpp/include/raft/mr/host_device_resource.hpp @@ -4,9 +4,12 @@ */ #pragma once +#include + #include -namespace raft::mr { +namespace RAFT_EXPORT raft { +namespace mr { /** * @brief Type-erased owning synchronous resource accessible from both host and device. @@ -48,4 +51,5 @@ using host_resource_ref = cuda::mr::synchronous_resource_ref; -} // namespace raft::mr +} // namespace mr +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/mr/host_memory_resource.hpp b/cpp/include/raft/mr/host_memory_resource.hpp index 5adc8dad9f..03baee661c 100644 --- a/cpp/include/raft/mr/host_memory_resource.hpp +++ b/cpp/include/raft/mr/host_memory_resource.hpp @@ -4,6 +4,7 @@ */ #pragma once +#include #include #include @@ -11,7 +12,8 @@ #include #include -namespace raft::mr { +namespace RAFT_EXPORT raft { +namespace mr { /** * @brief Get a reference to a stateless new/delete host memory resource. @@ -74,4 +76,5 @@ inline auto set_default_host_resource(raft::mr::host_resource_ref ref) return detail::default_host_resource_holder_.set(ref); } -} // namespace raft::mr +} // namespace mr +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/mr/mmap_memory_resource.hpp b/cpp/include/raft/mr/mmap_memory_resource.hpp index 9aba94960b..d2f5b64092 100644 --- a/cpp/include/raft/mr/mmap_memory_resource.hpp +++ b/cpp/include/raft/mr/mmap_memory_resource.hpp @@ -4,6 +4,7 @@ */ #pragma once +#include #include #include #include @@ -21,7 +22,8 @@ #include #include -namespace raft::mr { +namespace RAFT_EXPORT raft { +namespace mr { namespace detail { @@ -159,4 +161,5 @@ class mmap_memory_resource { } }; -} // namespace raft::mr +} // namespace mr +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/mr/notifying_adaptor.hpp b/cpp/include/raft/mr/notifying_adaptor.hpp index a59fd0d99a..85ef3de65b 100644 --- a/cpp/include/raft/mr/notifying_adaptor.hpp +++ b/cpp/include/raft/mr/notifying_adaptor.hpp @@ -4,6 +4,8 @@ */ #pragma once +#include + #include #include #include @@ -13,7 +15,8 @@ #include #include -namespace raft::mr { +namespace RAFT_EXPORT raft { +namespace mr { /** * @brief A simple notifier that can be used to signal that one or more allocations/deallocations @@ -141,4 +144,5 @@ class notifying_adaptor : public cuda::forward_property Upstream const& { return upstream_; } }; -} // namespace raft::mr +} // namespace mr +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/mr/resource_monitor.hpp b/cpp/include/raft/mr/resource_monitor.hpp index fb2645d3d4..c8d3578aaf 100644 --- a/cpp/include/raft/mr/resource_monitor.hpp +++ b/cpp/include/raft/mr/resource_monitor.hpp @@ -4,6 +4,7 @@ */ #pragma once +#include #include #include #include @@ -17,7 +18,8 @@ #include #include -namespace raft::mr { +namespace RAFT_EXPORT raft { +namespace mr { /** * @brief Collects allocation statistics from multiple resource_stats sources @@ -154,4 +156,5 @@ class resource_monitor { } }; -} // namespace raft::mr +} // namespace mr +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/mr/statistics_adaptor.hpp b/cpp/include/raft/mr/statistics_adaptor.hpp index 161fc18559..7993ff3c0c 100644 --- a/cpp/include/raft/mr/statistics_adaptor.hpp +++ b/cpp/include/raft/mr/statistics_adaptor.hpp @@ -4,6 +4,8 @@ */ #pragma once +#include + #include #include @@ -14,7 +16,8 @@ #include #include -namespace raft::mr { +namespace RAFT_EXPORT raft { +namespace mr { /** * @brief Atomic allocation counters readable from any thread without locking. @@ -129,4 +132,5 @@ class statistics_adaptor : public cuda::forward_property statistics_adaptor(Upstream) -> statistics_adaptor; -} // namespace raft::mr +} // namespace mr +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/pmr/resource_adaptor.hpp b/cpp/include/raft/pmr/resource_adaptor.hpp index 625f6303dc..002461f282 100644 --- a/cpp/include/raft/pmr/resource_adaptor.hpp +++ b/cpp/include/raft/pmr/resource_adaptor.hpp @@ -4,13 +4,16 @@ */ #pragma once +#include + #include #include #include #include -namespace raft::pmr { +namespace RAFT_EXPORT raft { +namespace pmr { /** * @brief Adapter wrapping std::pmr::memory_resource to satisfy @@ -79,4 +82,5 @@ static_assert(cuda::mr::synchronous_resource_with for " "raft::mr::host_resource_ref consumption"); -} // namespace raft::pmr +} // namespace pmr +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/curand_wrappers.hpp b/cpp/include/raft/random/detail/curand_wrappers.hpp index b2613ad643..78c23180fd 100644 --- a/cpp/include/raft/random/detail/curand_wrappers.hpp +++ b/cpp/include/raft/random/detail/curand_wrappers.hpp @@ -1,13 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { namespace detail { // @todo: We probably want to scrape through and replace any consumers of @@ -43,4 +46,5 @@ inline curandStatus_t curandGenerateNormal( /** @} */ }; // end namespace detail -}; // end namespace raft::random +}; // namespace random +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/make_blobs.cuh b/cpp/include/raft/random/detail/make_blobs.cuh index 0c5442f981..f652aa3100 100644 --- a/cpp/include/raft/random/detail/make_blobs.cuh +++ b/cpp/include/raft/random/detail/make_blobs.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,7 @@ #include "permute.cuh" +#include #include #include #include @@ -18,7 +19,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace random { namespace detail { @@ -247,4 +248,4 @@ void make_blobs_caller(DataT* out, } // end namespace detail } // end namespace random -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/make_regression.cuh b/cpp/include/raft/random/detail/make_regression.cuh index 92256a8ec4..782b144348 100644 --- a/cpp/include/raft/random/detail/make_regression.cuh +++ b/cpp/include/raft/random/detail/make_regression.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,6 +9,7 @@ #pragma once +#include #include #include #include @@ -24,7 +25,8 @@ #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { namespace detail { /* Internal auxiliary function to help build the singular profile */ @@ -267,4 +269,5 @@ void make_regression_caller(raft::resources const& handle, } } // namespace detail -} // namespace raft::random +} // namespace random +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/multi_variable_gaussian.cuh b/cpp/include/raft/random/detail/multi_variable_gaussian.cuh index 0cec08e6e3..11f5edf802 100644 --- a/cpp/include/raft/random/detail/multi_variable_gaussian.cuh +++ b/cpp/include/raft/random/detail/multi_variable_gaussian.cuh @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include "curand_wrappers.hpp" +#include #include #include #include @@ -31,7 +32,8 @@ // mvg.cuh takes in matrices that are column major (as in fortran) #define IDX2C(i, j, ld) (j * ld + i) -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { namespace detail { enum Filler : unsigned char { @@ -449,4 +451,5 @@ class multi_variable_gaussian : public detail::multi_variable_gaussian_impl { }; // end of multi_variable_gaussian }; // end of namespace detail -}; // end of namespace raft::random +}; // namespace random +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/permute.cuh b/cpp/include/raft/random/detail/permute.cuh index ca141ad5ec..5a476b7f80 100644 --- a/cpp/include/raft/random/detail/permute.cuh +++ b/cpp/include/raft/random/detail/permute.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -13,7 +14,8 @@ #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { namespace detail { template @@ -150,4 +152,5 @@ void permute(IntType* perms, } }; // end namespace detail -}; // end namespace raft::random +}; // namespace random +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh b/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh index b8139600b9..05a1e961f9 100644 --- a/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh +++ b/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,7 @@ #include "rmat_rectangular_generator_types.cuh" +#include #include #include #include @@ -14,7 +15,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace random { namespace detail { @@ -292,4 +293,4 @@ void rmat_rectangular_gen_impl(raft::resources const& handle, } // end namespace detail } // end namespace random -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh b/cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh index d215a0235b..902fa62f67 100644 --- a/cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh +++ b/cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -14,7 +15,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace random { namespace detail { @@ -245,4 +246,4 @@ class rmat_rectangular_gen_output { } // end namespace detail } // end namespace random -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/rng_device.cuh b/cpp/include/raft/random/detail/rng_device.cuh index 7f59e7c7ae..5740199160 100644 --- a/cpp/include/raft/random/detail/rng_device.cuh +++ b/cpp/include/raft/random/detail/rng_device.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -17,7 +18,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace random { namespace detail { @@ -755,4 +756,4 @@ RAFT_KERNEL fillKernel( }; // end namespace detail }; // end namespace random -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/rng_impl.cuh b/cpp/include/raft/random/detail/rng_impl.cuh index 91c5dfa56c..c0ad8b8f03 100644 --- a/cpp/include/raft/random/detail/rng_impl.cuh +++ b/cpp/include/raft/random/detail/rng_impl.cuh @@ -23,7 +23,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace random { namespace detail { @@ -461,4 +461,4 @@ auto excess_subsample(raft::resources const& res, RngState& state, IdxT N, IdxT }; // end namespace detail }; // end namespace random -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/detail/rng_impl_deprecated.cuh b/cpp/include/raft/random/detail/rng_impl_deprecated.cuh index 1b4cff1892..83e3017b03 100644 --- a/cpp/include/raft/random/detail/rng_impl_deprecated.cuh +++ b/cpp/include/raft/random/detail/rng_impl_deprecated.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,6 +11,7 @@ #include "rng_device.cuh" +#include #include #include #include @@ -23,7 +24,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace random { namespace detail { @@ -296,4 +297,4 @@ class RngImpl { }; // end namespace detail }; // end namespace random -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/device/sample.cuh b/cpp/include/raft/random/device/sample.cuh index 4682d8771e..e12b3f687f 100644 --- a/cpp/include/raft/random/device/sample.cuh +++ b/cpp/include/raft/random/device/sample.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -12,7 +13,8 @@ #include -namespace raft::random::device { +namespace RAFT_EXPORT raft { +namespace random::device { /** * @brief warp-level random sampling of an index. @@ -92,4 +94,5 @@ DI i_t block_random_sample(rng_t rng, T* shbuf, T weight = 1, i_t idx = threadId return idx; } -} // namespace raft::random::device +} // namespace random::device +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/make_blobs.cuh b/cpp/include/raft/random/make_blobs.cuh index 7b8c104941..6e61db7f56 100644 --- a/cpp/include/raft/random/make_blobs.cuh +++ b/cpp/include/raft/random/make_blobs.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,13 +10,15 @@ #include "detail/make_blobs.cuh" +#include #include #include #include #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { /** * @brief GPU-equivalent of sklearn.datasets.make_blobs @@ -174,6 +176,6 @@ void make_blobs( /** @} */ // end group make_blobs -} // end namespace raft::random - +} // namespace random +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/random/make_regression.cuh b/cpp/include/raft/random/make_regression.cuh index 87843a01c0..38db6f2ed6 100644 --- a/cpp/include/raft/random/make_regression.cuh +++ b/cpp/include/raft/random/make_regression.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -14,6 +14,7 @@ #include "detail/make_regression.cuh" +#include #include #include #include @@ -21,7 +22,8 @@ #include #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { /** * @brief GPU-equivalent of sklearn.datasets.make_regression as documented at: @@ -176,6 +178,7 @@ void make_regression(raft::resources const& handle, /** @} */ // end group make_regression -} // namespace raft::random +} // namespace random +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/random/multi_variable_gaussian.cuh b/cpp/include/raft/random/multi_variable_gaussian.cuh index 141fce7cfb..4e0f3d48d6 100644 --- a/cpp/include/raft/random/multi_variable_gaussian.cuh +++ b/cpp/include/raft/random/multi_variable_gaussian.cuh @@ -10,12 +10,14 @@ #include "detail/multi_variable_gaussian.cuh" +#include #include #include #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { /** * \defgroup multi_variable_gaussian Compute multi-variable Gaussian @@ -46,6 +48,6 @@ void multi_variable_gaussian(raft::resources const& handle, /** @} */ -}; // end of namespace raft::random - +}; // namespace random +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/random/permute.cuh b/cpp/include/raft/random/permute.cuh index 0520fbfe94..7c39d94dd1 100644 --- a/cpp/include/raft/random/permute.cuh +++ b/cpp/include/raft/random/permute.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -10,6 +10,7 @@ #include "detail/permute.cuh" +#include #include #include #include @@ -17,7 +18,8 @@ #include #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { namespace permute_impl { @@ -193,6 +195,6 @@ void permute(IntType* perms, detail::permute(perms, out, in, D, N, rowMajor, stream); } -}; // end namespace raft::random - +}; // namespace random +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/random/random_types.hpp b/cpp/include/raft/random/random_types.hpp index ada7a91f48..0006f504a4 100644 --- a/cpp/include/raft/random/random_types.hpp +++ b/cpp/include/raft/random/random_types.hpp @@ -1,11 +1,13 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft::random { +#include +namespace RAFT_EXPORT raft { +namespace random { /** * \ingroup multi_variable_gaussian @@ -32,4 +34,5 @@ enum class multi_variable_gaussian_decomposition_method { CHOLESKY, JACOBI, QR } /** @} */ -}; // end of namespace raft::random +}; // namespace random +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/rmat_rectangular_generator.cuh b/cpp/include/raft/random/rmat_rectangular_generator.cuh index 279e94a91f..60fbe03164 100644 --- a/cpp/include/raft/random/rmat_rectangular_generator.cuh +++ b/cpp/include/raft/random/rmat_rectangular_generator.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,9 +7,11 @@ #include "detail/rmat_rectangular_generator.cuh" +#include #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { /** * @defgroup rmat RMAT Rectangular Generator @@ -293,4 +295,5 @@ void rmat_rectangular_gen(IdxT* out, /** @} */ -} // end namespace raft::random +} // namespace random +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/rng.cuh b/cpp/include/raft/random/rng.cuh index 606d459baa..1cb6215e81 100644 --- a/cpp/include/raft/random/rng.cuh +++ b/cpp/include/raft/random/rng.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -9,6 +9,7 @@ #include "detail/rng_impl_deprecated.cuh" // necessary for now (to be removed) #include "rng_state.hpp" +#include #include #include #include @@ -18,7 +19,8 @@ #include #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { /** * \defgroup univariate_random_sampling Univariate random sampling @@ -1167,4 +1169,5 @@ class DEPR Rng : public detail::RngImpl { #undef DEPR -}; // end namespace raft::random +}; // namespace random +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/random/rng_device.cuh b/cpp/include/raft/random/rng_device.cuh index e1f790a387..a612fcd0d5 100644 --- a/cpp/include/raft/random/rng_device.cuh +++ b/cpp/include/raft/random/rng_device.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,9 @@ #include "detail/rng_device.cuh" #include "rng_state.hpp" -namespace raft { +#include + +namespace RAFT_EXPORT raft { namespace random { using detail::DeviceState; @@ -41,6 +43,5 @@ using detail::custom_next; using detail::box_muller_transform; }; // end namespace random -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/random/rng_state.hpp b/cpp/include/raft/random/rng_state.hpp index b927aeba1a..678c7cafc3 100644 --- a/cpp/include/raft/random/rng_state.hpp +++ b/cpp/include/raft/random/rng_state.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,9 +8,11 @@ #pragma once +#include + #include -namespace raft { +namespace RAFT_EXPORT raft { namespace random { /** all different generator types used */ @@ -48,6 +50,5 @@ struct RngState { }; }; // end namespace random -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/random/sample_without_replacement.cuh b/cpp/include/raft/random/sample_without_replacement.cuh index ea26007dbe..e89b24a337 100644 --- a/cpp/include/raft/random/sample_without_replacement.cuh +++ b/cpp/include/raft/random/sample_without_replacement.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #include "detail/rng_impl.cuh" #include "rng_state.hpp" +#include #include #include #include @@ -17,7 +18,8 @@ #include #include -namespace raft::random { +namespace RAFT_EXPORT raft { +namespace random { namespace sample_without_replacement_impl { template @@ -155,4 +157,5 @@ void sample_without_replacement(Args... args) /** @} */ -} // end namespace raft::random +} // namespace random +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/solver/detail/lap_functions.cuh b/cpp/include/raft/solver/detail/lap_functions.cuh index a2378c6e95..d5e8896036 100644 --- a/cpp/include/raft/solver/detail/lap_functions.cuh +++ b/cpp/include/raft/solver/detail/lap_functions.cuh @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: Copyright 2020 KETAN DATE & RAKESH NAGI - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /* @@ -28,6 +28,7 @@ */ #pragma once +#include #include #include #include @@ -44,7 +45,8 @@ #include -namespace raft::solver::detail { +namespace RAFT_EXPORT raft { +namespace solver::detail { const int BLOCKDIMX{64}; const int BLOCKDIMY{1}; @@ -567,4 +569,5 @@ inline void calcObjValPrimal(raft::resources const& handle, RAFT_CHECK_CUDA(resource::get_cuda_stream(handle)); } -} // namespace raft::solver::detail +} // namespace solver::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/solver/detail/lap_kernels.cuh b/cpp/include/raft/solver/detail/lap_kernels.cuh index d136dd624b..ac08b1a493 100644 --- a/cpp/include/raft/solver/detail/lap_kernels.cuh +++ b/cpp/include/raft/solver/detail/lap_kernels.cuh @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: Copyright 2020 KETAN DATE & RAKESH NAGI - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /* @@ -38,7 +38,8 @@ #include #include -namespace raft::solver::detail { +namespace RAFT_EXPORT raft { +namespace solver::detail { const int DORMANT{0}; const int ACTIVE{1}; const int VISITED{2}; @@ -557,4 +558,5 @@ RAFT_KERNEL kernel_calcObjValPrimal(weight_t* d_obj_val_primal, } } -} // namespace raft::solver::detail +} // namespace solver::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/solver/linear_assignment.cuh b/cpp/include/raft/solver/linear_assignment.cuh index 7c90cf1870..b035abca6e 100644 --- a/cpp/include/raft/solver/linear_assignment.cuh +++ b/cpp/include/raft/solver/linear_assignment.cuh @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: Copyright 2020 KETAN DATE & RAKESH NAGI - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /* @@ -32,6 +32,7 @@ #pragma once +#include #include #include #include @@ -42,7 +43,8 @@ #include #include -namespace raft::solver { +namespace RAFT_EXPORT raft { +namespace solver { /** * @brief CUDA Implementation of O(n^3) alternating tree Hungarian Algorithm @@ -333,6 +335,7 @@ class LinearAssignmentProblem { } }; -} // namespace raft::solver +} // namespace solver +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/solver/linear_assignment_types.hpp b/cpp/include/raft/solver/linear_assignment_types.hpp index ece7f7475b..71d83edba3 100644 --- a/cpp/include/raft/solver/linear_assignment_types.hpp +++ b/cpp/include/raft/solver/linear_assignment_types.hpp @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: Copyright 2020 KETAN DATE & RAKESH NAGI - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /* @@ -28,7 +28,9 @@ */ #pragma once -namespace raft::solver { +#include +namespace RAFT_EXPORT raft { +namespace solver { template struct Vertices { vertex_t* row_assignments; @@ -46,4 +48,5 @@ struct VertexData { vertex_t* children; int* is_visited; }; -} // namespace raft::solver +} // namespace solver +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/convert/coo.cuh b/cpp/include/raft/sparse/convert/coo.cuh index 07d28c7037..3838af2ca5 100644 --- a/cpp/include/raft/sparse/convert/coo.cuh +++ b/cpp/include/raft/sparse/convert/coo.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __COO_H @@ -7,9 +7,10 @@ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { @@ -30,6 +31,6 @@ void csr_to_coo( }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/convert/csr.cuh b/cpp/include/raft/sparse/convert/csr.cuh index df48808ef5..0467daaaa8 100644 --- a/cpp/include/raft/sparse/convert/csr.cuh +++ b/cpp/include/raft/sparse/convert/csr.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __CSR_H @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -16,7 +17,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { @@ -196,6 +197,6 @@ void bitset_to_csr(raft::resources const& handle, }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/convert/dense.cuh b/cpp/include/raft/sparse/convert/dense.cuh index 9a9c47fb41..0cf58e28d7 100644 --- a/cpp/include/raft/sparse/convert/dense.cuh +++ b/cpp/include/raft/sparse/convert/dense.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __DENSE_H @@ -7,9 +7,10 @@ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { @@ -51,6 +52,6 @@ void csr_to_dense(cusparseHandle_t handle, }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/convert/detail/adj_to_csr.cuh b/cpp/include/raft/sparse/convert/detail/adj_to_csr.cuh index 492a7fe3ae..3c2b9eb803 100644 --- a/cpp/include/raft/sparse/convert/detail/adj_to_csr.cuh +++ b/cpp/include/raft/sparse/convert/detail/adj_to_csr.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -15,7 +16,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { namespace detail { @@ -163,4 +164,4 @@ void adj_to_csr(raft::resources const& handle, }; // end NAMESPACE detail }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/convert/detail/bitmap_to_csr.cuh b/cpp/include/raft/sparse/convert/detail/bitmap_to_csr.cuh index 42266cee71..fcd78e685c 100644 --- a/cpp/include/raft/sparse/convert/detail/bitmap_to_csr.cuh +++ b/cpp/include/raft/sparse/convert/detail/bitmap_to_csr.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include // detail::popc #include #include @@ -20,7 +21,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { namespace detail { @@ -340,4 +341,4 @@ void bitmap_to_csr(raft::resources const& handle, }; // end NAMESPACE detail }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/convert/detail/bitset_to_csr.cuh b/cpp/include/raft/sparse/convert/detail/bitset_to_csr.cuh index efb418434e..a663a7ada4 100644 --- a/cpp/include/raft/sparse/convert/detail/bitset_to_csr.cuh +++ b/cpp/include/raft/sparse/convert/detail/bitset_to_csr.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include // detail::popc #include #include @@ -18,7 +19,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { namespace detail { @@ -164,4 +165,4 @@ void bitset_to_csr(raft::resources const& handle, }; // end NAMESPACE detail }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/convert/detail/coo.cuh b/cpp/include/raft/sparse/convert/detail/coo.cuh index e7f957abf1..1041939cd0 100644 --- a/cpp/include/raft/sparse/convert/detail/coo.cuh +++ b/cpp/include/raft/sparse/convert/detail/coo.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -20,7 +21,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { namespace detail { @@ -65,4 +66,4 @@ void csr_to_coo( }; // end NAMESPACE detail }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/convert/detail/csr.cuh b/cpp/include/raft/sparse/convert/detail/csr.cuh index f35064a287..7e8570c1cb 100644 --- a/cpp/include/raft/sparse/convert/detail/csr.cuh +++ b/cpp/include/raft/sparse/convert/detail/csr.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -28,7 +29,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { namespace detail { @@ -91,4 +92,4 @@ void sorted_coo_to_csr(const T* rows, nnz_t nnz, outT* row_ind, int m, cudaStrea }; // end NAMESPACE detail }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/convert/detail/dense.cuh b/cpp/include/raft/sparse/convert/detail/dense.cuh index 695432a34f..bb22232ea2 100644 --- a/cpp/include/raft/sparse/convert/detail/dense.cuh +++ b/cpp/include/raft/sparse/convert/detail/dense.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -22,7 +23,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace convert { namespace detail { @@ -130,4 +131,4 @@ void csr_to_dense(cusparseHandle_t handle, }; // namespace detail }; // end NAMESPACE convert }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/coo.hpp b/cpp/include/raft/sparse/coo.hpp index 3cbdc1ff98..563dbaf392 100644 --- a/cpp/include/raft/sparse/coo.hpp +++ b/cpp/include/raft/sparse/coo.hpp @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2021, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { /** @brief A Container object for sparse coordinate. There are two motivations @@ -32,4 +33,4 @@ template using COO = detail::COO; }; // namespace sparse -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/csr.hpp b/cpp/include/raft/sparse/csr.hpp index 4d52b9b52b..7f1886aa3d 100644 --- a/cpp/include/raft/sparse/csr.hpp +++ b/cpp/include/raft/sparse/csr.hpp @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { constexpr int TPB_X = 256; @@ -168,4 +169,4 @@ void weak_cc(Index_* labels, } }; // namespace sparse -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/detail/coo.cuh b/cpp/include/raft/sparse/detail/coo.cuh index acd96d7637..eb989ae1c0 100644 --- a/cpp/include/raft/sparse/detail/coo.cuh +++ b/cpp/include/raft/sparse/detail/coo.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,8 @@ #pragma once -namespace raft { +#include +namespace RAFT_EXPORT raft { namespace sparse { namespace detail { @@ -238,4 +239,4 @@ class COO { }; // namespace detail }; // namespace sparse -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/detail/csr.cuh b/cpp/include/raft/sparse/detail/csr.cuh index 5272d53a3f..3f9b83aa8f 100644 --- a/cpp/include/raft/sparse/detail/csr.cuh +++ b/cpp/include/raft/sparse/detail/csr.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -23,7 +24,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace detail { @@ -158,4 +159,4 @@ void weak_cc_batched(Index_* labels, }; // namespace detail }; // namespace sparse -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/detail/cusparse_wrappers.h b/cpp/include/raft/sparse/detail/cusparse_wrappers.h index c8ec5a0075..683694015b 100644 --- a/cpp/include/raft/sparse/detail/cusparse_wrappers.h +++ b/cpp/include/raft/sparse/detail/cusparse_wrappers.h @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include #include #include @@ -13,7 +14,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace detail { @@ -1470,4 +1471,4 @@ inline cusparseStatus_t cusparsecsr2dense(cusparseHandle_t handle, } // namespace detail } // namespace sparse -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/detail/utils.h b/cpp/include/raft/sparse/detail/utils.h index 97577568f4..f0ea2c37b8 100644 --- a/cpp/include/raft/sparse/detail/utils.h +++ b/cpp/include/raft/sparse/detail/utils.h @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft { +#include +namespace RAFT_EXPORT raft { namespace sparse { /** @@ -105,4 +106,4 @@ __device__ indT get_stop_idx(T row, T m, indT nnz, const indT* ind) } }; // namespace sparse -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/add.cuh b/cpp/include/raft/sparse/linalg/add.cuh index 03cf6c37dd..23274d816f 100644 --- a/cpp/include/raft/sparse/linalg/add.cuh +++ b/cpp/include/raft/sparse/linalg/add.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SPARSE_ADD_H @@ -7,9 +7,10 @@ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { @@ -83,6 +84,6 @@ void csr_add_finalize(const int* a_ind, }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/linalg/degree.cuh b/cpp/include/raft/sparse/linalg/degree.cuh index a746ee80bd..5e981d0734 100644 --- a/cpp/include/raft/sparse/linalg/degree.cuh +++ b/cpp/include/raft/sparse/linalg/degree.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SPARSE_DEGREE_H @@ -7,10 +7,11 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { @@ -107,6 +108,6 @@ void coo_degree_nz(COO* in, int* results, cudaStream_t stream) }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/linalg/detail/add.cuh b/cpp/include/raft/sparse/linalg/detail/add.cuh index d31673d924..683597c028 100644 --- a/cpp/include/raft/sparse/linalg/detail/add.cuh +++ b/cpp/include/raft/sparse/linalg/detail/add.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -23,7 +24,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -237,4 +238,4 @@ void csr_add_finalize(const int* a_ind, }; // end NAMESPACE detail }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/cusparse_utils.hpp b/cpp/include/raft/sparse/linalg/detail/cusparse_utils.hpp index 7f31b1f6a8..a29d20abf9 100644 --- a/cpp/include/raft/sparse/linalg/detail/cusparse_utils.hpp +++ b/cpp/include/raft/sparse/linalg/detail/cusparse_utils.hpp @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -14,7 +15,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -134,4 +135,4 @@ inline cusparseOperation_t convert_operation(const raft::linalg::Operation op) } // end namespace detail } // end namespace linalg } // end namespace sparse -} // end namespace raft +} // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/degree.cuh b/cpp/include/raft/sparse/linalg/detail/degree.cuh index c762af12c8..cecd1b35cd 100644 --- a/cpp/include/raft/sparse/linalg/detail/degree.cuh +++ b/cpp/include/raft/sparse/linalg/detail/degree.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -14,7 +15,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -111,4 +112,4 @@ void coo_degree_nz(const idx_t* rows, const T* vals, nnz_t nnz, idx_t* results, }; // end NAMESPACE detail }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/laplacian.cuh b/cpp/include/raft/sparse/linalg/detail/laplacian.cuh index 2763e2d55d..47e25a9905 100644 --- a/cpp/include/raft/sparse/linalg/detail/laplacian.cuh +++ b/cpp/include/raft/sparse/linalg/detail/laplacian.cuh @@ -18,7 +18,8 @@ #include -namespace raft::sparse::linalg::detail { +namespace RAFT_EXPORT raft { +namespace sparse::linalg::detail { struct zero_to_one_functor { template @@ -280,4 +281,5 @@ auto laplacian_normalized(raft::resources const& res, return laplacian; } -} // namespace raft::sparse::linalg::detail +} // namespace sparse::linalg::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/masked_matmul.cuh b/cpp/include/raft/sparse/linalg/detail/masked_matmul.cuh index 2cf55f28dc..0a72ae76f5 100644 --- a/cpp/include/raft/sparse/linalg/detail/masked_matmul.cuh +++ b/cpp/include/raft/sparse/linalg/detail/masked_matmul.cuh @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include #include +#include #include #include #include @@ -22,7 +23,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -156,4 +157,4 @@ void masked_matmul(raft::resources const& handle, } // namespace detail } // namespace linalg } // namespace sparse -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/norm.cuh b/cpp/include/raft/sparse/linalg/detail/norm.cuh index 0173e1ad82..c12906d8e7 100644 --- a/cpp/include/raft/sparse/linalg/detail/norm.cuh +++ b/cpp/include/raft/sparse/linalg/detail/norm.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -24,7 +25,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -221,4 +222,4 @@ void rowNormCsrCaller(const IdxType* ia, }; // end NAMESPACE detail }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/sddmm.hpp b/cpp/include/raft/sparse/linalg/detail/sddmm.hpp index c9f80ee340..b9c9b25c38 100644 --- a/cpp/include/raft/sparse/linalg/detail/sddmm.hpp +++ b/cpp/include/raft/sparse/linalg/detail/sddmm.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -13,7 +14,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -81,4 +82,4 @@ void sddmm(raft::resources const& handle, } // end namespace detail } // end namespace linalg } // end namespace sparse -} // end namespace raft +} // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/spmm.hpp b/cpp/include/raft/sparse/linalg/detail/spmm.hpp index b621940c2b..d3bc721d8d 100644 --- a/cpp/include/raft/sparse/linalg/detail/spmm.hpp +++ b/cpp/include/raft/sparse/linalg/detail/spmm.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -12,7 +13,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -105,4 +106,4 @@ void spmm(raft::resources const& handle, } // end namespace detail } // end namespace linalg } // end namespace sparse -} // end namespace raft +} // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/symmetrize.cuh b/cpp/include/raft/sparse/linalg/detail/symmetrize.cuh index d82932a9d8..c55d72d718 100644 --- a/cpp/include/raft/sparse/linalg/detail/symmetrize.cuh +++ b/cpp/include/raft/sparse/linalg/detail/symmetrize.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -32,7 +33,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -424,4 +425,4 @@ void symmetrize(raft::resources const& handle, }; // end NAMESPACE detail }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/transpose.h b/cpp/include/raft/sparse/linalg/detail/transpose.h index 42e6930f77..c379715347 100644 --- a/cpp/include/raft/sparse/linalg/detail/transpose.h +++ b/cpp/include/raft/sparse/linalg/detail/transpose.h @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -22,7 +23,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -96,4 +97,4 @@ void csr_transpose(cusparseHandle_t handle, }; // end NAMESPACE detail }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/detail/utils.cuh b/cpp/include/raft/sparse/linalg/detail/utils.cuh index 75a8f08113..f36c2aff5a 100644 --- a/cpp/include/raft/sparse/linalg/detail/utils.cuh +++ b/cpp/include/raft/sparse/linalg/detail/utils.cuh @@ -5,13 +5,14 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { namespace detail { @@ -157,4 +158,4 @@ void faster_dot_on_csr(raft::resources const& handle, } // namespace detail } // namespace linalg } // namespace sparse -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/laplacian.cuh b/cpp/include/raft/sparse/linalg/laplacian.cuh index 5b43b2e4d5..df4fdec402 100644 --- a/cpp/include/raft/sparse/linalg/laplacian.cuh +++ b/cpp/include/raft/sparse/linalg/laplacian.cuh @@ -3,12 +3,14 @@ * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft::sparse::linalg { +namespace RAFT_EXPORT raft { +namespace sparse::linalg { /** Given a CSR adjacency matrix, return the graph Laplacian * @@ -97,4 +99,5 @@ auto laplacian_normalized(raft::resources const& res, RowType>(res, input, diagonal_out); } -} // namespace raft::sparse::linalg +} // namespace sparse::linalg +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/masked_matmul.cuh b/cpp/include/raft/sparse/linalg/masked_matmul.cuh index c33b51437b..9780bf0420 100644 --- a/cpp/include/raft/sparse/linalg/masked_matmul.cuh +++ b/cpp/include/raft/sparse/linalg/masked_matmul.cuh @@ -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 #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { @@ -103,4 +104,4 @@ void masked_matmul(raft::resources const& handle, } // end namespace linalg } // end namespace sparse -} // end namespace raft +} // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/norm.cuh b/cpp/include/raft/sparse/linalg/norm.cuh index 70a78c7d90..5365d4fa5e 100644 --- a/cpp/include/raft/sparse/linalg/norm.cuh +++ b/cpp/include/raft/sparse/linalg/norm.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SPARSE_NORM_H @@ -7,11 +7,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { @@ -91,6 +92,6 @@ void rowNormCsr(raft::resources const& handle, }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/linalg/sddmm.hpp b/cpp/include/raft/sparse/linalg/sddmm.hpp index 62516a635c..2e584a4313 100644 --- a/cpp/include/raft/sparse/linalg/sddmm.hpp +++ b/cpp/include/raft/sparse/linalg/sddmm.hpp @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { @@ -72,4 +73,4 @@ void sddmm(raft::resources const& handle, } // end namespace linalg } // end namespace sparse -} // end namespace raft +} // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/linalg/spmm.hpp b/cpp/include/raft/sparse/linalg/spmm.hpp index 2d5e766f45..28783585b1 100644 --- a/cpp/include/raft/sparse/linalg/spmm.hpp +++ b/cpp/include/raft/sparse/linalg/spmm.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SPMM_H @@ -7,10 +7,11 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { @@ -80,6 +81,6 @@ void spmm(raft::resources const& handle, } // end namespace linalg } // end namespace sparse -} // end namespace raft +} // end namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/linalg/symmetrize.cuh b/cpp/include/raft/sparse/linalg/symmetrize.cuh index ec444ba6c7..fb1fe5b720 100644 --- a/cpp/include/raft/sparse/linalg/symmetrize.cuh +++ b/cpp/include/raft/sparse/linalg/symmetrize.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SYMMETRIZE_H @@ -7,10 +7,11 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { @@ -171,6 +172,6 @@ void symmetrize(raft::resources const& handle, }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/linalg/transpose.cuh b/cpp/include/raft/sparse/linalg/transpose.cuh index 9d080a4b57..23342dbc34 100644 --- a/cpp/include/raft/sparse/linalg/transpose.cuh +++ b/cpp/include/raft/sparse/linalg/transpose.cuh @@ -1,15 +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 #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace linalg { @@ -57,4 +58,4 @@ void csr_transpose(raft::resources const& handle, }; // end NAMESPACE linalg }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/matrix/detail/diagonal.cuh b/cpp/include/raft/sparse/matrix/detail/diagonal.cuh index b9f4186b62..ace10a3e6c 100644 --- a/cpp/include/raft/sparse/matrix/detail/diagonal.cuh +++ b/cpp/include/raft/sparse/matrix/detail/diagonal.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -12,7 +13,8 @@ #include #include -namespace raft::sparse::matrix::detail { +namespace RAFT_EXPORT raft { +namespace sparse::matrix::detail { /** * @brief Get the diagonal vector from a CSR matrix @@ -249,4 +251,5 @@ void set_diagonal(raft::resources const& res, }); } -} // namespace raft::sparse::matrix::detail +} // namespace sparse::matrix::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/matrix/detail/preprocessing.cuh b/cpp/include/raft/sparse/matrix/detail/preprocessing.cuh index 6c45a15527..1521614f1d 100644 --- a/cpp/include/raft/sparse/matrix/detail/preprocessing.cuh +++ b/cpp/include/raft/sparse/matrix/detail/preprocessing.cuh @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -13,7 +14,8 @@ #include -namespace raft::sparse::matrix::detail { +namespace RAFT_EXPORT raft { +namespace sparse::matrix::detail { /** * @brief Get unique counts @@ -210,4 +212,5 @@ void transform_tfidf(raft::resources const& handle, }); } -} // namespace raft::sparse::matrix::detail +} // namespace sparse::matrix::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/matrix/detail/select_k-inl.cuh b/cpp/include/raft/sparse/matrix/detail/select_k-inl.cuh index b788f5244c..a3893f2c19 100644 --- a/cpp/include/raft/sparse/matrix/detail/select_k-inl.cuh +++ b/cpp/include/raft/sparse/matrix/detail/select_k-inl.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -18,7 +19,8 @@ #include -namespace raft::sparse::matrix::detail { +namespace RAFT_EXPORT raft { +namespace sparse::matrix::detail { using namespace raft::matrix::detail; using raft::matrix::SelectAlgo; @@ -215,4 +217,5 @@ void select_k(raft::resources const& handle, return; } -} // namespace raft::sparse::matrix::detail +} // namespace sparse::matrix::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/matrix/diagonal.cuh b/cpp/include/raft/sparse/matrix/diagonal.cuh index 2287a28303..d9c3235675 100644 --- a/cpp/include/raft/sparse/matrix/diagonal.cuh +++ b/cpp/include/raft/sparse/matrix/diagonal.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -13,7 +14,8 @@ #include #include -namespace raft::sparse::matrix { +namespace RAFT_EXPORT raft { +namespace sparse::matrix { /** * @brief Get the diagonal vector from a CSR matrix @@ -156,4 +158,5 @@ void set_diagonal(raft::resources const& res, detail::set_diagonal(res, coo_matrix_view, scalar); } -} // namespace raft::sparse::matrix +} // namespace sparse::matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/matrix/preprocessing.cuh b/cpp/include/raft/sparse/matrix/preprocessing.cuh index 4d70fd67fa..721ccb82f2 100644 --- a/cpp/include/raft/sparse/matrix/preprocessing.cuh +++ b/cpp/include/raft/sparse/matrix/preprocessing.cuh @@ -5,12 +5,14 @@ #pragma once +#include #include #include #include #include -namespace raft::sparse::matrix { +namespace RAFT_EXPORT raft { +namespace sparse::matrix { /** * @brief This function calculate the tf-idf values for each entry in the COO sparse * matrix @@ -205,4 +207,5 @@ void encode_bm25(raft::resources const& handle, results); } -} // namespace raft::sparse::matrix +} // namespace sparse::matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/matrix/select_k.cuh b/cpp/include/raft/sparse/matrix/select_k.cuh index 2dd26ea344..a8b46a1f3d 100644 --- a/cpp/include/raft/sparse/matrix/select_k.cuh +++ b/cpp/include/raft/sparse/matrix/select_k.cuh @@ -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 #include #include #include @@ -15,7 +16,8 @@ #include -namespace raft::sparse::matrix { +namespace RAFT_EXPORT raft { +namespace sparse::matrix { using SelectAlgo = raft::matrix::SelectAlgo; @@ -73,4 +75,5 @@ void select_k(raft::resources const& handle, } /** @} */ // end of group select_k -} // namespace raft::sparse::matrix +} // namespace sparse::matrix +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/op/detail/filter.cuh b/cpp/include/raft/sparse/op/detail/filter.cuh index 642b673cb6..986bf8b569 100644 --- a/cpp/include/raft/sparse/op/detail/filter.cuh +++ b/cpp/include/raft/sparse/op/detail/filter.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -29,7 +30,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { namespace detail { @@ -272,4 +273,4 @@ void coo_remove_zeros(COO* in, COO* out, cudaS }; // namespace detail }; // namespace op }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/op/detail/reduce.cuh b/cpp/include/raft/sparse/op/detail/reduce.cuh index 6fc529b758..770e7c4a5b 100644 --- a/cpp/include/raft/sparse/op/detail/reduce.cuh +++ b/cpp/include/raft/sparse/op/detail/reduce.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -28,7 +29,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { namespace detail { @@ -149,4 +150,4 @@ void max_duplicates(raft::resources const& handle, }; // END namespace detail }; // END namespace op }; // END namespace sparse -}; // END namespace raft +}; // END namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/op/detail/row_op.cuh b/cpp/include/raft/sparse/op/detail/row_op.cuh index 40c5ad49d7..92815af214 100644 --- a/cpp/include/raft/sparse/op/detail/row_op.cuh +++ b/cpp/include/raft/sparse/op/detail/row_op.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -20,7 +21,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { namespace detail { @@ -60,4 +61,4 @@ void csr_row_op(const Index_* row_ind, Index_ n_rows, Index_ nnz, Lambda op, cud }; // namespace detail }; // namespace op }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/op/detail/slice.cuh b/cpp/include/raft/sparse/op/detail/slice.cuh index 6b89d3b3ba..da68fb1725 100644 --- a/cpp/include/raft/sparse/op/detail/slice.cuh +++ b/cpp/include/raft/sparse/op/detail/slice.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -22,7 +23,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { namespace detail { @@ -93,4 +94,4 @@ void csr_row_slice_populate(value_idx start_offset, }; // namespace detail }; // namespace op }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/op/detail/sort.h b/cpp/include/raft/sparse/op/detail/sort.h index febe91adb9..5d918c3015 100644 --- a/cpp/include/raft/sparse/op/detail/sort.h +++ b/cpp/include/raft/sparse/op/detail/sort.h @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -24,7 +25,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { namespace detail { @@ -102,4 +103,4 @@ void coo_sort_by_weight( }; // namespace detail }; // namespace op }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/op/filter.cuh b/cpp/include/raft/sparse/op/filter.cuh index 28c54ccd8a..6d3eee6e25 100644 --- a/cpp/include/raft/sparse/op/filter.cuh +++ b/cpp/include/raft/sparse/op/filter.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __FILTER_H @@ -7,13 +7,14 @@ #pragma once +#include #include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { @@ -100,6 +101,6 @@ void coo_remove_zeros(COO* in, COO* out, cudaS }; // namespace op }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/op/reduce.cuh b/cpp/include/raft/sparse/op/reduce.cuh index e1b52c9645..a32a089f4b 100644 --- a/cpp/include/raft/sparse/op/reduce.cuh +++ b/cpp/include/raft/sparse/op/reduce.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SPARSE_REDUCE_H @@ -7,11 +7,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { /** @@ -71,6 +72,6 @@ void max_duplicates(raft::resources const& handle, } }; // END namespace op }; // END namespace sparse -}; // END namespace raft +}; // END namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/op/row_op.cuh b/cpp/include/raft/sparse/op/row_op.cuh index 621b112d83..d8e0b7896d 100644 --- a/cpp/include/raft/sparse/op/row_op.cuh +++ b/cpp/include/raft/sparse/op/row_op.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SPARSE_ROW_OP_H #define __SPARSE_ROW_OP_H #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { @@ -32,6 +33,6 @@ void csr_row_op(const Index_* row_ind, Index_ n_rows, Index_ nnz, Lambda op, cud }; // namespace op }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/op/slice.cuh b/cpp/include/raft/sparse/op/slice.cuh index b3b9eaa1f2..6f63fd70b5 100644 --- a/cpp/include/raft/sparse/op/slice.cuh +++ b/cpp/include/raft/sparse/op/slice.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SLICE_H @@ -7,10 +7,11 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { @@ -65,6 +66,6 @@ void csr_row_slice_populate(value_idx start_offset, }; // namespace op }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/op/sort.cuh b/cpp/include/raft/sparse/op/sort.cuh index 7a5eaacdd7..9b8e3ae4cf 100644 --- a/cpp/include/raft/sparse/op/sort.cuh +++ b/cpp/include/raft/sparse/op/sort.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SPARSE_SORT_H @@ -7,10 +7,11 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace sparse { namespace op { @@ -63,6 +64,6 @@ void coo_sort_by_weight( } }; // namespace op }; // end NAMESPACE sparse -}; // end NAMESPACE raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/solver/detail/lanczos.cuh b/cpp/include/raft/sparse/solver/detail/lanczos.cuh index c0acf7a975..33231a6fe7 100644 --- a/cpp/include/raft/sparse/solver/detail/lanczos.cuh +++ b/cpp/include/raft/sparse/solver/detail/lanczos.cuh @@ -66,7 +66,8 @@ #include #include -namespace raft::sparse::solver::detail { +namespace RAFT_EXPORT raft { +namespace sparse::solver::detail { template RAFT_KERNEL kernel_triangular_populate(T* M, const T* beta, int n) @@ -794,4 +795,5 @@ auto lanczos_compute_eigenpairs( } } -} // namespace raft::sparse::solver::detail +} // namespace sparse::solver::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/solver/detail/mst_kernels.cuh b/cpp/include/raft/sparse/solver/detail/mst_kernels.cuh index 57a363c480..3569f7a1cf 100644 --- a/cpp/include/raft/sparse/solver/detail/mst_kernels.cuh +++ b/cpp/include/raft/sparse/solver/detail/mst_kernels.cuh @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::sparse::solver::detail { +namespace RAFT_EXPORT raft { +namespace sparse::solver::detail { template RAFT_KERNEL kernel_min_edge_per_vertex(const edge_t* offsets, @@ -318,4 +320,5 @@ RAFT_KERNEL kernel_count_new_mst_edges(const vertex_t* mst_src, if (threadIdx.x == 0 && block_count > 0) { atomicAdd(mst_edge_count, block_count); } } -} // namespace raft::sparse::solver::detail +} // namespace sparse::solver::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/solver/detail/mst_solver_inl.cuh b/cpp/include/raft/sparse/solver/detail/mst_solver_inl.cuh index b5ce43e074..fe76d631bd 100644 --- a/cpp/include/raft/sparse/solver/detail/mst_solver_inl.cuh +++ b/cpp/include/raft/sparse/solver/detail/mst_solver_inl.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -33,7 +34,8 @@ #include -namespace raft::sparse::solver { +namespace RAFT_EXPORT raft { +namespace sparse::solver { // curand generator uniform inline curandStatus_t curand_generate_uniformX(curandGenerator_t generator, @@ -400,4 +402,5 @@ void MST_solver::append_src_dst_pair( src_dst_zip_end, new_edges_functor()); } -} // namespace raft::sparse::solver +} // namespace sparse::solver +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/solver/detail/mst_utils.cuh b/cpp/include/raft/sparse/solver/detail/mst_utils.cuh index 12c24638ce..60936f03e1 100644 --- a/cpp/include/raft/sparse/solver/detail/mst_utils.cuh +++ b/cpp/include/raft/sparse/solver/detail/mst_utils.cuh @@ -1,16 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include #include -namespace raft::sparse::solver::detail { +namespace RAFT_EXPORT raft { +namespace sparse::solver::detail { template __device__ idx_t get_1D_idx() @@ -18,4 +21,5 @@ __device__ idx_t get_1D_idx() return blockIdx.x * blockDim.x + threadIdx.x; } -} // namespace raft::sparse::solver::detail +} // namespace sparse::solver::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/solver/lanczos.cuh b/cpp/include/raft/sparse/solver/lanczos.cuh index ffa89ce159..45a53ce0f4 100644 --- a/cpp/include/raft/sparse/solver/lanczos.cuh +++ b/cpp/include/raft/sparse/solver/lanczos.cuh @@ -7,11 +7,13 @@ #pragma once +#include #include #include #include -namespace raft::sparse::solver { +namespace RAFT_EXPORT raft { +namespace sparse::solver { // ========================================================= // Eigensolver @@ -112,6 +114,7 @@ auto lanczos_compute_eigenpairs( handle, config, csr_matrix, v0, eigenvalues, eigenvectors); } -} // namespace raft::sparse::solver +} // namespace sparse::solver +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/sparse/solver/lanczos_types.hpp b/cpp/include/raft/sparse/solver/lanczos_types.hpp index afadf91ad9..567e00e7c0 100644 --- a/cpp/include/raft/sparse/solver/lanczos_types.hpp +++ b/cpp/include/raft/sparse/solver/lanczos_types.hpp @@ -1,14 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include #include -namespace raft::sparse::solver { +namespace RAFT_EXPORT raft { +namespace sparse::solver { /** * @enum LANCZOS_WHICH @@ -64,4 +67,5 @@ struct lanczos_solver_config { std::optional seed = std::nullopt; }; -} // namespace raft::sparse::solver +} // namespace sparse::solver +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/solver/mst.cuh b/cpp/include/raft/sparse/solver/mst.cuh index 96d272f22d..060ae61b63 100644 --- a/cpp/include/raft/sparse/solver/mst.cuh +++ b/cpp/include/raft/sparse/solver/mst.cuh @@ -1,13 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft::sparse::solver { +namespace RAFT_EXPORT raft { +namespace sparse::solver { /** * Compute the minimum spanning tree (MST) or minimum spanning forest (MSF) depending on @@ -59,4 +61,5 @@ Graph_COO mst(raft::resources const& handle, return mst_solver.solve(); } -} // end namespace raft::sparse::solver +} // end namespace sparse::solver +} // end namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/sparse/solver/mst_solver.cuh b/cpp/include/raft/sparse/solver/mst_solver.cuh index 72cb08fac8..56a49c4706 100644 --- a/cpp/include/raft/sparse/solver/mst_solver.cuh +++ b/cpp/include/raft/sparse/solver/mst_solver.cuh @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft::sparse::solver { +namespace RAFT_EXPORT raft { +namespace sparse::solver { template struct Graph_COO { @@ -87,6 +89,7 @@ class MST_solver { void append_src_dst_pair(vertex_t* mst_src, vertex_t* mst_dst, weight_t* mst_weights); }; -} // namespace raft::sparse::solver +} // namespace sparse::solver +} // namespace RAFT_EXPORT raft #include diff --git a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp index 33df6cbf27..e3ea04de31 100644 --- a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp +++ b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -34,7 +35,7 @@ // Get index of matrix entry #define IDX(i, j, lda) ((size_t)(i) + (j) * (lda)) -namespace raft { +namespace RAFT_EXPORT raft { namespace spectral { namespace matrix { namespace detail { @@ -473,4 +474,4 @@ struct modularity_matrix_t : laplacian_matrix_t #include #include #include @@ -23,7 +24,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace spectral { namespace detail { @@ -84,4 +85,4 @@ void analyzeModularity( } // namespace detail } // namespace spectral -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/spectral/detail/partition.hpp b/cpp/include/raft/spectral/detail/partition.hpp index 4c6ed1eaa5..d290752da6 100644 --- a/cpp/include/raft/spectral/detail/partition.hpp +++ b/cpp/include/raft/spectral/detail/partition.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -21,7 +22,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace spectral { namespace detail { @@ -93,4 +94,4 @@ void analyzePartition(raft::resources const& handle, } // namespace detail } // namespace spectral -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/spectral/detail/spectral_util.cuh b/cpp/include/raft/spectral/detail/spectral_util.cuh index 72e05d5e6e..a856907316 100644 --- a/cpp/include/raft/spectral/detail/spectral_util.cuh +++ b/cpp/include/raft/spectral/detail/spectral_util.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -25,7 +26,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace spectral { template @@ -165,4 +166,4 @@ bool construct_indicator( } } // namespace spectral -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/spectral/matrix_wrappers.hpp b/cpp/include/raft/spectral/matrix_wrappers.hpp index bc749ad8ad..aa008813da 100644 --- a/cpp/include/raft/spectral/matrix_wrappers.hpp +++ b/cpp/include/raft/spectral/matrix_wrappers.hpp @@ -1,16 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include // ========================================================= // Useful macros // ========================================================= -namespace raft { +namespace RAFT_EXPORT raft { namespace spectral { namespace matrix { @@ -35,4 +36,4 @@ using detail::modularity_matrix_t; } // namespace matrix } // namespace spectral -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/spectral/modularity_maximization.cuh b/cpp/include/raft/spectral/modularity_maximization.cuh index 5ba217707b..9f4b996bcf 100644 --- a/cpp/include/raft/spectral/modularity_maximization.cuh +++ b/cpp/include/raft/spectral/modularity_maximization.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MODULARITY_MAXIMIZATION_H @@ -7,11 +7,12 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace spectral { //=================================================== @@ -38,6 +39,6 @@ void analyzeModularity(raft::resources const& handle, } } // namespace spectral -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/spectral/partition.cuh b/cpp/include/raft/spectral/partition.cuh index 3cded3b662..fcea8bf1a9 100644 --- a/cpp/include/raft/spectral/partition.cuh +++ b/cpp/include/raft/spectral/partition.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace spectral { // ========================================================= @@ -46,6 +47,6 @@ void analyzePartition(raft::resources const& handle, } } // namespace spectral -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/accuracy.cuh b/cpp/include/raft/stats/accuracy.cuh index 6b96d4a5e7..d4609edb32 100644 --- a/cpp/include/raft/stats/accuracy.cuh +++ b/cpp/include/raft/stats/accuracy.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -62,6 +63,6 @@ float accuracy(raft::resources const& handle, /** @} */ // end group stats_accuracy } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/adjusted_rand_index.cuh b/cpp/include/raft/stats/adjusted_rand_index.cuh index 5ab6e14e14..efdea3910e 100644 --- a/cpp/include/raft/stats/adjusted_rand_index.cuh +++ b/cpp/include/raft/stats/adjusted_rand_index.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /** @@ -13,11 +13,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -74,6 +75,5 @@ double adjusted_rand_index(raft::resources const& handle, /** @} */ // end group stats_adj_rand_index }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/completeness_score.cuh b/cpp/include/raft/stats/completeness_score.cuh index 324e7b47f8..1c8a4253ba 100644 --- a/cpp/include/raft/stats/completeness_score.cuh +++ b/cpp/include/raft/stats/completeness_score.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -75,6 +76,5 @@ double completeness_score(raft::resources const& handle, /** @} */ // end group stats_completeness }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/contingency_matrix.cuh b/cpp/include/raft/stats/contingency_matrix.cuh index d49a4372b5..1be3c6a3a9 100644 --- a/cpp/include/raft/stats/contingency_matrix.cuh +++ b/cpp/include/raft/stats/contingency_matrix.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -15,7 +16,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -201,6 +202,5 @@ void contingency_matrix(Args... args) contingency_matrix(std::forward(args)..., std::nullopt, std::nullopt); } }; // namespace stats -}; // namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/cov.cuh b/cpp/include/raft/stats/cov.cuh index 4742c1d714..6dbfd8a960 100644 --- a/cpp/include/raft/stats/cov.cuh +++ b/cpp/include/raft/stats/cov.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,10 +8,11 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** * @brief Compute covariance of the input matrix @@ -103,6 +104,5 @@ void cov(raft::resources const& handle, /** @} */ // end group stats_cov }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/detail/adjusted_rand_index.cuh b/cpp/include/raft/stats/detail/adjusted_rand_index.cuh index 3161b9c423..22abe2f05e 100644 --- a/cpp/include/raft/stats/detail/adjusted_rand_index.cuh +++ b/cpp/include/raft/stats/detail/adjusted_rand_index.cuh @@ -13,6 +13,7 @@ #include "contingencyMatrix.cuh" +#include #include #include #include @@ -28,7 +29,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -192,4 +193,4 @@ double compute_adjusted_rand_index(const T* firstClusterArray, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/batched/information_criterion.cuh b/cpp/include/raft/stats/detail/batched/information_criterion.cuh index 1a5b41fc27..ad9464d1a6 100644 --- a/cpp/include/raft/stats/detail/batched/information_criterion.cuh +++ b/cpp/include/raft/stats/detail/batched/information_criterion.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace batched { namespace detail { @@ -60,4 +61,4 @@ void information_criterion(ScalarT* d_ic, } // namespace detail } // namespace batched } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/batched/silhouette_score.cuh b/cpp/include/raft/stats/detail/batched/silhouette_score.cuh index a0fb863122..b9d1127602 100644 --- a/cpp/include/raft/stats/detail/batched/silhouette_score.cuh +++ b/cpp/include/raft/stats/detail/batched/silhouette_score.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,7 @@ #include "../silhouette_score.cuh" +#include #include #include #include @@ -20,7 +21,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace batched { namespace detail { @@ -267,4 +268,4 @@ value_t silhouette_score( } // namespace detail } // namespace batched } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/contingencyMatrix.cuh b/cpp/include/raft/stats/detail/contingencyMatrix.cuh index faa91abffa..94363d34ec 100644 --- a/cpp/include/raft/stats/detail/contingencyMatrix.cuh +++ b/cpp/include/raft/stats/detail/contingencyMatrix.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include @@ -16,7 +17,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -301,4 +302,4 @@ void contingencyMatrix(const T* groundTruth, }; // namespace detail }; // namespace stats -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/cov.cuh b/cpp/include/raft/stats/detail/cov.cuh index f6beec8396..c179a049e1 100644 --- a/cpp/include/raft/stats/detail/cov.cuh +++ b/cpp/include/raft/stats/detail/cov.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { /** @@ -61,4 +62,4 @@ void cov(raft::resources const& handle, } }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/dispersion.cuh b/cpp/include/raft/stats/detail/dispersion.cuh index 2a81c7624c..f60889b9e9 100644 --- a/cpp/include/raft/stats/detail/dispersion.cuh +++ b/cpp/include/raft/stats/detail/dispersion.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -16,7 +17,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -127,4 +128,4 @@ DataT dispersion(const DataT* centroids, } // end namespace detail } // end namespace stats -} // end namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/entropy.cuh b/cpp/include/raft/stats/detail/entropy.cuh index 3cfd0ad582..53961c2965 100644 --- a/cpp/include/raft/stats/detail/entropy.cuh +++ b/cpp/include/raft/stats/detail/entropy.cuh @@ -9,6 +9,7 @@ */ #pragma once +#include #include #include #include @@ -21,7 +22,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -143,4 +144,4 @@ double entropy(const T* clusterArray, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/histogram.cuh b/cpp/include/raft/stats/detail/histogram.cuh index a5c17e19a0..d70aec3730 100644 --- a/cpp/include/raft/stats/detail/histogram.cuh +++ b/cpp/include/raft/stats/detail/histogram.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -18,7 +19,7 @@ ///@todo: add cub's histogram as another option -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -483,4 +484,4 @@ void histogram(HistType type, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/homogeneity_score.cuh b/cpp/include/raft/stats/detail/homogeneity_score.cuh index 4582a1f43e..d94f53428f 100644 --- a/cpp/include/raft/stats/detail/homogeneity_score.cuh +++ b/cpp/include/raft/stats/detail/homogeneity_score.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /** @@ -11,10 +11,11 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { /** @@ -57,4 +58,4 @@ double homogeneity_score(const T* truthClusterArray, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/kl_divergence.cuh b/cpp/include/raft/stats/detail/kl_divergence.cuh index 8750b3be82..7874a28c0c 100644 --- a/cpp/include/raft/stats/detail/kl_divergence.cuh +++ b/cpp/include/raft/stats/detail/kl_divergence.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /** @@ -10,6 +10,7 @@ #pragma once +#include #include #include #include @@ -18,7 +19,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -72,4 +73,4 @@ DataT kl_divergence(const DataT* modelPDF, const DataT* candidatePDF, int size, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/mean.cuh b/cpp/include/raft/stats/detail/mean.cuh index 4f9420919d..93e8d81ad8 100644 --- a/cpp/include/raft/stats/detail/mean.cuh +++ b/cpp/include/raft/stats/detail/mean.cuh @@ -5,11 +5,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -48,4 +49,4 @@ template } // namespace detail } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/mean_center.cuh b/cpp/include/raft/stats/detail/mean_center.cuh index 05c350d3d0..9c902b7212 100644 --- a/cpp/include/raft/stats/detail/mean_center.cuh +++ b/cpp/include/raft/stats/detail/mean_center.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -58,4 +59,4 @@ void meanAdd(Type* out, const Type* data, const Type* mu, IdxType D, IdxType N, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/meanvar.cuh b/cpp/include/raft/stats/detail/meanvar.cuh index ef87ac86aa..8d60925809 100644 --- a/cpp/include/raft/stats/detail/meanvar.cuh +++ b/cpp/include/raft/stats/detail/meanvar.cuh @@ -1,14 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include -namespace raft::stats::detail { +namespace RAFT_EXPORT raft { +namespace stats::detail { template class mean_var { @@ -216,4 +218,5 @@ void meanvar( RAFT_CHECK_CUDA(stream); } -}; // namespace raft::stats::detail +}; // namespace stats::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/minmax.cuh b/cpp/include/raft/stats/detail/minmax.cuh index c783d4a436..458083eca8 100644 --- a/cpp/include/raft/stats/detail/minmax.cuh +++ b/cpp/include/raft/stats/detail/minmax.cuh @@ -1,16 +1,17 @@ /* - * 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 #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -224,4 +225,4 @@ void minmax(const T* data, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/mutual_info_score.cuh b/cpp/include/raft/stats/detail/mutual_info_score.cuh index 85bca8b273..8e95468a6a 100644 --- a/cpp/include/raft/stats/detail/mutual_info_score.cuh +++ b/cpp/include/raft/stats/detail/mutual_info_score.cuh @@ -14,6 +14,7 @@ */ #pragma once +#include #include #include #include @@ -27,7 +28,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -162,4 +163,4 @@ double mutual_info_score(const T* firstClusterArray, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/neighborhood_recall.cuh b/cpp/include/raft/stats/detail/neighborhood_recall.cuh index 503e9cbb19..1a79cb1a84 100644 --- a/cpp/include/raft/stats/detail/neighborhood_recall.cuh +++ b/cpp/include/raft/stats/detail/neighborhood_recall.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -20,7 +21,8 @@ #include #include -namespace raft::stats::detail { +namespace RAFT_EXPORT raft { +namespace stats::detail { template #include #include #include @@ -51,7 +52,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -158,4 +159,4 @@ double compute_rand_index(const T* firstClusterArray, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/scores.cuh b/cpp/include/raft/stats/detail/scores.cuh index 400b1828f2..8c680e3a46 100644 --- a/cpp/include/raft/stats/detail/scores.cuh +++ b/cpp/include/raft/stats/detail/scores.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -24,7 +25,7 @@ #define N_THREADS 512 -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { /** @@ -205,4 +206,4 @@ void regression_metrics(const T* predictions, } } // namespace detail } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/silhouette_score.cuh b/cpp/include/raft/stats/detail/silhouette_score.cuh index d81000d726..5767516096 100644 --- a/cpp/include/raft/stats/detail/silhouette_score.cuh +++ b/cpp/include/raft/stats/detail/silhouette_score.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -27,7 +28,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -308,4 +309,4 @@ DataT silhouette_score( }; // namespace detail }; // namespace stats -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/stddev.cuh b/cpp/include/raft/stats/detail/stddev.cuh index ed9c496909..f99d731335 100644 --- a/cpp/include/raft/stats/detail/stddev.cuh +++ b/cpp/include/raft/stats/detail/stddev.cuh @@ -5,12 +5,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -102,4 +103,4 @@ void vars(Type* var, } // namespace detail } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/sum.cuh b/cpp/include/raft/stats/detail/sum.cuh index 3e19222203..9b6c02003c 100644 --- a/cpp/include/raft/stats/detail/sum.cuh +++ b/cpp/include/raft/stats/detail/sum.cuh @@ -5,11 +5,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -21,4 +22,4 @@ void sum(Type* output, const Type* input, IdxType D, IdxType N, cudaStream_t str } // namespace detail } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/trustworthiness_score.cuh b/cpp/include/raft/stats/detail/trustworthiness_score.cuh index e43d61f2e0..a3c4d50c51 100644 --- a/cpp/include/raft/stats/detail/trustworthiness_score.cuh +++ b/cpp/include/raft/stats/detail/trustworthiness_score.cuh @@ -1,8 +1,9 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include #include @@ -13,7 +14,7 @@ #define N_THREADS 512 -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -207,4 +208,4 @@ double trustworthiness_score(const raft::resources& h, } // namespace detail } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/v_measure.cuh b/cpp/include/raft/stats/detail/v_measure.cuh index ad35dde5be..d6ae299f8f 100644 --- a/cpp/include/raft/stats/detail/v_measure.cuh +++ b/cpp/include/raft/stats/detail/v_measure.cuh @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /** * @file v_measure.cuh */ +#include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -50,4 +51,4 @@ double v_measure(const T* truthClusterArray, }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/detail/weighted_mean.cuh b/cpp/include/raft/stats/detail/weighted_mean.cuh index dca1f70de8..e67fb3e903 100644 --- a/cpp/include/raft/stats/detail/weighted_mean.cuh +++ b/cpp/include/raft/stats/detail/weighted_mean.cuh @@ -1,16 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { namespace detail { @@ -53,4 +54,4 @@ void weightedMean( } }; // end namespace detail }; // end namespace stats -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/dispersion.cuh b/cpp/include/raft/stats/dispersion.cuh index 65a327c093..bc7c0cb4b2 100644 --- a/cpp/include/raft/stats/dispersion.cuh +++ b/cpp/include/raft/stats/dispersion.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,13 +8,14 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -118,6 +119,5 @@ value_t cluster_dispersion( return cluster_dispersion(handle, centroids, cluster_sizes, opt_centroid, n_points); } } // end namespace stats -} // end namespace raft - +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/entropy.cuh b/cpp/include/raft/stats/entropy.cuh index e47f33efbe..45777d306b 100644 --- a/cpp/include/raft/stats/entropy.cuh +++ b/cpp/include/raft/stats/entropy.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,11 +7,12 @@ #define __ENTROPY_H #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -70,6 +71,5 @@ double entropy(raft::resources const& handle, /** @} */ // end group stats_entropy }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/histogram.cuh b/cpp/include/raft/stats/histogram.cuh index 36e2ff64e2..05ae10c6fd 100644 --- a/cpp/include/raft/stats/histogram.cuh +++ b/cpp/include/raft/stats/histogram.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -18,7 +19,7 @@ ///@todo: add cub's histogram as another option -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -105,6 +106,5 @@ void histogram(raft::resources const& handle, /** @} */ // end group stats_histogram }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/homogeneity_score.cuh b/cpp/include/raft/stats/homogeneity_score.cuh index 0a2225f745..d10ed871dc 100644 --- a/cpp/include/raft/stats/homogeneity_score.cuh +++ b/cpp/include/raft/stats/homogeneity_score.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -78,6 +79,5 @@ double homogeneity_score(raft::resources const& handle, /** @} */ // end group stats_homogeneity_score }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/information_criterion.cuh b/cpp/include/raft/stats/information_criterion.cuh index 5b486b9dbc..6b684a299d 100644 --- a/cpp/include/raft/stats/information_criterion.cuh +++ b/cpp/include/raft/stats/information_criterion.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /** @@ -18,13 +18,14 @@ #pragma once +#include #include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -103,5 +104,5 @@ void information_criterion_batched(raft::resources const& handle, /** @} */ // end group stats_information_criterion } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/kl_divergence.cuh b/cpp/include/raft/stats/kl_divergence.cuh index 8c4ab8e07b..15a7da5057 100644 --- a/cpp/include/raft/stats/kl_divergence.cuh +++ b/cpp/include/raft/stats/kl_divergence.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -66,6 +67,5 @@ value_t kl_divergence(raft::resources const& handle, /** @} */ // end group kl_divergence }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/mean.cuh b/cpp/include/raft/stats/mean.cuh index 9739b45e88..6fdb6bfcd6 100644 --- a/cpp/include/raft/stats/mean.cuh +++ b/cpp/include/raft/stats/mean.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,12 +8,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -135,6 +136,5 @@ template /** @} */ // end group stats_mean }; // namespace stats -}; // namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/mean_center.cuh b/cpp/include/raft/stats/mean_center.cuh index 8e09edb7e6..56b9633ab4 100644 --- a/cpp/include/raft/stats/mean_center.cuh +++ b/cpp/include/raft/stats/mean_center.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -138,6 +139,5 @@ void mean_add(raft::resources const& handle, /** @} */ // end group stats_mean_center }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/meanvar.cuh b/cpp/include/raft/stats/meanvar.cuh index 19a74981fe..613bbbb1f1 100644 --- a/cpp/include/raft/stats/meanvar.cuh +++ b/cpp/include/raft/stats/meanvar.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MEANVAR_H @@ -7,11 +7,13 @@ #pragma once +#include #include #include #include -namespace raft::stats { +namespace RAFT_EXPORT raft { +namespace stats { /** * @brief Compute mean and variance for each column of a given matrix. @@ -96,6 +98,6 @@ void meanvar(raft::resources const& handle, /** @} */ // end group stats_mean_var -}; // namespace raft::stats - +}; // namespace stats +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/minmax.cuh b/cpp/include/raft/stats/minmax.cuh index 34ccc93086..122aa73d8b 100644 --- a/cpp/include/raft/stats/minmax.cuh +++ b/cpp/include/raft/stats/minmax.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __MINMAX_H @@ -7,6 +7,7 @@ #pragma once +#include #include #include #include @@ -16,7 +17,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -129,5 +130,5 @@ void minmax(raft::resources const& handle, /** @} */ // end group stats_minmax }; // namespace stats -}; // namespace raft +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/mutual_info_score.cuh b/cpp/include/raft/stats/mutual_info_score.cuh index 1e03e54f16..a3ae98b6ac 100644 --- a/cpp/include/raft/stats/mutual_info_score.cuh +++ b/cpp/include/raft/stats/mutual_info_score.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -76,6 +77,5 @@ double mutual_info_score(raft::resources const& handle, /** @} */ // end group stats_mutual_info }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/neighborhood_recall.cuh b/cpp/include/raft/stats/neighborhood_recall.cuh index b5086d9f1f..9a95e498d7 100644 --- a/cpp/include/raft/stats/neighborhood_recall.cuh +++ b/cpp/include/raft/stats/neighborhood_recall.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,7 @@ #include "detail/neighborhood_recall.cuh" +#include #include #include #include @@ -18,7 +19,8 @@ #include -namespace raft::stats { +namespace RAFT_EXPORT raft { +namespace stats { /** * @defgroup stats_neighborhood_recall Neighborhood Recall Score @@ -180,4 +182,5 @@ void neighborhood_recall( /** @} */ // end group stats_recall -} // end namespace raft::stats +} // namespace stats +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/r2_score.cuh b/cpp/include/raft/stats/r2_score.cuh index 04cfd0c8fe..2cb5dd4bd6 100644 --- a/cpp/include/raft/stats/r2_score.cuh +++ b/cpp/include/raft/stats/r2_score.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,11 +8,12 @@ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -77,6 +78,6 @@ value_t r2_score(raft::resources const& handle, /** @} */ // end group stats_r2_score } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/rand_index.cuh b/cpp/include/raft/stats/rand_index.cuh index b58807c053..534e8e9385 100644 --- a/cpp/include/raft/stats/rand_index.cuh +++ b/cpp/include/raft/stats/rand_index.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __RAND_INDEX_H @@ -7,12 +7,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -62,6 +63,5 @@ double rand_index(raft::resources const& handle, /** @} */ // end group stats_rand_index }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/regression_metrics.cuh b/cpp/include/raft/stats/regression_metrics.cuh index 91798e5991..25e38c49db 100644 --- a/cpp/include/raft/stats/regression_metrics.cuh +++ b/cpp/include/raft/stats/regression_metrics.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __REGRESSION_METRICS_H @@ -7,13 +7,14 @@ #pragma once +#include #include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -91,6 +92,6 @@ void regression_metrics(raft::resources const& handle, /** @} */ // end group stats_regression_metrics } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/silhouette_score.cuh b/cpp/include/raft/stats/silhouette_score.cuh index 9e9af64fc0..647e7562a0 100644 --- a/cpp/include/raft/stats/silhouette_score.cuh +++ b/cpp/include/raft/stats/silhouette_score.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SILHOUETTE_SCORE_H @@ -7,12 +7,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -210,6 +211,5 @@ value_t silhouette_score_batched( handle, X, labels, opt_scores, n_unique_labels, batch_size, metric); } }; // namespace stats -}; // namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/stats_types.hpp b/cpp/include/raft/stats/stats_types.hpp index 8f0c3e304d..705b4ab400 100644 --- a/cpp/include/raft/stats/stats_types.hpp +++ b/cpp/include/raft/stats/stats_types.hpp @@ -1,13 +1,15 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft::stats { +namespace RAFT_EXPORT raft { +namespace stats { /** * @ingroup stats_histogram @@ -62,4 +64,5 @@ enum IC_Type { AIC, AICc, BIC }; /** @} */ -}; // end namespace raft::stats +}; // namespace stats +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/stats/stddev.cuh b/cpp/include/raft/stats/stddev.cuh index 6082c6d70f..c02858f91f 100644 --- a/cpp/include/raft/stats/stddev.cuh +++ b/cpp/include/raft/stats/stddev.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #ifndef __STDDEV_H @@ -7,12 +7,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -168,6 +169,5 @@ void vars(raft::resources const& handle, /** @} */ // end group stats_variance }; // namespace stats -}; // namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/sum.cuh b/cpp/include/raft/stats/sum.cuh index 08f289130f..d3968e7a38 100644 --- a/cpp/include/raft/stats/sum.cuh +++ b/cpp/include/raft/stats/sum.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,12 +8,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -74,6 +75,5 @@ void sum(raft::resources const& handle, /** @} */ // end group stats_sum }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/trustworthiness_score.cuh b/cpp/include/raft/stats/trustworthiness_score.cuh index a6c470f6d8..80a86097e2 100644 --- a/cpp/include/raft/stats/trustworthiness_score.cuh +++ b/cpp/include/raft/stats/trustworthiness_score.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,11 +7,12 @@ #define __TRUSTWORTHINESS_SCORE_H #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -85,6 +86,6 @@ double trustworthiness_score( /** @} */ // end group stats_trustworthiness } // namespace stats -} // namespace raft +} // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/v_measure.cuh b/cpp/include/raft/stats/v_measure.cuh index 490e50e82e..432a01c40c 100644 --- a/cpp/include/raft/stats/v_measure.cuh +++ b/cpp/include/raft/stats/v_measure.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -7,12 +7,13 @@ #define __V_MEASURE_H #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -82,6 +83,5 @@ double v_measure(raft::resources const& handle, /** @} */ // end group stats_vmeasure }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/stats/weighted_mean.cuh b/cpp/include/raft/stats/weighted_mean.cuh index 120bfe84cd..8ab75b7433 100644 --- a/cpp/include/raft/stats/weighted_mean.cuh +++ b/cpp/include/raft/stats/weighted_mean.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,12 +8,13 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace stats { /** @@ -169,6 +170,5 @@ void col_weighted_mean(raft::resources const& handle, /** @} */ // end group stats_weighted_mean }; // end namespace stats -}; // end namespace raft - +}; // namespace RAFT_EXPORT raft #endif diff --git a/cpp/include/raft/util/arch.cuh b/cpp/include/raft/util/arch.cuh index df19c1428a..77e5d559e7 100644 --- a/cpp/include/raft/util/arch.cuh +++ b/cpp/include/raft/util/arch.cuh @@ -1,12 +1,14 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include // RAFT_CUDA_TRY -namespace raft::util::arch { +namespace RAFT_EXPORT raft { +namespace util::arch { /* raft::util::arch provides the following facilities: * @@ -132,4 +134,5 @@ struct SM_range { } }; -} // namespace raft::util::arch +} // namespace util::arch +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/bitonic_sort.cuh b/cpp/include/raft/util/bitonic_sort.cuh index 9ef4ad907a..260b491c48 100644 --- a/cpp/include/raft/util/bitonic_sort.cuh +++ b/cpp/include/raft/util/bitonic_sort.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,7 +8,8 @@ #include #include -namespace raft::util { +namespace RAFT_EXPORT raft { +namespace util { namespace { @@ -235,4 +236,5 @@ class bitonic { } }; -} // namespace raft::util +} // namespace util +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/cache.cuh b/cpp/include/raft/util/cache.cuh index 3252e61910..7d12bdb1fa 100644 --- a/cpp/include/raft/util/cache.cuh +++ b/cpp/include/raft/util/cache.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -19,7 +20,8 @@ #include -namespace raft::cache { +namespace RAFT_EXPORT raft { +namespace cache { /** * @brief Associative cache with least recently used replacement policy. @@ -394,4 +396,5 @@ class Cache { } } }; -}; // namespace raft::cache +}; // namespace cache +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/cache.hpp b/cpp/include/raft/util/cache.hpp index bef37252f3..2354fc76a4 100644 --- a/cpp/include/raft/util/cache.hpp +++ b/cpp/include/raft/util/cache.hpp @@ -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 #include #include @@ -14,7 +15,8 @@ #include #include -namespace raft::cache { +namespace RAFT_EXPORT raft { +namespace cache { /** Associative cache with least recently used replacement policy. */ template #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace cache { /** @@ -351,4 +352,4 @@ RAFT_KERNEL get_cache_idx(int* keys, } } }; // namespace cache -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/cuda_data_type.hpp b/cpp/include/raft/util/cuda_data_type.hpp index 9f6ef97733..51ef521186 100644 --- a/cpp/include/raft/util/cuda_data_type.hpp +++ b/cpp/include/raft/util/cuda_data_type.hpp @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { template constexpr auto get_cuda_data_type() -> cudaDataType_t; @@ -70,4 +72,4 @@ inline constexpr auto get_cuda_data_type() -> cudaDataType_t { return CUDA_R_64F; } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/cuda_dev_essentials.cuh b/cpp/include/raft/util/cuda_dev_essentials.cuh index e7ffa89a20..977a4501b5 100644 --- a/cpp/include/raft/util/cuda_dev_essentials.cuh +++ b/cpp/include/raft/util/cuda_dev_essentials.cuh @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include // This file provides a few essential functions for use in __device__ code. The // scope is necessarily limited to ensure that compilation times are minimized. // Please make sure not to include large / expensive files from here. -namespace raft { +namespace RAFT_EXPORT raft { /** helper macro for device inlined functions */ #define DI inline __device__ @@ -120,4 +122,4 @@ HDI auto to_float(T& a) } } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/cuda_rt_essentials.hpp b/cpp/include/raft/util/cuda_rt_essentials.hpp index 6852f193db..ef0d7241af 100644 --- a/cpp/include/raft/util/cuda_rt_essentials.hpp +++ b/cpp/include/raft/util/cuda_rt_essentials.hpp @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include // This file provides a few essential functions that wrap the CUDA runtime API. // The scope is necessarily limited to ensure that compilation times are // minimized. Please make sure not to include large / expensive files from here. @@ -15,7 +16,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief Exception thrown when a CUDA error is encountered. @@ -25,7 +26,7 @@ struct cuda_error : public raft::exception { explicit cuda_error(std::string const& message) : raft::exception(message) {} }; -} // namespace raft +} // namespace RAFT_EXPORT raft /** * @brief Error checking macro for CUDA runtime API functions. diff --git a/cpp/include/raft/util/cuda_utils.cuh b/cpp/include/raft/util/cuda_utils.cuh index 2ec784e242..5cd9f5f263 100644 --- a/cpp/include/raft/util/cuda_utils.cuh +++ b/cpp/include/raft/util/cuda_utils.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include @@ -20,7 +21,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** Device function to have atomic add support for older archs */ template @@ -673,4 +674,4 @@ inline cudaStream_t select_stream(cudaStream_t user_stream, return n_int_streams > 0 ? int_streams[idx % n_int_streams] : user_stream; } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/cudart_utils.hpp b/cpp/include/raft/util/cudart_utils.hpp index bf04ab2793..e835ea789c 100644 --- a/cpp/include/raft/util/cudart_utils.hpp +++ b/cpp/include/raft/util/cudart_utils.hpp @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include @@ -24,7 +25,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** Helper method to get to know warp size in device code */ __host__ __device__ constexpr inline int warp_size() { return 32; } @@ -469,4 +470,4 @@ constexpr inline auto upper_bound<__nv_bfloat16>() -> __nv_bfloat16 return static_cast<__nv_bfloat16>(__bfloat16_constexpr{0x7f80u}); } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/detail/cub_wrappers.cuh b/cpp/include/raft/util/detail/cub_wrappers.cuh index 1533e1272e..f086e692a3 100644 --- a/cpp/include/raft/util/detail/cub_wrappers.cuh +++ b/cpp/include/raft/util/detail/cub_wrappers.cuh @@ -5,11 +5,13 @@ #pragma once +#include + #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief Convenience wrapper over cub's SortPairs method @@ -40,4 +42,4 @@ void sortPairs(rmm::device_uvector& workspace, workspace.data(), worksize, inKeys, outKeys, inVals, outVals, len, 0, sizeof(KeyT) * 8, stream); } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/detail/itertools.hpp b/cpp/include/raft/util/detail/itertools.hpp index 207aa99ba7..289f65f7f0 100644 --- a/cpp/include/raft/util/detail/itertools.hpp +++ b/cpp/include/raft/util/detail/itertools.hpp @@ -1,14 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + #include #include -namespace raft::util::itertools::detail { +namespace RAFT_EXPORT raft { +namespace util::itertools::detail { template inline std::vector product(std::index_sequence index, const std::vector&... vecs) @@ -27,4 +30,5 @@ inline std::vector product(std::index_sequence index, const std::vecto return out; } -} // namespace raft::util::itertools::detail +} // namespace util::itertools::detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/detail/popc.cuh b/cpp/include/raft/util/detail/popc.cuh index f73ef07764..55afb31cd9 100644 --- a/cpp/include/raft/util/detail/popc.cuh +++ b/cpp/include/raft/util/detail/popc.cuh @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include #include #include -namespace raft::detail { +namespace RAFT_EXPORT raft { +namespace detail { /** * @brief Count the number of bits that are set to 1 in a vector. @@ -62,4 +64,5 @@ void popc(const raft::resources& res, }); } -} // end namespace raft::detail +} // namespace detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/detail/scatter.cuh b/cpp/include/raft/util/detail/scatter.cuh index 866162a198..015da6a507 100644 --- a/cpp/include/raft/util/detail/scatter.cuh +++ b/cpp/include/raft/util/detail/scatter.cuh @@ -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 #include #include -namespace raft::detail { +namespace RAFT_EXPORT raft { +namespace detail { template RAFT_KERNEL scatterKernel(DataT* out, const DataT* in, const IdxT* idx, IdxT len, Lambda op) @@ -38,4 +40,5 @@ void scatterImpl( RAFT_CUDA_TRY(cudaGetLastError()); } -} // namespace raft::detail +} // namespace detail +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/device_atomics.cuh b/cpp/include/raft/util/device_atomics.cuh index 86e4ff5f40..54a0b57959 100644 --- a/cpp/include/raft/util/device_atomics.cuh +++ b/cpp/include/raft/util/device_atomics.cuh @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include /** * @brief overloads for CUDA atomic operations * @file device_atomics.cuh @@ -20,7 +21,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { namespace device_atomics { namespace detail { @@ -474,7 +475,7 @@ __forceinline__ __device__ bool genericAtomicOperation(bool* address, return T(fun(address, update_value, op)); } -} // namespace raft +} // namespace RAFT_EXPORT raft /** * @brief Overloads for `atomicAdd` diff --git a/cpp/include/raft/util/device_loads_stores.cuh b/cpp/include/raft/util/device_loads_stores.cuh index 4f58d37e7f..8735eff90c 100644 --- a/cpp/include/raft/util/device_loads_stores.cuh +++ b/cpp/include/raft/util/device_loads_stores.cuh @@ -1,10 +1,11 @@ /* - * 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 #include #include // DI @@ -12,7 +13,7 @@ #include // uintX_t -namespace raft { +namespace RAFT_EXPORT raft { /** * @defgroup SmemStores Shared memory store operations @@ -770,4 +771,4 @@ DI void stg(const int64_t& reg, void* addr, bool guard) /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/device_utils.cuh b/cpp/include/raft/util/device_utils.cuh index c09baed9de..459ec60e6c 100644 --- a/cpp/include/raft/util/device_utils.cuh +++ b/cpp/include/raft/util/device_utils.cuh @@ -1,15 +1,16 @@ /* - * 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 #include #include // pair -namespace raft { +namespace RAFT_EXPORT raft { // TODO move to raft https://github.com/rapidsai/raft/issues/90 /** helper method to get the compute capability version numbers */ @@ -95,4 +96,4 @@ DI T batchedBlockReduce(T val, char* smem) return val; } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/fast_int_div.cuh b/cpp/include/raft/util/fast_int_div.cuh index ed85168a1e..e92d581771 100644 --- a/cpp/include/raft/util/fast_int_div.cuh +++ b/cpp/include/raft/util/fast_int_div.cuh @@ -1,15 +1,17 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include -namespace raft::util { +namespace RAFT_EXPORT raft { +namespace util { /** * @brief Perform fast integer division and modulo using a known divisor @@ -110,4 +112,5 @@ HDI int operator%(int n, const FastIntDiv& divisor) return remainder; } -}; // namespace raft::util +}; // namespace util +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/input_validation.hpp b/cpp/include/raft/util/input_validation.hpp index 4acd53844a..264305d2c5 100644 --- a/cpp/include/raft/util/input_validation.hpp +++ b/cpp/include/raft/util/input_validation.hpp @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -namespace raft { +#include +namespace RAFT_EXPORT raft { template constexpr bool is_row_or_column_major(mdspan m) @@ -118,4 +119,4 @@ constexpr bool is_scalar_view(mdspan m) return false; } -}; // end namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/integer_utils.hpp b/cpp/include/raft/util/integer_utils.hpp index a036dfb779..81675a67d5 100644 --- a/cpp/include/raft/util/integer_utils.hpp +++ b/cpp/include/raft/util/integer_utils.hpp @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: Copyright 2019 BlazingDB, Inc. * SPDX-FileCopyrightText: Copyright 2019 Eyal Rozenberg - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ /* @@ -36,7 +36,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { //! Utility functions /** * Finds the smallest integer not less than `number_to_round` and modulo `S` is @@ -242,4 +242,4 @@ _RAFT_HOST_DEVICE inline void wmul_64bit(uint64_t& res_hi, uint64_t& res_lo, uin #endif } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/itertools.hpp b/cpp/include/raft/util/itertools.hpp index 92edbc0c8f..ebec47d86b 100644 --- a/cpp/include/raft/util/itertools.hpp +++ b/cpp/include/raft/util/itertools.hpp @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include /** @@ -12,7 +13,8 @@ * */ -namespace raft::util::itertools { +namespace RAFT_EXPORT raft { +namespace util::itertools { /** * @brief Cartesian product of the given initializer lists. @@ -33,4 +35,5 @@ std::vector product(std::initializer_list... lists) return detail::product(std::index_sequence_for(), (std::vector(lists))...); } -} // namespace raft::util::itertools +} // namespace util::itertools +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/memory_tracking_resources.hpp b/cpp/include/raft/util/memory_tracking_resources.hpp index 306c10ce1e..6994deda01 100644 --- a/cpp/include/raft/util/memory_tracking_resources.hpp +++ b/cpp/include/raft/util/memory_tracking_resources.hpp @@ -4,6 +4,7 @@ */ #pragma once +#include #include #include #include @@ -26,7 +27,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief A resources handle that wraps all reachable memory resources with @@ -225,4 +226,4 @@ class memory_tracking_resources : public resources { } }; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/memory_type_dispatcher.cuh b/cpp/include/raft/util/memory_type_dispatcher.cuh index e46e876c9d..6e0e831647 100644 --- a/cpp/include/raft/util/memory_type_dispatcher.cuh +++ b/cpp/include/raft/util/memory_type_dispatcher.cuh @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include @@ -11,7 +12,7 @@ #include #include -namespace raft { +namespace RAFT_EXPORT raft { namespace detail { @@ -196,4 +197,4 @@ decltype(auto) memory_type_dispatcher(raft::resources const& res, lambda_t&& f, /** @} */ -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/popc.cuh b/cpp/include/raft/util/popc.cuh index 0fe48f2ad6..5d5f938ee5 100644 --- a/cpp/include/raft/util/popc.cuh +++ b/cpp/include/raft/util/popc.cuh @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief Count the number of bits that are set to 1 in a vector. @@ -27,4 +28,4 @@ void popc(const raft::resources& res, detail::popc(res, values, max_len, counter); } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/pow2_utils.cuh b/cpp/include/raft/util/pow2_utils.cuh index 70e8fe5c1a..747a284bdf 100644 --- a/cpp/include/raft/util/pow2_utils.cuh +++ b/cpp/include/raft/util/pow2_utils.cuh @@ -1,13 +1,14 @@ /* - * 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 #include -namespace raft { +namespace RAFT_EXPORT raft { /** * Checks whether an integer is a power of 2. @@ -168,4 +169,4 @@ struct Pow2 { #undef Pow2_WHEN_INTEGRAL }; -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/raft_explicit.hpp b/cpp/include/raft/util/raft_explicit.hpp index 35fe0271b2..e5f824b0b2 100644 --- a/cpp/include/raft/util/raft_explicit.hpp +++ b/cpp/include/raft/util/raft_explicit.hpp @@ -1,8 +1,9 @@ -/* SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. +/* SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include /** * @brief Prevents a function template from being implicitly instantiated * @@ -61,7 +62,8 @@ throw "raft_explicit_error"; \ } -namespace raft::util::raft_explicit { +namespace RAFT_EXPORT raft { +namespace util::raft_explicit { /** * @brief Template that is always false * @@ -74,4 +76,5 @@ template struct implicit_instantiation { static constexpr bool value = false; }; -} // namespace raft::util::raft_explicit +} // namespace util::raft_explicit +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/reduction.cuh b/cpp/include/raft/util/reduction.cuh index 6b7ef0825d..784eb81084 100644 --- a/cpp/include/raft/util/reduction.cuh +++ b/cpp/include/raft/util/reduction.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -12,7 +13,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief Logical-warp-level reduction @@ -286,4 +287,4 @@ DI void logicalWarpReduceVector(T* acc, int lane_id, ReduceLambda reduce_op) } } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/scatter.cuh b/cpp/include/raft/util/scatter.cuh index a727e8c4ce..c8dd3f39e8 100644 --- a/cpp/include/raft/util/scatter.cuh +++ b/cpp/include/raft/util/scatter.cuh @@ -1,15 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2022, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * @brief Performs scatter operation based on the input indexing array @@ -55,4 +56,4 @@ void scatter(DataT* out, } } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/seive.hpp b/cpp/include/raft/util/seive.hpp index 6b430ce580..25c41fd6cd 100644 --- a/cpp/include/raft/util/seive.hpp +++ b/cpp/include/raft/util/seive.hpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include @@ -11,7 +12,7 @@ // Taken from: // https://github.com/teju85/programming/blob/master/euler/include/seive.h -namespace raft { +namespace RAFT_EXPORT raft { namespace common { /** @@ -112,4 +113,4 @@ class Seive { std::vector seive; }; }; // namespace common -}; // namespace raft +}; // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/variant_utils.hpp b/cpp/include/raft/util/variant_utils.hpp index 1ae0b4f8da..9cb2356ee6 100644 --- a/cpp/include/raft/util/variant_utils.hpp +++ b/cpp/include/raft/util/variant_utils.hpp @@ -1,12 +1,14 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ +#include + #include #include -namespace raft { +namespace RAFT_EXPORT raft { template struct concatenated_variant; @@ -50,4 +52,4 @@ struct is_type_in_variant> { template auto static constexpr is_type_in_variant_v = is_type_in_variant::value; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/vectorized.cuh b/cpp/include/raft/util/vectorized.cuh index b0897d47c3..ad4dd29d12 100644 --- a/cpp/include/raft/util/vectorized.cuh +++ b/cpp/include/raft/util/vectorized.cuh @@ -5,6 +5,7 @@ #pragma once +#include #include #include @@ -12,7 +13,7 @@ #include -namespace raft { +namespace RAFT_EXPORT raft { // Third parameter enables SFINAE for conditional specializations (e.g., KeyValuePair by size) template @@ -427,4 +428,4 @@ DI void copy_vectorized(T* out, const T* in, uint32_t n) } } } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/vectorized_kvp.cuh b/cpp/include/raft/util/vectorized_kvp.cuh index a5339e181e..d475401777 100644 --- a/cpp/include/raft/util/vectorized_kvp.cuh +++ b/cpp/include/raft/util/vectorized_kvp.cuh @@ -5,11 +5,12 @@ #pragma once +#include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** * Generic IOType specializations for ALL KeyValuePair types based on sizeof. * @@ -61,4 +62,4 @@ struct IOType, 1, std::enable_if_t) static_assert(std::is_trivially_copyable_v>); using Type = int4; }; -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft/util/warp_primitives.cuh b/cpp/include/raft/util/warp_primitives.cuh index d9b31aad13..bf45f85fd6 100644 --- a/cpp/include/raft/util/warp_primitives.cuh +++ b/cpp/include/raft/util/warp_primitives.cuh @@ -5,13 +5,14 @@ #pragma once +#include #include #include #include #include -namespace raft { +namespace RAFT_EXPORT raft { /** True CUDA alignment of a type (adapted from CUB) */ template @@ -218,4 +219,4 @@ DI std::enable_if_t, T> shfl_xor(T val, return output; } -} // namespace raft +} // namespace RAFT_EXPORT raft diff --git a/cpp/include/raft_runtime/matrix/select_k.hpp b/cpp/include/raft_runtime/matrix/select_k.hpp index 0ba6719ec4..26ca4fd393 100644 --- a/cpp/include/raft_runtime/matrix/select_k.hpp +++ b/cpp/include/raft_runtime/matrix/select_k.hpp @@ -1,21 +1,23 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include #include #include namespace raft::runtime::matrix { -void select_k(const resources& handle, - raft::device_matrix_view in_val, - std::optional> in_idx, - raft::device_matrix_view out_val, - raft::device_matrix_view out_idx, - bool select_min); +RAFT_EXPORT void select_k( + const resources& handle, + raft::device_matrix_view in_val, + std::optional> in_idx, + raft::device_matrix_view out_val, + raft::device_matrix_view out_idx, + bool select_min); } // namespace raft::runtime::matrix diff --git a/cpp/include/raft_runtime/random/rmat_rectangular_generator.hpp b/cpp/include/raft_runtime/random/rmat_rectangular_generator.hpp index 3f01d9d812..02cbfb28d0 100644 --- a/cpp/include/raft_runtime/random/rmat_rectangular_generator.hpp +++ b/cpp/include/raft_runtime/random/rmat_rectangular_generator.hpp @@ -1,8 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ +#pragma once + +#include #include #include @@ -15,16 +18,16 @@ namespace raft::runtime::random { * @{ */ -#define FUNC_DECL(IdxT, ProbT) \ - void rmat_rectangular_gen(raft::resources const& handle, \ - IdxT* out, \ - IdxT* out_src, \ - IdxT* out_dst, \ - const ProbT* theta, \ - IdxT r_scale, \ - IdxT c_scale, \ - IdxT n_edges, \ - raft::random::RngState& r) +#define FUNC_DECL(IdxT, ProbT) \ + RAFT_EXPORT void rmat_rectangular_gen(raft::resources const& handle, \ + IdxT* out, \ + IdxT* out_src, \ + IdxT* out_dst, \ + const ProbT* theta, \ + IdxT r_scale, \ + IdxT c_scale, \ + IdxT n_edges, \ + raft::random::RngState& r) FUNC_DECL(int, float); FUNC_DECL(int64_t, float); diff --git a/cpp/include/raft_runtime/solver/lanczos.hpp b/cpp/include/raft_runtime/solver/lanczos.hpp index 07e75367f7..c03a2baeb1 100644 --- a/cpp/include/raft_runtime/solver/lanczos.hpp +++ b/cpp/include/raft_runtime/solver/lanczos.hpp @@ -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 #include #include #include @@ -19,7 +20,7 @@ namespace raft::runtime::solver { */ #define FUNC_DECL(IndexType, ValueType) \ - void lanczos_solver( \ + RAFT_EXPORT void lanczos_solver( \ const raft::resources& handle, \ raft::sparse::solver::lanczos_solver_config config, \ raft::device_vector_view rows, \ diff --git a/cpp/src/raft_runtime/solver/lanczos_solver.cuh b/cpp/src/raft_runtime/solver/lanczos_solver.cuh index 9fd436de3a..9dfe35a5ce 100644 --- a/cpp/src/raft_runtime/solver/lanczos_solver.cuh +++ b/cpp/src/raft_runtime/solver/lanczos_solver.cuh @@ -5,6 +5,8 @@ #include +#include + #define FUNC_DEF(IndexType, ValueType) \ void lanczos_solver( \ const raft::resources& handle, \