diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index e22b446b6..f5980ba16 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -441,7 +441,6 @@ if(BUILD_SHARED_LIBS) src/neighbors/nn_descent_int8.cu src/neighbors/nn_descent_uint8.cu src/neighbors/reachability.cu - src/neighbors/quantization.cu src/neighbors/refine/detail/refine_device_float_float.cu src/neighbors/refine/detail/refine_device_half_float.cu src/neighbors/refine/detail/refine_device_int8_t_float.cu @@ -458,6 +457,7 @@ if(BUILD_SHARED_LIBS) src/neighbors/vamana_serialize_float.cu src/neighbors/vamana_serialize_uint8.cu src/neighbors/vamana_serialize_int8.cu + src/preprocessing/quantization.cu src/selection/select_k_float_int64_t.cu src/selection/select_k_float_int32_t.cu src/selection/select_k_float_uint32_t.cu diff --git a/cpp/include/cuvs/preprocessing/quantization.hpp b/cpp/include/cuvs/preprocessing/quantization.hpp index 10ef306ac..f3b638004 100644 --- a/cpp/include/cuvs/preprocessing/quantization.hpp +++ b/cpp/include/cuvs/preprocessing/quantization.hpp @@ -16,7 +16,6 @@ #pragma once -#include #include #include #include @@ -25,7 +24,7 @@ #include -namespace cuvs::neighbors::quantization { +namespace cuvs::preprocessing::quantization { /** * @brief ScalarQuantizer parameters. @@ -192,4 +191,4 @@ class ScalarQuantizer { T max_; }; -} // namespace cuvs::neighbors::quantization +} // namespace cuvs::preprocessing::quantization diff --git a/cpp/src/preprocessing/detail/quantization.cuh b/cpp/src/preprocessing/detail/quantization.cuh index b44a254d4..cd5d85515 100644 --- a/cpp/src/preprocessing/detail/quantization.cuh +++ b/cpp/src/preprocessing/detail/quantization.cuh @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include @@ -25,7 +25,7 @@ #include #include -namespace cuvs::neighbors::detail { +namespace cuvs::preprocessing::detail { template _RAFT_HOST_DEVICE bool fp_equals(const T& a, const T& b) @@ -214,4 +214,4 @@ raft::host_matrix inverse_scalar_transform( return out; } -} // namespace cuvs::neighbors::detail +} // namespace cuvs::preprocessing::detail diff --git a/cpp/src/preprocessing/quantization.cu b/cpp/src/preprocessing/quantization.cu index e8b609fa8..411e9509b 100644 --- a/cpp/src/preprocessing/quantization.cu +++ b/cpp/src/preprocessing/quantization.cu @@ -16,9 +16,9 @@ #include "./detail/quantization.cuh" -#include +#include -namespace cuvs::neighbors::quantization { +namespace cuvs::preprocessing::quantization { template void ScalarQuantizer::train(raft::resources const& res, @@ -126,7 +126,7 @@ _RAFT_HOST_DEVICE T ScalarQuantizer::max() const } #define CUVS_INST_QUANTIZATION(T, QuantI) \ - template struct cuvs::neighbors::quantization::ScalarQuantizer; + template struct cuvs::preprocessing::quantization::ScalarQuantizer; CUVS_INST_QUANTIZATION(double, int8_t); CUVS_INST_QUANTIZATION(float, int8_t); @@ -134,4 +134,4 @@ CUVS_INST_QUANTIZATION(half, int8_t); #undef CUVS_INST_QUANTIZATION -} // namespace cuvs::neighbors::quantization \ No newline at end of file +} // namespace cuvs::preprocessing::quantization \ No newline at end of file diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 33bb9c00a..1433d6411 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -93,18 +93,8 @@ endfunction() if(BUILD_TESTS) ConfigureTest( - NAME - NEIGHBORS_TEST - PATH - neighbors/brute_force.cu - neighbors/brute_force_prefiltered.cu - neighbors/sparse_brute_force.cu - neighbors/refine.cu - neighbors/quantization.cu - GPUS - 1 - PERCENT - 100 + NAME NEIGHBORS_TEST PATH neighbors/brute_force.cu neighbors/brute_force_prefiltered.cu + neighbors/sparse_brute_force.cu neighbors/refine.cu GPUS 1 PERCENT 100 ) ConfigureTest( @@ -223,6 +213,9 @@ if(BUILD_TESTS) PERCENT 100 ) + + ConfigureTest(NAME PREPROCESSING_TEST PATH preprocessing/quantization.cu GPUS 1 PERCENT 100) + ConfigureTest( NAME STATS_TEST PATH stats/trustworthiness.cu stats/silhouette_score.cu GPUS 1 PERCENT 100 ) diff --git a/cpp/test/preprocessing/quantization.cu b/cpp/test/preprocessing/quantization.cu index 7bc1c5291..c67ef8ef4 100644 --- a/cpp/test/preprocessing/quantization.cu +++ b/cpp/test/preprocessing/quantization.cu @@ -15,7 +15,7 @@ */ #include "../test_utils.cuh" -#include +#include #include #include #include @@ -23,11 +23,11 @@ #include #include -namespace cuvs::neighbors::quantization { +namespace cuvs::preprocessing::quantization { template struct QuantizationInputs { - cuvs::neighbors::quantization::sq_params quantization_params; + cuvs::preprocessing::quantization::sq_params quantization_params; int rows; int cols; T min = T(-1.0); @@ -105,7 +105,7 @@ class QuantizationTest : public ::testing::TestWithParam> size_t print_size = std::min(input_.size(), 20ul); // train quantizer_1 on device - cuvs::neighbors::quantization::ScalarQuantizer quantizer_1; + cuvs::preprocessing::quantization::ScalarQuantizer quantizer_1; quantizer_1.train(handle, params_.quantization_params, dataset); std::cerr << "Q1: trained = " << quantizer_1.is_trained() << ", min = " << (double)quantizer_1.min() << ", max = " << (double)quantizer_1.max() @@ -160,7 +160,7 @@ class QuantizationTest : public ::testing::TestWithParam> } // train quantizer_2 on host - cuvs::neighbors::quantization::ScalarQuantizer quantizer_2; + cuvs::preprocessing::quantization::ScalarQuantizer quantizer_2; quantizer_2.train(handle, params_.quantization_params, dataset_h); std::cerr << "Q2: trained = " << quantizer_2.is_trained() << ", min = " << (double)quantizer_2.min() << ", max = " << (double)quantizer_2.max() @@ -274,4 +274,4 @@ INSTANTIATE_TEST_CASE_P(QuantizationTest, QuantizationTest_half_int8t, ::testing::ValuesIn(inputs)); -} // namespace cuvs::neighbors::quantization +} // namespace cuvs::preprocessing::quantization