

#include <cuvs/distance/distance_types.hpp>
#include <raft/core/resources.hpp>

namespace raft::runtime::distance {

/**
 * @defgroup fused_l2_nn_min_arg_runtime Fused L2 1NN Runtime API
 * @{
 */

/**
 * @brief Wrapper around fusedL2NN with minimum reduction operators.
 *
 * fusedL2NN cannot be compiled in the distance library due to the lambda
 * operators, so this wrapper covers the most common case (minimum).
 *
 * @param[in] handle         raft handle
 * @param[out] min           will contain the reduced output (Length = `m`)
 *                           (on device)
 * @param[in]  x             first matrix. Row major. Dim = `m x k`.
 *                           (on device).
 * @param[in]  y             second matrix. Row major. Dim = `n x k`.
 *                           (on device).
 * @param[in]  m             gemm m
 * @param[in]  n             gemm n
 * @param[in]  k             gemm k
 * @param[in]  sqrt          Whether the output `minDist` should contain L2-sqrt
 */
void fused_l2_nn_min_arg(raft::resources const& handle,
                         int* min,
                         const float* x,
                         const float* y,
                         int m,
                         int n,
                         int k,
                         bool sqrt);

void fused_l2_nn_min_arg(raft::resources const& handle,
                         int* min,
                         const double* x,
                         const double* y,
                         int m,
                         int n,
                         int k,
                         bool sqrt);

/** @} */  // end group fused_l2_nn_min_arg_runtime

}  // end namespace raft::runtime::distance
