Skip to content

Commit

Permalink
update gtest rng seed
Browse files Browse the repository at this point in the history
  • Loading branch information
aamijar committed Aug 22, 2024
1 parent a4cdc7a commit 2be393a
Showing 1 changed file with 32 additions and 43 deletions.
75 changes: 32 additions & 43 deletions cpp/test/sparse/solver/lanczos.cu
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ class rmat_lanczos_tests
raft::device_vector<index_type, uint32_t, raft::row_major> out_dst =
raft::make_device_vector<index_type, uint32_t, raft::row_major>(handle, n_edges);

raft::random::RngState rng1{params.seed};

raft::random::rmat_rectangular_gen<index_type, value_type>(handle,
rng,
rng1,
make_const_mdspan(theta.view()),
out.view(),
out_src.view(),
Expand Down Expand Up @@ -404,48 +406,34 @@ const std::vector<lanczos_inputs<int, double>> inputsd = {
{-2.0369630, -1.7673520}}};

const std::vector<rmat_lanczos_inputs<int, float>> rmat_inputsf = {
{50,
100,
10000,
0,
0,
1e-9,
42,
12,
12,
1,
// {-122.53275 , -74.009415, -59.70774 , -54.678654, -49.700565,
// -34.015884, -32.097626, -31.29491 , -30.33276 , -22.899527,
// -20.49083 , -20.243006, -19.26677 , -18.43743 , -17.671614,
// -17.00962 , -16.72859 , -15.812017, -15.744598, -15.438096,
// -15.030397, -14.721282, -14.146572, -13.959946, -13.640783,
// -13.475106, -13.200468, -12.769644, -12.630838, -12.570684,
// -12.290903, -12.042329, -11.678847, -11.563247, -11.185609,
// -10.919437, -10.785621, -10.566719, -10.202344, -10.014745,
// -9.602258, -9.511378, -9.268343, -8.876679, -8.805339,
// -8.670585, -8.471375, -8.391085, -8.197367, -8.014922}
{-122.53162, -74.046684, -59.7358, -54.70629, -49.729855, -33.997437, -32.072914, -31.306896,
-30.339314, -22.891956, -20.453482, -20.1798, -19.275993, -18.436245, -17.653976, -17.008162,
-16.73615, -15.846376, -15.681458, -15.459055, -15.053776, -14.731912, -14.132045, -13.951516,
-13.603188, -13.477833, -13.191872, -12.771893, -12.634565, -12.592889, -12.280662, -12.032298,
-11.667132, -11.555687, -11.176134, -10.875261, -10.79131, -10.538387, -10.242246, -9.957915,
-9.627112, -9.508455, -9.254543, -8.852059, -8.82837, -8.712086, -8.445032, -8.385991,
-8.194637, -7.9835095}}};
{50, 100, 10000, 0, 0, 1e-9, 42, 12, 12, 1, {-122.526794, -74.00686, -59.698284, -54.68617,
-49.686813, -34.02644, -32.130703, -31.26906,
-30.32097, -22.946098, -20.497862, -20.23817,
-19.269697, -18.42496, -17.675667, -17.013401,
-16.734581, -15.820215, -15.73925, -15.448187,
-15.044634, -14.692028, -14.127425, -13.967386,
-13.6237755, -13.469393, -13.181225, -12.777589,
-12.623185, -12.55508, -12.2874565, -12.053391,
-11.677346, -11.558279, -11.163732, -10.922034,
-10.7936945, -10.558049, -10.205776, -10.005316,
-9.559181, -9.491834, -9.242631, -8.883637,
-8.765364, -8.688508, -8.458255, -8.385196,
-8.217982, -8.0442095}}};

const std::vector<rmat_lanczos_inputs<int, double>> rmat_inputsd = {
{50, 100, 10000, 0, 0, 1e-9, 42, 12, 12, 1, {-122.53275, -74.009415, -59.70774, -54.678654,
-49.700565, -34.015884, -32.097626, -31.29491,
-30.33276, -22.899527, -20.49083, -20.243006,
-19.26677, -18.43743, -17.671614, -17.00962,
-16.72859, -15.812017, -15.744598, -15.438096,
-15.030397, -14.721282, -14.146572, -13.959946,
-13.640783, -13.475106, -13.200468, -12.769644,
-12.630838, -12.570684, -12.290903, -12.042329,
-11.678847, -11.563247, -11.185609, -10.919437,
-10.785621, -10.566719, -10.202344, -10.014745,
-9.602258, -9.511378, -9.268343, -8.876679,
-8.805339, -8.670585, -8.471375, -8.391085,
-8.197367, -8.014922}}};
{50, 100, 10000, 0, 0, 1e-9, 42, 12, 12, 1, {-122.526794, -74.00686, -59.698284, -54.68617,
-49.686813, -34.02644, -32.130703, -31.26906,
-30.32097, -22.946098, -20.497862, -20.23817,
-19.269697, -18.42496, -17.675667, -17.013401,
-16.734581, -15.820215, -15.73925, -15.448187,
-15.044634, -14.692028, -14.127425, -13.967386,
-13.6237755, -13.469393, -13.181225, -12.777589,
-12.623185, -12.55508, -12.2874565, -12.053391,
-11.677346, -11.558279, -11.163732, -10.922034,
-10.7936945, -10.558049, -10.205776, -10.005316,
-9.559181, -9.491834, -9.242631, -8.883637,
-8.765364, -8.688508, -8.458255, -8.385196,
-8.217982, -8.0442095}}};

using LanczosTestF = lanczos_tests<int, float>;
TEST_P(LanczosTestF, Result) { Run(); }
Expand Down Expand Up @@ -519,8 +507,9 @@ TEST_P(DummyLanczosTest, Result)
raft::device_vector<index_type, uint32_t, raft::row_major> out_dst =
raft::make_device_vector<index_type, uint32_t, raft::row_major>(handle, n_edges);

raft::random::RngState rng1{42};
raft::random::rmat_rectangular_gen<index_type, value_type>(handle,
rng,
rng1,
make_const_mdspan(theta.view()),
out.view(),
out_src.view(),
Expand Down Expand Up @@ -591,7 +580,7 @@ INSTANTIATE_TEST_CASE_P(LanczosTests, LanczosTestD, ::testing::ValuesIn(inputsd)
INSTANTIATE_TEST_CASE_P(LanczosTests, RmatLanczosTestF, ::testing::ValuesIn(rmat_inputsf));
// INSTANTIATE_TEST_CASE_P(LanczosTests, RmatLanczosTestD, ::testing::ValuesIn(rmat_inputsd));

INSTANTIATE_TEST_CASE_P(LanczosTests, DummyLanczosTest, ::testing::ValuesIn(inputsf));
// INSTANTIATE_TEST_CASE_P(LanczosTests, DummyLanczosTest, ::testing::ValuesIn(inputsf));

} // namespace sparse
} // namespace raft

0 comments on commit 2be393a

Please sign in to comment.