diff --git a/cpp/include/raft/stats/detail/mean.cuh b/cpp/include/raft/stats/detail/mean.cuh index ee39c87a68..d1de474e8d 100644 --- a/cpp/include/raft/stats/detail/mean.cuh +++ b/cpp/include/raft/stats/detail/mean.cuh @@ -27,10 +27,9 @@ namespace stats { namespace detail { template -void mean( - Type* mu, const Type* data, IdxType D, IdxType N, bool sample, bool rowMajor, cudaStream_t stream) +void mean(Type* mu, const Type* data, IdxType D, IdxType N, bool rowMajor, cudaStream_t stream) { - Type ratio = Type(1) / ((sample) ? Type(N - 1) : Type(N)); + Type ratio = Type(1) / Type(N); raft::linalg::reduce(mu, data, D, diff --git a/cpp/include/raft/stats/detail/scores.cuh b/cpp/include/raft/stats/detail/scores.cuh index 947df6848a..66951f52ab 100644 --- a/cpp/include/raft/stats/detail/scores.cuh +++ b/cpp/include/raft/stats/detail/scores.cuh @@ -59,7 +59,7 @@ math_t r2_score(math_t* y, math_t* y_hat, int n, cudaStream_t stream) { rmm::device_scalar y_bar(stream); - raft::stats::mean(y_bar.data(), y, 1, n, false, false, stream); + raft::stats::mean(y_bar.data(), y, 1, n, false, stream); RAFT_CUDA_TRY(cudaPeekAtLastError()); rmm::device_uvector sse_arr(n, stream); diff --git a/cpp/include/raft/stats/mean.cuh b/cpp/include/raft/stats/mean.cuh index 43d39cfd6c..3147216211 100644 --- a/cpp/include/raft/stats/mean.cuh +++ b/cpp/include/raft/stats/mean.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,17 +38,13 @@ namespace stats { * @param data: the input matrix * @param D: number of columns of data * @param N: number of rows of data - * @param sample: whether to evaluate sample mean or not. In other words, - * whether - * to normalize the output using N-1 or N, for true or false, respectively * @param rowMajor: whether the input data is row or col major * @param stream: cuda stream */ template -void mean( - Type* mu, const Type* data, IdxType D, IdxType N, bool sample, bool rowMajor, cudaStream_t stream) +void mean(Type* mu, const Type* data, IdxType D, IdxType N, bool rowMajor, cudaStream_t stream) { - detail::mean(mu, data, D, N, sample, rowMajor, stream); + detail::mean(mu, data, D, N, rowMajor, stream); } /** @@ -67,14 +63,11 @@ void mean( * @param[in] handle the raft handle * @param[in] data: the input matrix * @param[out] mu: the output mean vector - * @param[in] sample: whether to evaluate sample mean or not. In other words, whether - * to normalize the output using N-1 or N, for true or false, respectively */ template void mean(raft::resources const& handle, raft::device_matrix_view data, - raft::device_vector_view mu, - bool sample) + raft::device_vector_view mu) { static_assert( std::is_same_v || std::is_same_v, @@ -86,7 +79,6 @@ void mean(raft::resources const& handle, data.data_handle(), data.extent(1), data.extent(0), - sample, std::is_same_v, resource::get_cuda_stream(handle)); } diff --git a/cpp/test/neighbors/ann_ivf_flat.cuh b/cpp/test/neighbors/ann_ivf_flat.cuh index de6af589fa..314a0efae1 100644 --- a/cpp/test/neighbors/ann_ivf_flat.cuh +++ b/cpp/test/neighbors/ann_ivf_flat.cuh @@ -288,7 +288,7 @@ class AnnIVFFlatTest : public ::testing::TestWithParam> { (IdxT)ps.dim, stream_); raft::stats::mean( - centroid.data(), cluster_data.data(), ps.dim, list_sizes[l], false, true, stream_); + centroid.data(), cluster_data.data(), ps.dim, list_sizes[l], true, stream_); ASSERT_TRUE(raft::devArrMatch(index_2.centers().data_handle() + ps.dim * l, centroid.data(), ps.dim, diff --git a/cpp/test/random/rng.cu b/cpp/test/random/rng.cu index a37f150d4c..172f94ae50 100644 --- a/cpp/test/random/rng.cu +++ b/cpp/test/random/rng.cu @@ -407,8 +407,7 @@ TEST(Rng, MeanError) RngState r(seed, rtype); normal(handle, r, data.data(), len, 3.3f, 0.23f); // uniform(r, data, len, -1.0, 2.0); - raft::stats::mean( - mean_result.data(), data.data(), num_samples, num_experiments, false, false, stream); + raft::stats::mean(mean_result.data(), data.data(), num_samples, num_experiments, false, stream); raft::stats::stddev(std_result.data(), data.data(), mean_result.data(), diff --git a/cpp/test/stats/cov.cu b/cpp/test/stats/cov.cu index 602f356b9f..3f2a3dcebf 100644 --- a/cpp/test/stats/cov.cu +++ b/cpp/test/stats/cov.cu @@ -72,7 +72,7 @@ class CovTest : public ::testing::TestWithParam> { cov_act.resize(cols * cols, stream); normal(handle, r, data.data(), len, params.mean, var); - raft::stats::mean(mean_act.data(), data.data(), cols, rows, false, params.rowMajor, stream); + raft::stats::mean(mean_act.data(), data.data(), cols, rows, params.rowMajor, stream); if (params.rowMajor) { using layout = raft::row_major; cov(handle, @@ -102,7 +102,7 @@ class CovTest : public ::testing::TestWithParam> { raft::update_device(data_cm.data(), data_h, 6, stream); raft::update_device(cov_cm_ref.data(), cov_cm_ref_h, 4, stream); - raft::stats::mean(mean_cm.data(), data_cm.data(), 2, 3, false, false, stream); + raft::stats::mean(mean_cm.data(), data_cm.data(), 2, 3, false, stream); cov(handle, cov_cm.data(), data_cm.data(), mean_cm.data(), 2, 3, true, false, true, stream); } diff --git a/cpp/test/stats/mean.cu b/cpp/test/stats/mean.cu index c5fe83d95b..e72d4eaf74 100644 --- a/cpp/test/stats/mean.cu +++ b/cpp/test/stats/mean.cu @@ -33,7 +33,7 @@ template struct MeanInputs { T tolerance, mean; int rows, cols; - bool sample, rowMajor; + bool rowMajor; unsigned long long int seed; T stddev = (T)1.0; }; @@ -42,7 +42,7 @@ template ::std::ostream& operator<<(::std::ostream& os, const MeanInputs& dims) { return os << "{ " << dims.tolerance << ", " << dims.rows << ", " << dims.cols << ", " - << dims.sample << ", " << dims.rowMajor << ", " << dims.stddev << "}" << std::endl; + << ", " << dims.rowMajor << ", " << dims.stddev << "}" << std::endl; } template @@ -74,14 +74,12 @@ class MeanTest : public ::testing::TestWithParam> { using layout = raft::row_major; mean(handle, raft::make_device_matrix_view(data, rows, cols), - raft::make_device_vector_view(mean_act.data(), cols), - params.sample); + raft::make_device_vector_view(mean_act.data(), cols)); } else { using layout = raft::col_major; mean(handle, raft::make_device_matrix_view(data, rows, cols), - raft::make_device_vector_view(mean_act.data(), cols), - params.sample); + raft::make_device_vector_view(mean_act.data(), cols)); } } @@ -98,72 +96,51 @@ class MeanTest : public ::testing::TestWithParam> { // measured mean (of a normal distribution) will fall outside of an epsilon of // 0.15 only 4/10000 times. (epsilon of 0.1 will fail 30/100 times) const std::vector> inputsf = { - {0.15f, 1.f, 1024, 32, true, false, 1234ULL}, - {0.15f, 1.f, 1024, 64, true, false, 1234ULL}, - {0.15f, 1.f, 1024, 128, true, false, 1234ULL}, - {0.15f, 1.f, 1024, 256, true, false, 1234ULL}, - {0.15f, -1.f, 1024, 32, false, false, 1234ULL}, - {0.15f, -1.f, 1024, 64, false, false, 1234ULL}, - {0.15f, -1.f, 1024, 128, false, false, 1234ULL}, - {0.15f, -1.f, 1024, 256, false, false, 1234ULL}, - {0.15f, 1.f, 1024, 32, true, true, 1234ULL}, - {0.15f, 1.f, 1024, 64, true, true, 1234ULL}, - {0.15f, 1.f, 1024, 128, true, true, 1234ULL}, - {0.15f, 1.f, 1024, 256, true, true, 1234ULL}, - {0.15f, -1.f, 1024, 32, false, true, 1234ULL}, - {0.15f, -1.f, 1024, 64, false, true, 1234ULL}, - {0.15f, -1.f, 1024, 128, false, true, 1234ULL}, - {0.15f, -1.f, 1024, 256, false, true, 1234ULL}, - {0.15f, -1.f, 1030, 1, false, false, 1234ULL}, - {0.15f, -1.f, 1030, 60, true, false, 1234ULL}, - {2.0f, -1.f, 31, 120, false, false, 1234ULL}, - {2.0f, -1.f, 1, 130, false, false, 1234ULL}, - {0.15f, -1.f, 1030, 1, false, true, 1234ULL}, - {0.15f, -1.f, 1030, 60, true, true, 1234ULL}, - {2.0f, -1.f, 31, 120, false, true, 1234ULL}, - {2.0f, -1.f, 1, 130, false, true, 1234ULL}, - {2.0f, -1.f, 1, 1, false, false, 1234ULL}, - {2.0f, -1.f, 1, 1, false, true, 1234ULL}, - {2.0f, -1.f, 7, 23, false, false, 1234ULL}, - {2.0f, -1.f, 7, 23, false, true, 1234ULL}, - {2.0f, -1.f, 17, 5, false, false, 1234ULL}, - {2.0f, -1.f, 17, 5, false, true, 1234ULL}, - {0.0001f, 0.1f, 1 << 27, 2, false, false, 1234ULL, 0.0001f}, - {0.0001f, 0.1f, 1 << 27, 2, false, true, 1234ULL, 0.0001f}}; - -const std::vector> inputsd = { - {0.15, 1.0, 1024, 32, true, false, 1234ULL}, - {0.15, 1.0, 1024, 64, true, false, 1234ULL}, - {0.15, 1.0, 1024, 128, true, false, 1234ULL}, - {0.15, 1.0, 1024, 256, true, false, 1234ULL}, - {0.15, -1.0, 1024, 32, false, false, 1234ULL}, - {0.15, -1.0, 1024, 64, false, false, 1234ULL}, - {0.15, -1.0, 1024, 128, false, false, 1234ULL}, - {0.15, -1.0, 1024, 256, false, false, 1234ULL}, - {0.15, 1.0, 1024, 32, true, true, 1234ULL}, - {0.15, 1.0, 1024, 64, true, true, 1234ULL}, - {0.15, 1.0, 1024, 128, true, true, 1234ULL}, - {0.15, 1.0, 1024, 256, true, true, 1234ULL}, - {0.15, -1.0, 1024, 32, false, true, 1234ULL}, - {0.15, -1.0, 1024, 64, false, true, 1234ULL}, - {0.15, -1.0, 1024, 128, false, true, 1234ULL}, - {0.15, -1.0, 1024, 256, false, true, 1234ULL}, - {0.15, -1.0, 1030, 1, false, false, 1234ULL}, - {0.15, -1.0, 1030, 60, true, false, 1234ULL}, - {2.0, -1.0, 31, 120, false, false, 1234ULL}, - {2.0, -1.0, 1, 130, false, false, 1234ULL}, - {0.15, -1.0, 1030, 1, false, true, 1234ULL}, - {0.15, -1.0, 1030, 60, true, true, 1234ULL}, - {2.0, -1.0, 31, 120, false, true, 1234ULL}, - {2.0, -1.0, 1, 130, false, true, 1234ULL}, - {2.0, -1.0, 1, 1, false, false, 1234ULL}, - {2.0, -1.0, 1, 1, false, true, 1234ULL}, - {2.0, -1.0, 7, 23, false, false, 1234ULL}, - {2.0, -1.0, 7, 23, false, true, 1234ULL}, - {2.0, -1.0, 17, 5, false, false, 1234ULL}, - {2.0, -1.0, 17, 5, false, true, 1234ULL}, - {1e-8, 1e-1, 1 << 27, 2, false, false, 1234ULL, 0.0001}, - {1e-8, 1e-1, 1 << 27, 2, false, true, 1234ULL, 0.0001}}; + {0.15f, -1.f, 1024, 32, false, 1234ULL}, + {0.15f, -1.f, 1024, 64, false, 1234ULL}, + {0.15f, -1.f, 1024, 128, false, 1234ULL}, + {0.15f, -1.f, 1024, 256, false, 1234ULL}, + {0.15f, -1.f, 1024, 32, true, 1234ULL}, + {0.15f, -1.f, 1024, 64, true, 1234ULL}, + {0.15f, -1.f, 1024, 128, true, 1234ULL}, + {0.15f, -1.f, 1024, 256, true, 1234ULL}, + {0.15f, -1.f, 1030, 1, false, 1234ULL}, + {2.0f, -1.f, 31, 120, false, 1234ULL}, + {2.0f, -1.f, 1, 130, false, 1234ULL}, + {0.15f, -1.f, 1030, 1, true, 1234ULL}, + {2.0f, -1.f, 31, 120, true, 1234ULL}, + {2.0f, -1.f, 1, 130, true, 1234ULL}, + {2.0f, -1.f, 1, 1, false, 1234ULL}, + {2.0f, -1.f, 1, 1, true, 1234ULL}, + {2.0f, -1.f, 7, 23, false, 1234ULL}, + {2.0f, -1.f, 7, 23, true, 1234ULL}, + {2.0f, -1.f, 17, 5, false, 1234ULL}, + {2.0f, -1.f, 17, 5, true, 1234ULL}, + {0.0001f, 0.1f, 1 << 27, 2, false, 1234ULL, 0.0001f}, + {0.0001f, 0.1f, 1 << 27, 2, true, 1234ULL, 0.0001f}}; + +const std::vector> inputsd = {{0.15, -1.0, 1024, 32, false, 1234ULL}, + {0.15, -1.0, 1024, 64, false, 1234ULL}, + {0.15, -1.0, 1024, 128, false, 1234ULL}, + {0.15, -1.0, 1024, 256, false, 1234ULL}, + {0.15, -1.0, 1024, 32, true, 1234ULL}, + {0.15, -1.0, 1024, 64, true, 1234ULL}, + {0.15, -1.0, 1024, 128, true, 1234ULL}, + {0.15, -1.0, 1024, 256, true, 1234ULL}, + {0.15, -1.0, 1030, 1, false, 1234ULL}, + {2.0, -1.0, 31, 120, false, 1234ULL}, + {2.0, -1.0, 1, 130, false, 1234ULL}, + {0.15, -1.0, 1030, 1, true, 1234ULL}, + {2.0, -1.0, 31, 120, true, 1234ULL}, + {2.0, -1.0, 1, 130, true, 1234ULL}, + {2.0, -1.0, 1, 1, false, 1234ULL}, + {2.0, -1.0, 1, 1, true, 1234ULL}, + {2.0, -1.0, 7, 23, false, 1234ULL}, + {2.0, -1.0, 7, 23, true, 1234ULL}, + {2.0, -1.0, 17, 5, false, 1234ULL}, + {2.0, -1.0, 17, 5, true, 1234ULL}, + {1e-8, 1e-1, 1 << 27, 2, false, 1234ULL, 0.0001}, + {1e-8, 1e-1, 1 << 27, 2, true, 1234ULL, 0.0001}}; typedef MeanTest MeanTestF; TEST_P(MeanTestF, Result) diff --git a/cpp/test/stats/mean_center.cu b/cpp/test/stats/mean_center.cu index b44d87d1bd..48bf50056c 100644 --- a/cpp/test/stats/mean_center.cu +++ b/cpp/test/stats/mean_center.cu @@ -32,7 +32,7 @@ template struct MeanCenterInputs { T tolerance, mean; IdxType rows, cols; - bool sample, rowMajor, bcastAlongRows; + bool rowMajor, bcastAlongRows; unsigned long long int seed; }; @@ -64,8 +64,7 @@ class MeanCenterTest : public ::testing::TestWithParam> inputsf_i32 = { - {0.05f, 1.f, 1024, 32, true, false, true, 1234ULL}, - {0.05f, 1.f, 1024, 64, true, false, true, 1234ULL}, - {0.05f, 1.f, 1024, 128, true, false, true, 1234ULL}, - {0.05f, -1.f, 1024, 32, false, false, true, 1234ULL}, - {0.05f, -1.f, 1024, 64, false, false, true, 1234ULL}, - {0.05f, -1.f, 1024, 128, false, false, true, 1234ULL}, - {0.05f, 1.f, 1024, 32, true, true, true, 1234ULL}, - {0.05f, 1.f, 1024, 64, true, true, true, 1234ULL}, - {0.05f, 1.f, 1024, 128, true, true, true, 1234ULL}, - {0.05f, -1.f, 1024, 32, false, true, true, 1234ULL}, - {0.05f, -1.f, 1024, 64, false, true, true, 1234ULL}, - {0.05f, -1.f, 1024, 128, false, true, true, 1234ULL}, - {0.05f, 1.f, 1024, 32, true, false, false, 1234ULL}, - {0.05f, 1.f, 1024, 64, true, false, false, 1234ULL}, - {0.05f, 1.f, 1024, 128, true, false, false, 1234ULL}, - {0.05f, -1.f, 1024, 32, false, false, false, 1234ULL}, - {0.05f, -1.f, 1024, 64, false, false, false, 1234ULL}, - {0.05f, -1.f, 1024, 128, false, false, false, 1234ULL}, - {0.05f, 1.f, 1024, 32, true, true, false, 1234ULL}, - {0.05f, 1.f, 1024, 64, true, true, false, 1234ULL}, - {0.05f, 1.f, 1024, 128, true, true, false, 1234ULL}, - {0.05f, -1.f, 1024, 32, false, true, false, 1234ULL}, - {0.05f, -1.f, 1024, 64, false, true, false, 1234ULL}, - {0.05f, -1.f, 1024, 128, false, true, false, 1234ULL}}; + {0.05f, -1.f, 1024, 32, false, true, 1234ULL}, + {0.05f, -1.f, 1024, 64, false, true, 1234ULL}, + {0.05f, -1.f, 1024, 128, false, true, 1234ULL}, + {0.05f, -1.f, 1024, 32, true, true, 1234ULL}, + {0.05f, -1.f, 1024, 64, true, true, 1234ULL}, + {0.05f, -1.f, 1024, 128, true, true, 1234ULL}, + {0.05f, -1.f, 1024, 32, false, false, 1234ULL}, + {0.05f, -1.f, 1024, 64, false, false, 1234ULL}, + {0.05f, -1.f, 1024, 128, false, false, 1234ULL}, + {0.05f, -1.f, 1024, 32, true, false, 1234ULL}, + {0.05f, -1.f, 1024, 64, true, false, 1234ULL}, + {0.05f, -1.f, 1024, 128, true, false, 1234ULL}}; typedef MeanCenterTest MeanCenterTestF_i32; TEST_P(MeanCenterTestF_i32, Result) { @@ -136,30 +123,18 @@ TEST_P(MeanCenterTestF_i32, Result) INSTANTIATE_TEST_SUITE_P(MeanCenterTests, MeanCenterTestF_i32, ::testing::ValuesIn(inputsf_i32)); const std::vector> inputsf_i64 = { - {0.05f, 1.f, 1024, 32, true, false, true, 1234ULL}, - {0.05f, 1.f, 1024, 64, true, false, true, 1234ULL}, - {0.05f, 1.f, 1024, 128, true, false, true, 1234ULL}, - {0.05f, -1.f, 1024, 32, false, false, true, 1234ULL}, - {0.05f, -1.f, 1024, 64, false, false, true, 1234ULL}, - {0.05f, -1.f, 1024, 128, false, false, true, 1234ULL}, - {0.05f, 1.f, 1024, 32, true, true, true, 1234ULL}, - {0.05f, 1.f, 1024, 64, true, true, true, 1234ULL}, - {0.05f, 1.f, 1024, 128, true, true, true, 1234ULL}, - {0.05f, -1.f, 1024, 32, false, true, true, 1234ULL}, - {0.05f, -1.f, 1024, 64, false, true, true, 1234ULL}, - {0.05f, -1.f, 1024, 128, false, true, true, 1234ULL}, - {0.05f, 1.f, 1024, 32, true, false, false, 1234ULL}, - {0.05f, 1.f, 1024, 64, true, false, false, 1234ULL}, - {0.05f, 1.f, 1024, 128, true, false, false, 1234ULL}, - {0.05f, -1.f, 1024, 32, false, false, false, 1234ULL}, - {0.05f, -1.f, 1024, 64, false, false, false, 1234ULL}, - {0.05f, -1.f, 1024, 128, false, false, false, 1234ULL}, - {0.05f, 1.f, 1024, 32, true, true, false, 1234ULL}, - {0.05f, 1.f, 1024, 64, true, true, false, 1234ULL}, - {0.05f, 1.f, 1024, 128, true, true, false, 1234ULL}, - {0.05f, -1.f, 1024, 32, false, true, false, 1234ULL}, - {0.05f, -1.f, 1024, 64, false, true, false, 1234ULL}, - {0.05f, -1.f, 1024, 128, false, true, false, 1234ULL}}; + {0.05f, -1.f, 1024, 32, false, true, 1234ULL}, + {0.05f, -1.f, 1024, 64, false, true, 1234ULL}, + {0.05f, -1.f, 1024, 128, false, true, 1234ULL}, + {0.05f, -1.f, 1024, 32, true, true, 1234ULL}, + {0.05f, -1.f, 1024, 64, true, true, 1234ULL}, + {0.05f, -1.f, 1024, 128, true, true, 1234ULL}, + {0.05f, -1.f, 1024, 32, false, false, 1234ULL}, + {0.05f, -1.f, 1024, 64, false, false, 1234ULL}, + {0.05f, -1.f, 1024, 128, false, false, 1234ULL}, + {0.05f, -1.f, 1024, 32, true, false, 1234ULL}, + {0.05f, -1.f, 1024, 64, true, false, 1234ULL}, + {0.05f, -1.f, 1024, 128, true, false, 1234ULL}}; typedef MeanCenterTest MeanCenterTestF_i64; TEST_P(MeanCenterTestF_i64, Result) { @@ -169,30 +144,18 @@ TEST_P(MeanCenterTestF_i64, Result) INSTANTIATE_TEST_SUITE_P(MeanCenterTests, MeanCenterTestF_i64, ::testing::ValuesIn(inputsf_i64)); const std::vector> inputsd_i32 = { - {0.05, 1.0, 1024, 32, true, false, true, 1234ULL}, - {0.05, 1.0, 1024, 64, true, false, true, 1234ULL}, - {0.05, 1.0, 1024, 128, true, false, true, 1234ULL}, - {0.05, -1.0, 1024, 32, false, false, true, 1234ULL}, - {0.05, -1.0, 1024, 64, false, false, true, 1234ULL}, - {0.05, -1.0, 1024, 128, false, false, true, 1234ULL}, - {0.05, 1.0, 1024, 32, true, true, true, 1234ULL}, - {0.05, 1.0, 1024, 64, true, true, true, 1234ULL}, - {0.05, 1.0, 1024, 128, true, true, true, 1234ULL}, - {0.05, -1.0, 1024, 32, false, true, true, 1234ULL}, - {0.05, -1.0, 1024, 64, false, true, true, 1234ULL}, - {0.05, -1.0, 1024, 128, false, true, true, 1234ULL}, - {0.05, 1.0, 1024, 32, true, false, false, 1234ULL}, - {0.05, 1.0, 1024, 64, true, false, false, 1234ULL}, - {0.05, 1.0, 1024, 128, true, false, false, 1234ULL}, - {0.05, -1.0, 1024, 32, false, false, false, 1234ULL}, - {0.05, -1.0, 1024, 64, false, false, false, 1234ULL}, - {0.05, -1.0, 1024, 128, false, false, false, 1234ULL}, - {0.05, 1.0, 1024, 32, true, true, false, 1234ULL}, - {0.05, 1.0, 1024, 64, true, true, false, 1234ULL}, - {0.05, 1.0, 1024, 128, true, true, false, 1234ULL}, - {0.05, -1.0, 1024, 32, false, true, false, 1234ULL}, - {0.05, -1.0, 1024, 64, false, true, false, 1234ULL}, - {0.05, -1.0, 1024, 128, false, true, false, 1234ULL}}; + {0.05, -1.0, 1024, 32, false, true, 1234ULL}, + {0.05, -1.0, 1024, 64, false, true, 1234ULL}, + {0.05, -1.0, 1024, 128, false, true, 1234ULL}, + {0.05, -1.0, 1024, 32, true, true, 1234ULL}, + {0.05, -1.0, 1024, 64, true, true, 1234ULL}, + {0.05, -1.0, 1024, 128, true, true, 1234ULL}, + {0.05, -1.0, 1024, 32, false, false, 1234ULL}, + {0.05, -1.0, 1024, 64, false, false, 1234ULL}, + {0.05, -1.0, 1024, 128, false, false, 1234ULL}, + {0.05, -1.0, 1024, 32, true, false, 1234ULL}, + {0.05, -1.0, 1024, 64, true, false, 1234ULL}, + {0.05, -1.0, 1024, 128, true, false, 1234ULL}}; typedef MeanCenterTest MeanCenterTestD_i32; TEST_P(MeanCenterTestD_i32, Result) { @@ -202,30 +165,18 @@ TEST_P(MeanCenterTestD_i32, Result) INSTANTIATE_TEST_SUITE_P(MeanCenterTests, MeanCenterTestD_i32, ::testing::ValuesIn(inputsd_i32)); const std::vector> inputsd_i64 = { - {0.05, 1.0, 1024, 32, true, false, true, 1234ULL}, - {0.05, 1.0, 1024, 64, true, false, true, 1234ULL}, - {0.05, 1.0, 1024, 128, true, false, true, 1234ULL}, - {0.05, -1.0, 1024, 32, false, false, true, 1234ULL}, - {0.05, -1.0, 1024, 64, false, false, true, 1234ULL}, - {0.05, -1.0, 1024, 128, false, false, true, 1234ULL}, - {0.05, 1.0, 1024, 32, true, true, true, 1234ULL}, - {0.05, 1.0, 1024, 64, true, true, true, 1234ULL}, - {0.05, 1.0, 1024, 128, true, true, true, 1234ULL}, - {0.05, -1.0, 1024, 32, false, true, true, 1234ULL}, - {0.05, -1.0, 1024, 64, false, true, true, 1234ULL}, - {0.05, -1.0, 1024, 128, false, true, true, 1234ULL}, - {0.05, 1.0, 1024, 32, true, false, false, 1234ULL}, - {0.05, 1.0, 1024, 64, true, false, false, 1234ULL}, - {0.05, 1.0, 1024, 128, true, false, false, 1234ULL}, - {0.05, -1.0, 1024, 32, false, false, false, 1234ULL}, - {0.05, -1.0, 1024, 64, false, false, false, 1234ULL}, - {0.05, -1.0, 1024, 128, false, false, false, 1234ULL}, - {0.05, 1.0, 1024, 32, true, true, false, 1234ULL}, - {0.05, 1.0, 1024, 64, true, true, false, 1234ULL}, - {0.05, 1.0, 1024, 128, true, true, false, 1234ULL}, - {0.05, -1.0, 1024, 32, false, true, false, 1234ULL}, - {0.05, -1.0, 1024, 64, false, true, false, 1234ULL}, - {0.05, -1.0, 1024, 128, false, true, false, 1234ULL}}; + {0.05, -1.0, 1024, 32, false, true, 1234ULL}, + {0.05, -1.0, 1024, 64, false, true, 1234ULL}, + {0.05, -1.0, 1024, 128, false, true, 1234ULL}, + {0.05, -1.0, 1024, 32, true, true, 1234ULL}, + {0.05, -1.0, 1024, 64, true, true, 1234ULL}, + {0.05, -1.0, 1024, 128, true, true, 1234ULL}, + {0.05, -1.0, 1024, 32, false, false, 1234ULL}, + {0.05, -1.0, 1024, 64, false, false, 1234ULL}, + {0.05, -1.0, 1024, 128, false, false, 1234ULL}, + {0.05, -1.0, 1024, 32, true, false, 1234ULL}, + {0.05, -1.0, 1024, 64, true, false, 1234ULL}, + {0.05, -1.0, 1024, 128, true, false, 1234ULL}}; typedef MeanCenterTest MeanCenterTestD_i64; TEST_P(MeanCenterTestD_i64, Result) { diff --git a/cpp/test/stats/stddev.cu b/cpp/test/stats/stddev.cu index f4c5f92f49..a9a70b1e60 100644 --- a/cpp/test/stats/stddev.cu +++ b/cpp/test/stats/stddev.cu @@ -81,8 +81,7 @@ class StdDevTest : public ::testing::TestWithParam> { using layout_t = raft::row_major; mean(handle, raft::make_device_matrix_view(data, rows, cols), - raft::make_device_vector_view(mean_act.data(), cols), - false); + raft::make_device_vector_view(mean_act.data(), cols)); stddev(handle, raft::make_device_matrix_view(data, rows, cols), @@ -99,8 +98,7 @@ class StdDevTest : public ::testing::TestWithParam> { using layout_t = raft::col_major; mean(handle, raft::make_device_matrix_view(data, rows, cols), - raft::make_device_vector_view(mean_act.data(), cols), - false); + raft::make_device_vector_view(mean_act.data(), cols)); stddev(handle, raft::make_device_matrix_view(data, rows, cols),