From 5d6bc6baa74cc899b25cdda47750f1907db32155 Mon Sep 17 00:00:00 2001 From: Ben Frederickson Date: Tue, 31 Jan 2023 22:41:15 -0800 Subject: [PATCH] Remove Index template parameter from distance specializations Remove the index template parameter from the pairwise distance specializations. Since this is only used for scalar values with the dimensionality of the input/output matrices - having multiple different types here doesn't benefit us much, and just causes us to compile more distance specializations (or miss them in the case of int64_t indices). --- cpp/CMakeLists.txt | 45 +-- cpp/include/raft/distance/detail/distance.cuh | 323 +++++++----------- .../detail/pairwise_distance_cutlass_base.cuh | 25 +- cpp/include/raft/distance/distance.cuh | 43 ++- .../specializations/detail/canberra.cuh | 33 +- .../specializations/detail/chebyshev.cuh | 33 +- .../specializations/detail/correlation.cuh | 33 +- .../specializations/detail/cosine.cuh | 35 +- .../detail/hamming_unexpanded.cuh | 34 +- .../detail/hellinger_expanded.cuh | 34 +- .../specializations/detail/jensen_shannon.cuh | 49 +-- .../specializations/detail/kl_divergence.cuh | 34 +- .../distance/specializations/detail/l1.cuh | 32 +- .../specializations/detail/l2_expanded.cuh | 40 +-- .../detail/l2_sqrt_expanded.cuh | 35 +- .../detail/l2_sqrt_unexpanded.cuh | 34 +- .../specializations/detail/l2_unexpanded.cuh | 34 +- .../specializations/detail/lp_unexpanded.cuh | 34 +- .../specializations/detail/russel_rao.cuh | 34 +- .../raft/spatial/knn/detail/fused_l2_knn.cuh | 2 +- .../specializations/detail/canberra.cu | 32 +- .../specializations/detail/chebyshev.cu | 32 +- .../specializations/detail/correlation.cu | 34 +- .../distance/specializations/detail/cosine.cu | 33 +- .../detail/hamming_unexpanded.cu | 34 +- .../detail/hellinger_expanded.cu | 33 +- ...=> jensen_shannon_double_double_double.cu} | 10 +- ...cu => jensen_shannon_float_float_float.cu} | 18 +- ...jensen_shannon_float_float_float_uint32.cu | 39 --- ... => kl_divergence_double_double_double.cu} | 10 +- ....cu => kl_divergence_float_float_float.cu} | 10 +- .../kl_divergence_float_float_float_uint32.cu | 39 --- ...uble_int.cu => l1_double_double_double.cu} | 10 +- .../detail/l1_float_float_float.cu | 36 ++ .../detail/l1_float_float_float_int.cu | 37 -- .../detail/l1_float_float_float_uint32.cu | 38 --- ...cu => l2_expanded_double_double_double.cu} | 10 +- ...nt.cu => l2_expanded_float_float_float.cu} | 10 +- .../l2_expanded_float_float_float_uint32.cu | 38 --- ... l2_sqrt_expanded_double_double_double.cu} | 10 +- ... => l2_sqrt_expanded_float_float_float.cu} | 10 +- ..._sqrt_expanded_float_float_float_uint32.cu | 39 --- ...2_sqrt_unexpanded_double_double_double.cu} | 10 +- ...> l2_sqrt_unexpanded_float_float_float.cu} | 10 +- ...qrt_unexpanded_float_float_float_uint32.cu | 39 --- ... => l2_unexpanded_double_double_double.cu} | 10 +- ....cu => l2_unexpanded_float_float_float.cu} | 10 +- .../l2_unexpanded_float_float_float_uint32.cu | 39 --- ... => lp_unexpanded_double_double_double.cu} | 10 +- ....cu => lp_unexpanded_float_float_float.cu} | 10 +- .../lp_unexpanded_float_float_float_uint32.cu | 39 --- .../detail/russel_rao_double_double_double.cu | 37 ++ .../russel_rao_double_double_double_int.cu | 38 --- ...int.cu => russel_rao_float_float_float.cu} | 10 +- .../russel_rao_float_float_float_uint32.cu | 39 --- 55 files changed, 527 insertions(+), 1302 deletions(-) rename cpp/src/distance/distance/specializations/detail/{jensen_shannon_double_double_double_int.cu => jensen_shannon_double_double_double.cu} (89%) rename cpp/src/distance/distance/specializations/detail/{jensen_shannon_float_float_float_int.cu => jensen_shannon_float_float_float.cu} (87%) delete mode 100644 cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float_uint32.cu rename cpp/src/distance/distance/specializations/detail/{kl_divergence_double_double_double_int.cu => kl_divergence_double_double_double.cu} (89%) rename cpp/src/distance/distance/specializations/detail/{kl_divergence_float_float_float_int.cu => kl_divergence_float_float_float.cu} (89%) delete mode 100644 cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float_uint32.cu rename cpp/src/distance/distance/specializations/detail/{l1_double_double_double_int.cu => l1_double_double_double.cu} (90%) create mode 100644 cpp/src/distance/distance/specializations/detail/l1_float_float_float.cu delete mode 100644 cpp/src/distance/distance/specializations/detail/l1_float_float_float_int.cu delete mode 100644 cpp/src/distance/distance/specializations/detail/l1_float_float_float_uint32.cu rename cpp/src/distance/distance/specializations/detail/{l2_expanded_double_double_double_int.cu => l2_expanded_double_double_double.cu} (89%) rename cpp/src/distance/distance/specializations/detail/{l2_expanded_float_float_float_int.cu => l2_expanded_float_float_float.cu} (89%) delete mode 100644 cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float_uint32.cu rename cpp/src/distance/distance/specializations/detail/{l2_sqrt_expanded_double_double_double_int.cu => l2_sqrt_expanded_double_double_double.cu} (89%) rename cpp/src/distance/distance/specializations/detail/{l2_sqrt_expanded_float_float_float_int.cu => l2_sqrt_expanded_float_float_float.cu} (89%) delete mode 100644 cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_uint32.cu rename cpp/src/distance/distance/specializations/detail/{l2_sqrt_unexpanded_double_double_double_int.cu => l2_sqrt_unexpanded_double_double_double.cu} (89%) rename cpp/src/distance/distance/specializations/detail/{l2_sqrt_unexpanded_float_float_float_int.cu => l2_sqrt_unexpanded_float_float_float.cu} (89%) delete mode 100644 cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_uint32.cu rename cpp/src/distance/distance/specializations/detail/{l2_unexpanded_double_double_double_int.cu => l2_unexpanded_double_double_double.cu} (89%) rename cpp/src/distance/distance/specializations/detail/{l2_unexpanded_float_float_float_int.cu => l2_unexpanded_float_float_float.cu} (89%) delete mode 100644 cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_uint32.cu rename cpp/src/distance/distance/specializations/detail/{lp_unexpanded_double_double_double_int.cu => lp_unexpanded_double_double_double.cu} (89%) rename cpp/src/distance/distance/specializations/detail/{lp_unexpanded_float_float_float_int.cu => lp_unexpanded_float_float_float.cu} (89%) delete mode 100644 cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_uint32.cu create mode 100644 cpp/src/distance/distance/specializations/detail/russel_rao_double_double_double.cu delete mode 100644 cpp/src/distance/distance/specializations/detail/russel_rao_double_double_double_int.cu rename cpp/src/distance/distance/specializations/detail/{russel_rao_float_float_float_int.cu => russel_rao_float_float_float.cu} (89%) delete mode 100644 cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float_uint32.cu diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index a6341f6dda..e4879261b9 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -306,9 +306,8 @@ if(RAFT_COMPILE_DIST_LIBRARY) src/distance/distance/specializations/detail/cosine.cu src/distance/distance/specializations/detail/hamming_unexpanded.cu src/distance/distance/specializations/detail/hellinger_expanded.cu - src/distance/distance/specializations/detail/jensen_shannon_float_float_float_int.cu - src/distance/distance/specializations/detail/jensen_shannon_float_float_float_uint32.cu - src/distance/distance/specializations/detail/jensen_shannon_double_double_double_int.cu + src/distance/distance/specializations/detail/jensen_shannon_float_float_float.cu + src/distance/distance/specializations/detail/jensen_shannon_double_double_double.cu src/distance/distance/specializations/detail/kernels/gram_matrix_base_double.cu src/distance/distance/specializations/detail/kernels/gram_matrix_base_float.cu src/distance/distance/specializations/detail/kernels/polynomial_kernel_double_int.cu @@ -318,30 +317,22 @@ if(RAFT_COMPILE_DIST_LIBRARY) # src/distance/specializations/detail/kernels/rbf_kernel_float.cu src/distance/distance/specializations/detail/kernels/tanh_kernel_double.cu src/distance/distance/specializations/detail/kernels/tanh_kernel_float.cu - src/distance/distance/specializations/detail/kl_divergence_float_float_float_int.cu - src/distance/distance/specializations/detail/kl_divergence_float_float_float_uint32.cu - src/distance/distance/specializations/detail/kl_divergence_double_double_double_int.cu - src/distance/distance/specializations/detail/l1_float_float_float_int.cu - src/distance/distance/specializations/detail/l1_float_float_float_uint32.cu - src/distance/distance/specializations/detail/l1_double_double_double_int.cu - src/distance/distance/specializations/detail/l2_expanded_float_float_float_int.cu - src/distance/distance/specializations/detail/l2_expanded_float_float_float_uint32.cu - src/distance/distance/specializations/detail/l2_expanded_double_double_double_int.cu - src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_int.cu - src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_uint32.cu - src/distance/distance/specializations/detail/l2_sqrt_expanded_double_double_double_int.cu - src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_int.cu - src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_uint32.cu - src/distance/distance/specializations/detail/l2_sqrt_unexpanded_double_double_double_int.cu - src/distance/distance/specializations/detail/l2_unexpanded_double_double_double_int.cu - src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_uint32.cu - src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_int.cu - src/distance/distance/specializations/detail/lp_unexpanded_double_double_double_int.cu - src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_uint32.cu - src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_int.cu - src/distance/distance/specializations/detail/russel_rao_double_double_double_int.cu - src/distance/distance/specializations/detail/russel_rao_float_float_float_uint32.cu - src/distance/distance/specializations/detail/russel_rao_float_float_float_int.cu + src/distance/distance/specializations/detail/kl_divergence_float_float_float.cu + src/distance/distance/specializations/detail/kl_divergence_double_double_double.cu + src/distance/distance/specializations/detail/l1_float_float_float.cu + src/distance/distance/specializations/detail/l1_double_double_double.cu + src/distance/distance/specializations/detail/l2_expanded_float_float_float.cu + src/distance/distance/specializations/detail/l2_expanded_double_double_double.cu + src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float.cu + src/distance/distance/specializations/detail/l2_sqrt_expanded_double_double_double.cu + src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float.cu + src/distance/distance/specializations/detail/l2_sqrt_unexpanded_double_double_double.cu + src/distance/distance/specializations/detail/l2_unexpanded_double_double_double.cu + src/distance/distance/specializations/detail/l2_unexpanded_float_float_float.cu + src/distance/distance/specializations/detail/lp_unexpanded_double_double_double.cu + src/distance/distance/specializations/detail/lp_unexpanded_float_float_float.cu + src/distance/distance/specializations/detail/russel_rao_double_double_double.cu + src/distance/distance/specializations/detail/russel_rao_float_float_float.cu src/distance/distance/specializations/fused_l2_nn_double_int.cu src/distance/distance/specializations/fused_l2_nn_double_int64.cu src/distance/distance/specializations/fused_l2_nn_float_int.cu diff --git a/cpp/include/raft/distance/detail/distance.cuh b/cpp/include/raft/distance/detail/distance.cuh index b459c73bee..ba698786d8 100644 --- a/cpp/include/raft/distance/detail/distance.cuh +++ b/cpp/include/raft/distance/detail/distance.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022, NVIDIA CORPORATION. + * Copyright (c) 2018-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,15 +89,14 @@ template + typename FinalLambda> struct DistanceImpl { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, FinalLambda fin_op, @@ -108,23 +107,18 @@ struct DistanceImpl { } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, FinalLambda fin_op, @@ -132,28 +126,23 @@ struct DistanceImpl( + raft::distance::detail::euclideanAlgo1( m, n, k, x, y, dist, false, (AccType*)workspace, worksize, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, FinalLambda fin_op, @@ -161,28 +150,23 @@ struct DistanceImpl( + raft::distance::detail::euclideanAlgo1( m, n, k, x, y, dist, true, (AccType*)workspace, worksize, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, FinalLambda fin_op, @@ -190,28 +174,23 @@ struct DistanceImpl( + raft::distance::detail::cosineAlgo1( m, n, k, x, y, dist, (AccType*)workspace, worksize, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -219,28 +198,23 @@ struct DistanceImpl( + raft::distance::detail::euclideanAlgo2( m, n, k, x, y, dist, false, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -248,28 +222,19 @@ struct DistanceImpl( + raft::distance::detail::euclideanAlgo2( m, n, k, x, y, dist, true, fin_op, stream, isRowMajor); } }; -template -struct DistanceImpl { +template +struct DistanceImpl { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -277,28 +242,19 @@ struct DistanceImpl( + raft::distance::detail::l1Impl( m, n, k, x, y, dist, fin_op, stream, isRowMajor); } }; -template -struct DistanceImpl { +template +struct DistanceImpl { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -306,28 +262,23 @@ struct DistanceImpl( + raft::distance::detail::chebyshevImpl( m, n, k, x, y, dist, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -335,28 +286,23 @@ struct DistanceImpl( + raft::distance::detail::hellingerImpl( m, n, k, x, y, dist, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -364,28 +310,19 @@ struct DistanceImpl( + raft::distance::detail::minkowskiImpl( m, n, k, x, y, dist, fin_op, stream, isRowMajor, metric_arg); } }; -template -struct DistanceImpl { +template +struct DistanceImpl { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -393,28 +330,23 @@ struct DistanceImpl( + raft::distance::detail::canberraImpl( m, n, k, x, y, dist, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -422,28 +354,23 @@ struct DistanceImpl( + raft::distance::detail::hammingUnexpandedImpl( m, n, k, x, y, dist, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -451,28 +378,23 @@ struct DistanceImpl( + raft::distance::detail::jensenShannonImpl( m, n, k, x, y, dist, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -480,28 +402,23 @@ struct DistanceImpl( + raft::distance::detail::russellRaoImpl( m, n, k, x, y, dist, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void*, size_t, FinalLambda fin_op, @@ -509,28 +426,23 @@ struct DistanceImpl( + raft::distance::detail::klDivergenceImpl( m, n, k, x, y, dist, fin_op, stream, isRowMajor); } }; -template +template struct DistanceImpl { + FinalLambda> { void run(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, FinalLambda fin_op, @@ -538,7 +450,7 @@ struct DistanceImpl( + raft::distance::detail::correlationImpl( m, n, k, x, y, dist, (AccType*)workspace, worksize, fin_op, stream, isRowMajor); } }; @@ -552,7 +464,6 @@ struct DistanceImpl + typename FinalLambda> void distance(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, FinalLambda fin_op, @@ -589,7 +499,7 @@ void distance(const InType* x, bool isRowMajor = true, InType metric_arg = 2.0f) { - DistanceImpl distImpl; + DistanceImpl distImpl; distImpl.run(x, y, dist, m, n, k, workspace, worksize, fin_op, stream, isRowMajor, metric_arg); RAFT_CUDA_TRY(cudaPeekAtLastError()); } @@ -600,7 +510,6 @@ void distance(const InType* x, * @tparam InType input argument type * @tparam AccType accumulation type * @tparam OutType output type - * @tparam Index_ Index type * @param x first set of points * @param y second set of points * @param dist output distance matrix @@ -631,28 +540,27 @@ struct default_fin_op { template + typename OutType> void distance(const InType* x, const InType* y, OutType* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor = true, InType metric_arg = 2.0f) { - using final_op_type = default_fin_op; + using final_op_type = default_fin_op; final_op_type fin_op; // raft distance support inputs as float/double and output as uint8_t/float/double. static_assert(!((sizeof(OutType) > 1) && (sizeof(AccType) != sizeof(OutType))), "OutType can be uint8_t, float, double," "if sizeof(OutType) > 1 then sizeof(AccType) == sizeof(OutType)."); - distance( + distance( x, y, dist, m, n, k, workspace, worksize, fin_op, stream, isRowMajor, metric_arg); RAFT_CUDA_TRY(cudaPeekAtLastError()); } @@ -663,7 +571,6 @@ void distance(const InType* x, * @tparam InType input argument type * @tparam AccType accumulation type * @tparam OutType output type - * @tparam Index_ Index type * @param x first set of points * @param y second set of points * @param m number of points in x @@ -676,9 +583,8 @@ void distance(const InType* x, template -size_t getWorkspaceSize(const InType* x, const InType* y, Index_ m, Index_ n, Index_ k) + typename OutType> +size_t getWorkspaceSize(const InType* x, const InType* y, size_t m, size_t n, size_t k) { size_t worksize = 0; constexpr bool is_allocated = (distanceType <= raft::distance::DistanceType::CosineExpanded) || @@ -700,7 +606,6 @@ size_t getWorkspaceSize(const InType* x, const InType* y, Index_ m, Index_ n, In * @brief Convenience wrapper around 'distance' prim to convert runtime metric * into compile time for the purpose of dispatch * @tparam Type input/accumulation/output data-type - * @tparam Index_ indexing type * @param x first set of points * @param y second set of points * @param dist output distance matrix @@ -713,21 +618,21 @@ size_t getWorkspaceSize(const InType* x, const InType* y, Index_ m, Index_ n, In * @param stream cuda stream * @param isRowMajor whether the matrices are row-major or col-major */ -template +template void pairwise_distance_impl(const Type* x, const Type* y, Type* dist, - Index_ m, - Index_ n, - Index_ k, + size_t m, + size_t n, + size_t k, rmm::device_uvector& workspace, cudaStream_t stream, bool isRowMajor, Type metric_arg = 2.0f) { - auto worksize = getWorkspaceSize(x, y, m, n, k); + auto worksize = getWorkspaceSize(x, y, m, n, k); workspace.resize(worksize, stream); - distance( + distance( x, y, dist, m, n, k, workspace.data(), worksize, stream, isRowMajor, metric_arg); } /** @} */ diff --git a/cpp/include/raft/distance/detail/pairwise_distance_cutlass_base.cuh b/cpp/include/raft/distance/detail/pairwise_distance_cutlass_base.cuh index f39d880da4..df5b7caa2f 100644 --- a/cpp/include/raft/distance/detail/pairwise_distance_cutlass_base.cuh +++ b/cpp/include/raft/distance/detail/pairwise_distance_cutlass_base.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022, NVIDIA CORPORATION. + * Copyright (c) 2018-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -135,7 +135,12 @@ void cutlassDistanceKernel(const DataT* x, } typename cutlassDist::Arguments arguments{ - mode, problem_size, batch_count, epilog_op_param, a, b, + mode, + problem_size, + batch_count, + epilog_op_param, + a, + b, xn, // C matrix eq vector param, which here is A norm nullptr, // tensor_Z, (DataT*)yn, // this is broadcast vec, which is required to be non-const param @@ -144,14 +149,14 @@ void cutlassDistanceKernel(const DataT* x, (int64_t)0, // batch stride B (int64_t)0, // batch stride Norm A (int64_t)0, - (int64_t)0, // batch stride Norm B - (int64_t)0, // batch stride Output - gemm_lda, // stride A - gemm_ldb, // stride B - 1, // stride A norm - 0, // this is no-op for Z - 0, // This must be zero - ldd // stride Output matrix + (int64_t)0, // batch stride Norm B + (int64_t)0, // batch stride Output + (int64_t)gemm_lda, // stride A + (int64_t)gemm_ldb, // stride B + 1, // stride A norm + 0, // this is no-op for Z + 0, // This must be zero + (int64_t)ldd // stride Output matrix }; // Using the arguments, query for extra workspace required for matrix multiplication computation diff --git a/cpp/include/raft/distance/distance.cuh b/cpp/include/raft/distance/distance.cuh index 93a5ce7f1a..8ef9b6dacb 100644 --- a/cpp/include/raft/distance/distance.cuh +++ b/cpp/include/raft/distance/distance.cuh @@ -78,7 +78,7 @@ void distance(const InType* x, bool isRowMajor = true, InType metric_arg = 2.0f) { - detail::distance( + detail::distance( x, y, dist, m, n, k, workspace, worksize, fin_op, stream, isRowMajor, metric_arg); } @@ -121,7 +121,7 @@ void distance(const InType* x, bool isRowMajor = true, InType metric_arg = 2.0f) { - detail::distance( + detail::distance( x, y, dist, m, n, k, workspace, worksize, stream, isRowMajor, metric_arg); } @@ -148,7 +148,7 @@ template size_t getWorkspaceSize(const InType* x, const InType* y, Index_ m, Index_ n, Index_ k) { - return detail::getWorkspaceSize(x, y, m, n, k); + return detail::getWorkspaceSize(x, y, m, n, k); } /** @@ -215,7 +215,7 @@ void distance(const InType* x, rmm::device_uvector workspace(0, stream); auto worksize = getWorkspaceSize(x, y, m, n, k); workspace.resize(worksize, stream); - detail::distance( + detail::distance( x, y, dist, m, n, k, workspace.data(), worksize, stream, isRowMajor, metric_arg); } @@ -252,65 +252,64 @@ void pairwise_distance(raft::device_resources const& handle, { switch (metric) { case raft::distance::DistanceType::L2Expanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::L2SqrtExpanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::CosineExpanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::L1: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::L2Unexpanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::L2SqrtUnexpanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::Linf: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::HellingerExpanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::LpUnexpanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor, metric_arg); break; case raft::distance::DistanceType::Canberra: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::HammingUnexpanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::JensenShannon: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::RusselRaoExpanded: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::KLDivergence: - detail::pairwise_distance_impl( + detail::pairwise_distance_impl( x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; case raft::distance::DistanceType::CorrelationExpanded: - detail:: - pairwise_distance_impl( - x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); + detail::pairwise_distance_impl( + x, y, dist, m, n, k, workspace, handle.get_stream(), isRowMajor); break; default: THROW("Unknown or unsupported distance metric '%d'!", (int)metric); }; @@ -481,4 +480,4 @@ void pairwise_distance(raft::device_resources const& handle, }; // namespace distance }; // namespace raft -#endif \ No newline at end of file +#endif diff --git a/cpp/include/raft/distance/specializations/detail/canberra.cuh b/cpp/include/raft/distance/specializations/detail/canberra.cuh index 22bdf41fd1..52a4e7e560 100644 --- a/cpp/include/raft/distance/specializations/detail/canberra.cuh +++ b/cpp/include/raft/distance/specializations/detail/canberra.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,46 +22,31 @@ namespace raft { namespace distance { namespace detail { -extern template void distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void distance( +extern template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/chebyshev.cuh b/cpp/include/raft/distance/specializations/detail/chebyshev.cuh index 7502409082..bdb6b39b40 100644 --- a/cpp/include/raft/distance/specializations/detail/chebyshev.cuh +++ b/cpp/include/raft/distance/specializations/detail/chebyshev.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,46 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void distance( +extern template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/correlation.cuh b/cpp/include/raft/distance/specializations/detail/correlation.cuh index a2cddea179..b1e49cf171 100644 --- a/cpp/include/raft/distance/specializations/detail/correlation.cuh +++ b/cpp/include/raft/distance/specializations/detail/correlation.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,13 +22,13 @@ namespace raft { namespace distance { namespace detail { extern template void -distance( +distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, @@ -36,33 +36,18 @@ distance( +distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/cosine.cuh b/cpp/include/raft/distance/specializations/detail/cosine.cuh index c98703e135..ac0991c4c8 100644 --- a/cpp/include/raft/distance/specializations/detail/cosine.cuh +++ b/cpp/include/raft/distance/specializations/detail/cosine.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,48 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void -distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void -distance( +extern template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/hamming_unexpanded.cuh b/cpp/include/raft/distance/specializations/detail/hamming_unexpanded.cuh index 9cf7b9b343..a6b402b33e 100644 --- a/cpp/include/raft/distance/specializations/detail/hamming_unexpanded.cuh +++ b/cpp/include/raft/distance/specializations/detail/hamming_unexpanded.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,13 @@ namespace raft { namespace distance { namespace detail { -extern template void -distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, @@ -36,33 +35,18 @@ distance( +distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/hellinger_expanded.cuh b/cpp/include/raft/distance/specializations/detail/hellinger_expanded.cuh index 28ecaa1b65..4aab5cc0f2 100644 --- a/cpp/include/raft/distance/specializations/detail/hellinger_expanded.cuh +++ b/cpp/include/raft/distance/specializations/detail/hellinger_expanded.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,13 @@ namespace raft { namespace distance { namespace detail { -extern template void -distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, @@ -36,33 +35,18 @@ distance( +distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/jensen_shannon.cuh b/cpp/include/raft/distance/specializations/detail/jensen_shannon.cuh index ac0190562b..0b00fcfff1 100644 --- a/cpp/include/raft/distance/specializations/detail/jensen_shannon.cuh +++ b/cpp/include/raft/distance/specializations/detail/jensen_shannon.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,46 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void -distance(const float* x, - const float* y, - float* dist, - int m, - int n, - int k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -extern template void -distance( - const double* x, - const double* y, - double* dist, - int m, - int n, - int k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - double metric_arg); -extern template void -distance( +extern template void distance( const float* x, const float* y, float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); +extern template void distance( + const double* x, + const double* y, + double* dist, + size_t m, + size_t n, + size_t k, + void* workspace, + size_t worksize, + cudaStream_t stream, + bool isRowMajor, + double metric_arg); } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/kl_divergence.cuh b/cpp/include/raft/distance/specializations/detail/kl_divergence.cuh index b338cebdc2..092e128c71 100644 --- a/cpp/include/raft/distance/specializations/detail/kl_divergence.cuh +++ b/cpp/include/raft/distance/specializations/detail/kl_divergence.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,47 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void -distance( +extern template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/l1.cuh b/cpp/include/raft/distance/specializations/detail/l1.cuh index 65979ce414..d3a6899b20 100644 --- a/cpp/include/raft/distance/specializations/detail/l1.cuh +++ b/cpp/include/raft/distance/specializations/detail/l1.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,45 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void distance( +extern template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/l2_expanded.cuh b/cpp/include/raft/distance/specializations/detail/l2_expanded.cuh index 1dac34ad7a..ec135994ee 100644 --- a/cpp/include/raft/distance/specializations/detail/l2_expanded.cuh +++ b/cpp/include/raft/distance/specializations/detail/l2_expanded.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,45 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void -distance(const double* x, - const double* y, - double* dist, - int m, - int n, - int k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, +extern template void distance( + const double* x, + const double* y, + double* dist, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, - float metric_arg); + double metric_arg); } // namespace detail } // namespace distance diff --git a/cpp/include/raft/distance/specializations/detail/l2_sqrt_expanded.cuh b/cpp/include/raft/distance/specializations/detail/l2_sqrt_expanded.cuh index 8b752d8235..5531a4cf4a 100644 --- a/cpp/include/raft/distance/specializations/detail/l2_sqrt_expanded.cuh +++ b/cpp/include/raft/distance/specializations/detail/l2_sqrt_expanded.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,48 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void -distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void -distance( +extern template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/l2_sqrt_unexpanded.cuh b/cpp/include/raft/distance/specializations/detail/l2_sqrt_unexpanded.cuh index 8632fda769..d3777acaca 100644 --- a/cpp/include/raft/distance/specializations/detail/l2_sqrt_unexpanded.cuh +++ b/cpp/include/raft/distance/specializations/detail/l2_sqrt_unexpanded.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,13 @@ namespace raft { namespace distance { namespace detail { -extern template void -distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, @@ -36,33 +35,18 @@ distance( +distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/l2_unexpanded.cuh b/cpp/include/raft/distance/specializations/detail/l2_unexpanded.cuh index 3962cfd1ae..494c645699 100644 --- a/cpp/include/raft/distance/specializations/detail/l2_unexpanded.cuh +++ b/cpp/include/raft/distance/specializations/detail/l2_unexpanded.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,47 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void -distance( +extern template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/lp_unexpanded.cuh b/cpp/include/raft/distance/specializations/detail/lp_unexpanded.cuh index 1f7e504ba8..ae706ea46b 100644 --- a/cpp/include/raft/distance/specializations/detail/lp_unexpanded.cuh +++ b/cpp/include/raft/distance/specializations/detail/lp_unexpanded.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,47 +21,31 @@ namespace raft { namespace distance { namespace detail { -extern template void distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -extern template void -distance( +extern template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/distance/specializations/detail/russel_rao.cuh b/cpp/include/raft/distance/specializations/detail/russel_rao.cuh index f0aa1c27ee..c4ba6e8caa 100644 --- a/cpp/include/raft/distance/specializations/detail/russel_rao.cuh +++ b/cpp/include/raft/distance/specializations/detail/russel_rao.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,13 @@ namespace raft { namespace distance { namespace detail { -extern template void -distance( +extern template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, @@ -36,33 +35,18 @@ distance( +distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -extern template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/include/raft/spatial/knn/detail/fused_l2_knn.cuh b/cpp/include/raft/spatial/knn/detail/fused_l2_knn.cuh index f1f160a154..d0f60fb6bd 100644 --- a/cpp/include/raft/spatial/knn/detail/fused_l2_knn.cuh +++ b/cpp/include/raft/spatial/knn/detail/fused_l2_knn.cuh @@ -983,7 +983,7 @@ void fusedL2Knn(size_t D, case raft::distance::DistanceType::L2SqrtExpanded: case raft::distance::DistanceType::L2Expanded: tempWorksize = raft::distance::detail:: - getWorkspaceSize( + getWorkspaceSize( query, index, n_query_rows, n_index_rows, D); worksize = tempWorksize; workspace.resize(worksize, stream); diff --git a/cpp/src/distance/distance/specializations/detail/canberra.cu b/cpp/src/distance/distance/specializations/detail/canberra.cu index 3a81b35a46..62e14ca59c 100644 --- a/cpp/src/distance/distance/specializations/detail/canberra.cu +++ b/cpp/src/distance/distance/specializations/detail/canberra.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,45 +19,31 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -template void distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/chebyshev.cu b/cpp/src/distance/distance/specializations/detail/chebyshev.cu index 7406265e97..eb198300bb 100644 --- a/cpp/src/distance/distance/specializations/detail/chebyshev.cu +++ b/cpp/src/distance/distance/specializations/detail/chebyshev.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,45 +19,31 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -template void distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/correlation.cu b/cpp/src/distance/distance/specializations/detail/correlation.cu index 0e2e55ecfb..113721b31e 100644 --- a/cpp/src/distance/distance/specializations/detail/correlation.cu +++ b/cpp/src/distance/distance/specializations/detail/correlation.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,47 +19,31 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -template void -distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/cosine.cu b/cpp/src/distance/distance/specializations/detail/cosine.cu index efbdfbcd36..00779594d4 100644 --- a/cpp/src/distance/distance/specializations/detail/cosine.cu +++ b/cpp/src/distance/distance/specializations/detail/cosine.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,46 +19,31 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/hamming_unexpanded.cu b/cpp/src/distance/distance/specializations/detail/hamming_unexpanded.cu index ec46ae4383..e0c50d074c 100644 --- a/cpp/src/distance/distance/specializations/detail/hamming_unexpanded.cu +++ b/cpp/src/distance/distance/specializations/detail/hamming_unexpanded.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,47 +19,31 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -template void -distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/hellinger_expanded.cu b/cpp/src/distance/distance/specializations/detail/hellinger_expanded.cu index 8bf8ed8b5a..df05ee91e7 100644 --- a/cpp/src/distance/distance/specializations/detail/hellinger_expanded.cu +++ b/cpp/src/distance/distance/specializations/detail/hellinger_expanded.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,46 +19,31 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -template void -distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, double metric_arg); -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - } // namespace detail } // namespace distance } // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/jensen_shannon_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/jensen_shannon_double_double_double.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/jensen_shannon_double_double_double_int.cu rename to cpp/src/distance/distance/specializations/detail/jensen_shannon_double_double_double.cu index 30fbf70322..bd83b3b1a6 100644 --- a/cpp/src/distance/distance/specializations/detail/jensen_shannon_double_double_double_int.cu +++ b/cpp/src/distance/distance/specializations/detail/jensen_shannon_double_double_double.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float.cu similarity index 87% rename from cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float_int.cu rename to cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float.cu index 31bc11aa71..12de9010e1 100644 --- a/cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float_int.cu +++ b/cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,26 +19,26 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, bool isRowMajor, float metric_arg); -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float_uint32.cu deleted file mode 100644 index 3fb652479a..0000000000 --- a/cpp/src/distance/distance/specializations/detail/jensen_shannon_float_float_float_uint32.cu +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/kl_divergence_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/kl_divergence_double_double_double.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/kl_divergence_double_double_double_int.cu rename to cpp/src/distance/distance/specializations/detail/kl_divergence_double_double_double.cu index 0ac2b23b29..8e4750b397 100644 --- a/cpp/src/distance/distance/specializations/detail/kl_divergence_double_double_double_int.cu +++ b/cpp/src/distance/distance/specializations/detail/kl_divergence_double_double_double.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float_int.cu rename to cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float.cu index f56179fcac..5f286bfdfc 100644 --- a/cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float_int.cu +++ b/cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float_uint32.cu deleted file mode 100644 index db12d23f0e..0000000000 --- a/cpp/src/distance/distance/specializations/detail/kl_divergence_float_float_float_uint32.cu +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/l1_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/l1_double_double_double.cu similarity index 90% rename from cpp/src/distance/distance/specializations/detail/l1_double_double_double_int.cu rename to cpp/src/distance/distance/specializations/detail/l1_double_double_double.cu index b19603dcb9..0adcad7069 100644 --- a/cpp/src/distance/distance/specializations/detail/l1_double_double_double_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l1_double_double_double.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l1_float_float_float.cu b/cpp/src/distance/distance/specializations/detail/l1_float_float_float.cu new file mode 100644 index 0000000000..2bb89c9481 --- /dev/null +++ b/cpp/src/distance/distance/specializations/detail/l1_float_float_float.cu @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +namespace raft { +namespace distance { +namespace detail { +template void distance(const float* x, + const float* y, + float* dist, + size_t m, + size_t n, + size_t k, + void* workspace, + std::size_t worksize, + cudaStream_t stream, + bool isRowMajor, + float metric_arg); + +} // namespace detail +} // namespace distance +} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/l1_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/l1_float_float_float_int.cu deleted file mode 100644 index 8319239115..0000000000 --- a/cpp/src/distance/distance/specializations/detail/l1_float_float_float_int.cu +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { -template void distance( - const float* x, - const float* y, - float* dist, - int m, - int n, - int k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/l1_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/l1_float_float_float_uint32.cu deleted file mode 100644 index f906d711d3..0000000000 --- a/cpp/src/distance/distance/specializations/detail/l1_float_float_float_uint32.cu +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { - -template void distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/l2_expanded_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/l2_expanded_double_double_double.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/l2_expanded_double_double_double_int.cu rename to cpp/src/distance/distance/specializations/detail/l2_expanded_double_double_double.cu index c77dee4220..6deee7b22a 100644 --- a/cpp/src/distance/distance/specializations/detail/l2_expanded_double_double_double_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l2_expanded_double_double_double.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float_int.cu rename to cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float.cu index 778a65ad01..10a925e761 100644 --- a/cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float_uint32.cu deleted file mode 100644 index 43494eabd1..0000000000 --- a/cpp/src/distance/distance/specializations/detail/l2_expanded_float_float_float_uint32.cu +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_double_double_double.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_double_double_double_int.cu rename to cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_double_double_double.cu index 68e178089c..0258f69996 100644 --- a/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_double_double_double_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_double_double_double.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_int.cu rename to cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float.cu index bcfa5d99d1..79971a2d84 100644 --- a/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_uint32.cu deleted file mode 100644 index e85058e34f..0000000000 --- a/cpp/src/distance/distance/specializations/detail/l2_sqrt_expanded_float_float_float_uint32.cu +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_double_double_double.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_double_double_double_int.cu rename to cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_double_double_double.cu index 4cfb058a55..958890c384 100644 --- a/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_double_double_double_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_double_double_double.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,13 +20,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_int.cu rename to cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float.cu index b8331977c4..f369565d80 100644 --- a/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_uint32.cu deleted file mode 100644 index 1531b3b728..0000000000 --- a/cpp/src/distance/distance/specializations/detail/l2_sqrt_unexpanded_float_float_float_uint32.cu +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/l2_unexpanded_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/l2_unexpanded_double_double_double.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/l2_unexpanded_double_double_double_int.cu rename to cpp/src/distance/distance/specializations/detail/l2_unexpanded_double_double_double.cu index fec7c2dce3..331276d3a4 100644 --- a/cpp/src/distance/distance/specializations/detail/l2_unexpanded_double_double_double_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l2_unexpanded_double_double_double.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_int.cu rename to cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float.cu index 8f83b9cfbb..1d018744da 100644 --- a/cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_int.cu +++ b/cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_uint32.cu deleted file mode 100644 index baad4cc451..0000000000 --- a/cpp/src/distance/distance/specializations/detail/l2_unexpanded_float_float_float_uint32.cu +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/lp_unexpanded_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/lp_unexpanded_double_double_double.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/lp_unexpanded_double_double_double_int.cu rename to cpp/src/distance/distance/specializations/detail/lp_unexpanded_double_double_double.cu index 082fad62d1..a3c5ce8ef0 100644 --- a/cpp/src/distance/distance/specializations/detail/lp_unexpanded_double_double_double_int.cu +++ b/cpp/src/distance/distance/specializations/detail/lp_unexpanded_double_double_double.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,13 +20,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const double* x, const double* y, double* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_int.cu rename to cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float.cu index 919d069e1d..d1197960a3 100644 --- a/cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_int.cu +++ b/cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_uint32.cu deleted file mode 100644 index 79a560dde7..0000000000 --- a/cpp/src/distance/distance/specializations/detail/lp_unexpanded_float_float_float_uint32.cu +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/russel_rao_double_double_double.cu b/cpp/src/distance/distance/specializations/detail/russel_rao_double_double_double.cu new file mode 100644 index 0000000000..621fc87751 --- /dev/null +++ b/cpp/src/distance/distance/specializations/detail/russel_rao_double_double_double.cu @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +namespace raft { +namespace distance { +namespace detail { +template void distance( + const double* x, + const double* y, + double* dist, + size_t m, + size_t n, + size_t k, + void* workspace, + std::size_t worksize, + cudaStream_t stream, + bool isRowMajor, + double metric_arg); + +} // namespace detail +} // namespace distance +} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/russel_rao_double_double_double_int.cu b/cpp/src/distance/distance/specializations/detail/russel_rao_double_double_double_int.cu deleted file mode 100644 index 809f6ccb78..0000000000 --- a/cpp/src/distance/distance/specializations/detail/russel_rao_double_double_double_int.cu +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { -template void -distance( - const double* x, - const double* y, - double* dist, - int m, - int n, - int k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - double metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft diff --git a/cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float_int.cu b/cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float.cu similarity index 89% rename from cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float_int.cu rename to cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float.cu index 831384fdd7..9e5328ca6d 100644 --- a/cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float_int.cu +++ b/cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace raft { namespace distance { namespace detail { -template void distance( +template void distance( const float* x, const float* y, float* dist, - int m, - int n, - int k, + size_t m, + size_t n, + size_t k, void* workspace, std::size_t worksize, cudaStream_t stream, diff --git a/cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float_uint32.cu b/cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float_uint32.cu deleted file mode 100644 index fcb8d42ab3..0000000000 --- a/cpp/src/distance/distance/specializations/detail/russel_rao_float_float_float_uint32.cu +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace raft { -namespace distance { -namespace detail { - -template void -distance( - const float* x, - const float* y, - float* dist, - std::uint32_t m, - std::uint32_t n, - std::uint32_t k, - void* workspace, - std::size_t worksize, - cudaStream_t stream, - bool isRowMajor, - float metric_arg); - -} // namespace detail -} // namespace distance -} // namespace raft