
#pragma once
#include <cassert>
#include <cuvs/distance/distance_types.hpp>
#include <fstream>
#include <iostream>
#include <memory>
#include <raft/core/device_mdspan.hpp>
#include <raft/core/logger.hpp>
#include <raft/util/cudart_utils.hpp>
#include <rmm/device_uvector.hpp>
#include <sstream>
#include <stdexcept>
#include <string>
#include <type_traits>

namespace cuvs::bench {

inline cuvs::distance::DistanceType parse_metric_type(cuvs::bench::Metric metric)
{
  if (metric == cuvs::bench::Metric::kInnerProduct) {
    return cuvs::distance::DistanceType::InnerProduct;
  } else if (metric == cuvs::bench::Metric::kEuclidean) {
    // Even for L2 expanded RAFT IVF Flat uses unexpanded formula
    return cuvs::distance::DistanceType::L2Expanded;
  } else {
    throw std::runtime_error("raft supports only metric type of inner product and L2");
  }
}
}  // namespace cuvs::bench
