From e2e05af5047511eed26204e55f0bbb1c3a038fc8 Mon Sep 17 00:00:00 2001 From: Riley Murray Date: Mon, 26 Aug 2024 14:15:13 -0400 Subject: [PATCH] rename DenseDistName to ScalarDist --- RandBLAS/dense_skops.hh | 35 ++++++----- .../qrcp_matrixmarket.cc | 4 +- .../svd_rank1_plus_noise.cc | 4 +- rtd/source/api_reference/skops_and_dists.rst | 2 +- test/test_basic_rng/benchmark_speed.cc | 2 +- test/test_basic_rng/test_continuous.cc | 52 ++++++++-------- test/test_basic_rng/test_distortion.cc | 10 +-- test/test_datastructures/test_denseskop.cc | 62 +++++++++---------- .../test_datastructures/test_spmats/common.hh | 4 +- test/test_handrolled_lapack.cc | 8 +-- .../test_sketch_symmetric.cc | 6 +- 11 files changed, 95 insertions(+), 94 deletions(-) diff --git a/RandBLAS/dense_skops.hh b/RandBLAS/dense_skops.hh index 051c126e..11263299 100644 --- a/RandBLAS/dense_skops.hh +++ b/RandBLAS/dense_skops.hh @@ -172,7 +172,7 @@ static RNGState fill_dense_submat_impl(int64_t n_cols, T* smat, int64_t n_s template RNGState compute_next_state(DD dist, RNGState state) { if (dist.major_axis == MajorAxis::Undefined) { - // implies dist.family = DenseDistName::BlackBox + // implies dist.family = ScalarDist::BlackBox return state; } // ^ This is the only place where MajorAxis is actually used to some @@ -190,9 +190,10 @@ RNGState compute_next_state(DD dist, RNGState state) { return state; } -template -inline double isometry_scale(DDN dn, int64_t n_rows, int64_t n_cols) { - return (dn == DDN::BlackBox) ? 1.0 : std::pow(std::min(n_rows, n_cols), -0.5); +// We only template this function because ScalarDistribution has defined later. +template +inline double isometry_scale(ScalarDistribution sd, int64_t n_rows, int64_t n_cols) { + return (sd == ScalarDistribution::BlackBox) ? 1.0 : std::pow(std::min(n_rows, n_cols), -0.5); } inline blas::Layout natural_layout(MajorAxis major_axis, int64_t n_rows, int64_t n_cols) { @@ -222,7 +223,7 @@ namespace RandBLAS { /// For implementation reasons, we also expose an option to indicate that an /// operator's distribution is unknown but it is still represented by a buffer /// that can be used in GEMM. -enum class DenseDistName : char { +enum class ScalarDist : char { // --------------------------------------------------------------------------- /// Indicates the Gaussian distribution with mean 0 and variance 1. Gaussian = 'G', @@ -266,7 +267,7 @@ struct DenseDist { // --------------------------------------------------------------------------- /// The distribution used for the entries of the sketching operator. - const DenseDistName family; + const ScalarDist family; // --------------------------------------------------------------------------- /// The natural memory layout implied by major_axis, n_rows, and n_cols. @@ -278,19 +279,19 @@ struct DenseDist { /// A distribution over matrices of shape (n_rows, n_cols) with entries drawn /// iid from a mean-zero variance-one distribution. /// The default distribution is standard-normal. One can opt for the uniform - /// distribution over \math{[-\sqrt{3}, \sqrt{3}]} by setting dn = DenseDistName::Uniform. + /// distribution over \math{[-\sqrt{3}, \sqrt{3}]} by setting family = ScalarDist::Uniform. DenseDist( int64_t n_rows, int64_t n_cols, - DenseDistName dn = DenseDistName::Gaussian, + ScalarDist family = ScalarDist::Gaussian, MajorAxis ma = MajorAxis::Long ) : // variable definitions n_rows(n_rows), n_cols(n_cols), major_axis(ma), - isometry_scale(dense::isometry_scale(dn, n_rows, n_cols)), - family(dn), + isometry_scale(dense::isometry_scale(family, n_rows, n_cols)), + family(family), natural_layout(dense::natural_layout(ma, n_rows, n_cols)) { // argument validation - if (dn == DenseDistName::BlackBox) { + if (family == ScalarDist::BlackBox) { randblas_require(ma == MajorAxis::Undefined); } else { randblas_require(ma != MajorAxis::Undefined); @@ -417,7 +418,7 @@ struct DenseSkOp { { // sanity checks randblas_require(this->dist.n_rows > 0); randblas_require(this->dist.n_cols > 0); - randblas_require(this->dist.family != DenseDistName::BlackBox); + randblas_require(this->dist.family != ScalarDist::BlackBox); } ///--------------------------------------------------------------------------- @@ -536,16 +537,16 @@ RNGState fill_dense(blas::Layout layout, const DenseDist &D, int64_t n_rows } RNGState next_state{}; switch (D.family) { - case DenseDistName::Gaussian: { + case ScalarDist::Gaussian: { next_state = fill_dense_submat_impl(ma_len, buff, n_rows_, n_cols_, ptr, seed); break; } - case DenseDistName::Uniform: { + case ScalarDist::Uniform: { next_state = fill_dense_submat_impl(ma_len, buff, n_rows_, n_cols_, ptr, seed); blas::scal(n_rows_ * n_cols_, (T)std::sqrt(3), buff, 1); break; } - case DenseDistName::BlackBox: { + case ScalarDist::BlackBox: { throw std::invalid_argument(std::string("fill_dense cannot be called with the BlackBox distribution.")); } default: { @@ -603,7 +604,7 @@ void fill_dense(DenseSkOp &S) { randblas_require(S.buff == nullptr); // TODO: articulate why S.own_memory == true is important. (It's because it safeguards // against the chance of introducing a memory leak.) - randblas_require(S.dist.family != DenseDistName::BlackBox); + randblas_require(S.dist.family != ScalarDist::BlackBox); using T = typename DenseSkOp::scalar_t; S.buff = new T[S.dist.n_rows * S.dist.n_cols]; fill_dense(S.dist, S.buff, S.seed_state); @@ -618,7 +619,7 @@ DenseSkOp submatrix_as_blackbox(const DenseSkOp &S, int64_t n_rows, int64_t n_co T *buff = new T[n_rows * n_cols]; auto layout = S.dist.natural_layout; fill_dense(layout, S.dist, n_rows, n_cols, ro_s, co_s, buff, S.seed_state); - DenseDist submatrix_dist(n_rows, n_cols, DenseDistName::BlackBox, MajorAxis::Undefined); + DenseDist submatrix_dist(n_rows, n_cols, ScalarDist::BlackBox, MajorAxis::Undefined); DenseSkOp submatrix(submatrix_dist, S.seed_state, S.next_state, buff, layout); return submatrix; } diff --git a/examples/sparse-low-rank-approx/qrcp_matrixmarket.cc b/examples/sparse-low-rank-approx/qrcp_matrixmarket.cc index 252a348f..e1778dcd 100644 --- a/examples/sparse-low-rank-approx/qrcp_matrixmarket.cc +++ b/examples/sparse-low-rank-approx/qrcp_matrixmarket.cc @@ -261,11 +261,11 @@ void power_iter_col_sketch(SpMat &A, int64_t k, T* Y, int64_t p_data_aware, STAT int64_t p_done = 0; if (p_data_aware % 2 == 0) { - RandBLAS::DenseDist D(k, m, RandBLAS::DenseDistName::Gaussian); + RandBLAS::DenseDist D(k, m, RandBLAS::ScalarDist::Gaussian); TIMED_LINE( RandBLAS::fill_dense(D, mat_work2, state), "sampling : ") } else { - RandBLAS::DenseDist D(k, n, RandBLAS::DenseDistName::Gaussian); + RandBLAS::DenseDist D(k, n, RandBLAS::ScalarDist::Gaussian); TIMED_LINE( RandBLAS::fill_dense(D, mat_work1, state), "sampling : ") TIMED_LINE( diff --git a/examples/sparse-low-rank-approx/svd_rank1_plus_noise.cc b/examples/sparse-low-rank-approx/svd_rank1_plus_noise.cc index 4bbf7580..ba9d655e 100644 --- a/examples/sparse-low-rank-approx/svd_rank1_plus_noise.cc +++ b/examples/sparse-low-rank-approx/svd_rank1_plus_noise.cc @@ -73,11 +73,11 @@ void iid_sparsify_random_dense( int64_t n_rows, int64_t n_cols, int64_t stride_row, int64_t stride_col, T* mat, T prob_of_zero, RandBLAS::RNGState state ) { auto spar = new T[n_rows * n_cols]; - auto dist = RandBLAS::DenseDist(n_rows, n_cols, RandBLAS::DenseDistName::Uniform); + auto dist = RandBLAS::DenseDist(n_rows, n_cols, RandBLAS::ScalarDist::Uniform); auto next_state = RandBLAS::fill_dense(dist, spar, state); auto temp = new T[n_rows * n_cols]; - auto D_mat = RandBLAS::DenseDist(n_rows, n_cols, RandBLAS::DenseDistName::Uniform); + auto D_mat = RandBLAS::DenseDist(n_rows, n_cols, RandBLAS::ScalarDist::Uniform); RandBLAS::fill_dense(D_mat, temp, next_state); #define SPAR(_i, _j) spar[(_i) + (_j) * n_rows] diff --git a/rtd/source/api_reference/skops_and_dists.rst b/rtd/source/api_reference/skops_and_dists.rst index 5a1069a8..91824266 100644 --- a/rtd/source/api_reference/skops_and_dists.rst +++ b/rtd/source/api_reference/skops_and_dists.rst @@ -79,7 +79,7 @@ Distributions :project: RandBLAS :members: - .. doxygenenum:: RandBLAS::DenseDistName + .. doxygenenum:: RandBLAS::ScalarDist :project: RandBLAS .. dropdown:: SparseDist : a distribution over structured sparse matrices diff --git a/test/test_basic_rng/benchmark_speed.cc b/test/test_basic_rng/benchmark_speed.cc index 1cd66e32..5f08396d 100644 --- a/test/test_basic_rng/benchmark_speed.cc +++ b/test/test_basic_rng/benchmark_speed.cc @@ -80,7 +80,7 @@ int main(int argc, char **argv) int64_t m = atoi(argv[1]); int64_t n = atoi(argv[2]); int64_t d = m*n; - RandBLAS::DenseDist dist{m, n, RandBLAS::DenseDistName::Uniform}; + RandBLAS::DenseDist dist{m, n, RandBLAS::ScalarDist::Uniform}; std::vector mat(d); diff --git a/test/test_basic_rng/test_continuous.cc b/test/test_basic_rng/test_continuous.cc index 03b5d87d..c9a26f17 100644 --- a/test/test_basic_rng/test_continuous.cc +++ b/test/test_basic_rng/test_continuous.cc @@ -32,7 +32,7 @@ #include "RandBLAS/util.hh" #include "RandBLAS/dense_skops.hh" using RandBLAS::RNGState; -using RandBLAS::DenseDistName; +using RandBLAS::ScalarDist; #include "rng_common.hh" #include @@ -54,12 +54,12 @@ class TestScalarDistributions : public ::testing::Test { template static void kolmogorov_smirnov_tester( - std::vector &samples, double critical_value, DenseDistName dn + std::vector &samples, double critical_value, ScalarDist sd ) { - auto F_true = [dn](T x) { - if (dn == DenseDistName::Gaussian) { + auto F_true = [sd](T x) { + if (sd == ScalarDist::Gaussian) { return RandBLAS_StatTests::standard_normal_cdf(x); - } else if (dn == DenseDistName::Uniform) { + } else if (sd == ScalarDist::Uniform) { return RandBLAS_StatTests::uniform_syminterval_cdf(x, (T) std::sqrt(3)); } else { std::string msg = "Unrecognized distributions name"; @@ -108,13 +108,13 @@ class TestScalarDistributions : public ::testing::Test { } template - static void run(double significance, int64_t num_samples, DenseDistName dn, uint32_t seed) { + static void run(double significance, int64_t num_samples, ScalarDist sd, uint32_t seed) { using RandBLAS_StatTests::KolmogorovSmirnovConstants::critical_value_rep_mutator; auto critical_value = critical_value_rep_mutator(num_samples, significance); RNGState state(seed); std::vector samples(num_samples, -1); - RandBLAS::fill_dense({num_samples, 1, dn, RandBLAS::MajorAxis::Long}, samples.data(), state); - kolmogorov_smirnov_tester(samples, critical_value, dn); + RandBLAS::fill_dense({num_samples, 1, sd, RandBLAS::MajorAxis::Long}, samples.data(), state); + kolmogorov_smirnov_tester(samples, critical_value, sd); return; } }; @@ -122,45 +122,45 @@ class TestScalarDistributions : public ::testing::Test { TEST_F(TestScalarDistributions, uniform_ks_generous) { double s = 1e-6; for (uint32_t i = 999; i < 1011; ++i) { - run(s, 100000, DenseDistName::Uniform, i); - run(s, 10000, DenseDistName::Uniform, i*i); - run(s, 1000, DenseDistName::Uniform, i*i*i); + run(s, 100000, ScalarDist::Uniform, i); + run(s, 10000, ScalarDist::Uniform, i*i); + run(s, 1000, ScalarDist::Uniform, i*i*i); } } TEST_F(TestScalarDistributions, uniform_ks_moderate) { double s = 1e-4; - run(s, 100000, DenseDistName::Uniform, 0); - run(s, 10000, DenseDistName::Uniform, 0); - run(s, 1000, DenseDistName::Uniform, 0); + run(s, 100000, ScalarDist::Uniform, 0); + run(s, 10000, ScalarDist::Uniform, 0); + run(s, 1000, ScalarDist::Uniform, 0); } TEST_F(TestScalarDistributions, uniform_ks_skeptical) { double s = 1e-2; - run(s, 100000, DenseDistName::Uniform, 0); - run(s, 10000, DenseDistName::Uniform, 0); - run(s, 1000, DenseDistName::Uniform, 0); + run(s, 100000, ScalarDist::Uniform, 0); + run(s, 10000, ScalarDist::Uniform, 0); + run(s, 1000, ScalarDist::Uniform, 0); } TEST_F(TestScalarDistributions, guassian_ks_generous) { double s = 1e-6; for (uint32_t i = 99; i < 103; ++i) { - run(s, 100000, DenseDistName::Gaussian, i); - run(s, 10000, DenseDistName::Gaussian, i*i); - run(s, 1000, DenseDistName::Gaussian, i*i*i); + run(s, 100000, ScalarDist::Gaussian, i); + run(s, 10000, ScalarDist::Gaussian, i*i); + run(s, 1000, ScalarDist::Gaussian, i*i*i); } } TEST_F(TestScalarDistributions, guassian_ks_moderate) { double s = 1e-4; - run(s, 100000, DenseDistName::Gaussian, 0); - run(s, 10000, DenseDistName::Gaussian, 0); - run(s, 1000, DenseDistName::Gaussian, 0); + run(s, 100000, ScalarDist::Gaussian, 0); + run(s, 10000, ScalarDist::Gaussian, 0); + run(s, 1000, ScalarDist::Gaussian, 0); } TEST_F(TestScalarDistributions, guassian_ks_skeptical) { double s = 1e-2; - run(s, 100000, DenseDistName::Gaussian, 0); - run(s, 10000, DenseDistName::Gaussian, 0); - run(s, 1000, DenseDistName::Gaussian, 0); + run(s, 100000, ScalarDist::Gaussian, 0); + run(s, 10000, ScalarDist::Gaussian, 0); + run(s, 1000, ScalarDist::Gaussian, 0); } diff --git a/test/test_basic_rng/test_distortion.cc b/test/test_basic_rng/test_distortion.cc index 7516a807..a2ad0ec7 100644 --- a/test/test_basic_rng/test_distortion.cc +++ b/test/test_basic_rng/test_distortion.cc @@ -32,7 +32,7 @@ #include "RandBLAS/util.hh" #include "RandBLAS/dense_skops.hh" using RandBLAS::DenseDist; -using RandBLAS::DenseDistName; +using RandBLAS::ScalarDist; using RandBLAS::RNGState; #include "rng_common.hh" @@ -47,14 +47,14 @@ class TestSubspaceDistortion : public ::testing::Test { protected: template - void run_general(DenseDistName name, T distortion, int64_t d, int64_t N, uint32_t key) { + void run_general(ScalarDist name, T distortion, int64_t d, int64_t N, uint32_t key) { auto layout = blas::Layout::ColMajor; DenseDist D(d, N, name); std::vector S(d*N); std::cout << "(d, N) = ( " << d << ", " << N << " )\n"; RandBLAS::RNGState state(key); auto next_state = RandBLAS::fill_dense(D, S.data(), state); - T inv_stddev = (name == DenseDistName::Gaussian) ? (T) 1.0 : (T) 1.0; + T inv_stddev = (name == ScalarDist::Gaussian) ? (T) 1.0 : (T) 1.0; blas::scal(d*N, inv_stddev / std::sqrt(d), S.data(), 1); std::vector G(N*N, 0.0); blas::syrk(layout, blas::Uplo::Upper, blas::Op::Trans, N, d, (T)1.0, S.data(), d, (T)0.0, G.data(), N); @@ -100,7 +100,7 @@ class TestSubspaceDistortion : public ::testing::Test { val *= val; int64_t N = (int64_t) std::ceil(val); int64_t d = std::ceil( std::pow((1 + tau) / distortion, 2) * N ); - run_general(DenseDistName::Gaussian, distortion, d, N, key); + run_general(ScalarDist::Gaussian, distortion, d, N, key); return; } @@ -111,7 +111,7 @@ class TestSubspaceDistortion : public ::testing::Test { T epsnet_spectralnorm_factor = 1.0; // should be 4.0 T theta = epsnet_spectralnorm_factor * c6 * (rate + std::log(9)); int64_t d = std::ceil(N * theta * std::pow(distortion, -2)); - run_general(DenseDistName::Uniform, distortion, d, N, key); + run_general(ScalarDist::Uniform, distortion, d, N, key); return; } }; diff --git a/test/test_datastructures/test_denseskop.cc b/test/test_datastructures/test_denseskop.cc index 884243be..a23a050a 100644 --- a/test/test_datastructures/test_denseskop.cc +++ b/test/test_datastructures/test_denseskop.cc @@ -106,7 +106,7 @@ class TestDenseMoments : public ::testing::Test { uint32_t key, int64_t n_rows, int64_t n_cols, - RandBLAS::DenseDistName dn, + RandBLAS::ScalarDist sd, T expect_stddev ) { // Allocate workspace @@ -114,7 +114,7 @@ class TestDenseMoments : public ::testing::Test { std::vector A(size, 0.0); // Construct the sketching operator - RandBLAS::DenseDist D(n_rows, n_cols, dn); + RandBLAS::DenseDist D(n_rows, n_cols, sd); auto state = RandBLAS::RNGState(key); auto next_state = RandBLAS::fill_dense(D, A.data(), state); @@ -136,25 +136,25 @@ class TestDenseMoments : public ::testing::Test { // For small matrix sizes, mean and stddev are not very close to desired vals. TEST_F(TestDenseMoments, Gaussian) { - auto dn = RandBLAS::DenseDistName::Gaussian; + auto sd = RandBLAS::ScalarDist::Gaussian; for (uint32_t key : {0, 1, 2}) { - test_mean_stddev(key, 500, 500, dn, 1.0); - test_mean_stddev(key, 203, 203, dn, 1.0); - test_mean_stddev(key, 203, 503, dn, 1.0); + test_mean_stddev(key, 500, 500, sd, 1.0); + test_mean_stddev(key, 203, 203, sd, 1.0); + test_mean_stddev(key, 203, 503, sd, 1.0); } } // For small matrix sizes, mean and stddev are not very close to desired vals. TEST_F(TestDenseMoments, Uniform) { - auto dn = RandBLAS::DenseDistName::Uniform; + auto sd = RandBLAS::ScalarDist::Uniform; double expect_stddev = 1.0; for (uint32_t key : {0, 1, 2}) { - test_mean_stddev(key, 500, 500, dn, (float) expect_stddev); - test_mean_stddev(key, 203, 203, dn, expect_stddev); - test_mean_stddev(key, 203, 503, dn, expect_stddev); + test_mean_stddev(key, 500, 500, sd, (float) expect_stddev); + test_mean_stddev(key, 203, 203, sd, expect_stddev); + test_mean_stddev(key, 203, 503, sd, expect_stddev); } } @@ -344,19 +344,19 @@ TEST(TestDenseThreading, GaussianPhilox) { class TestFillAxis : public::testing::Test { protected: - static inline auto distname = RandBLAS::DenseDistName::Uniform; + static inline auto distname = RandBLAS::ScalarDist::Uniform; template static void auto_transpose(int64_t short_dim, int64_t long_dim, RandBLAS::MajorAxis ma) { uint32_t seed = 99; // make the wide sketching operator - RandBLAS::DenseDist D_wide {short_dim, long_dim, distname, ma}; + RandBLAS::DenseDist D_wide(short_dim, long_dim, distname, ma); RandBLAS::DenseSkOp S_wide(D_wide, seed); RandBLAS::fill_dense(S_wide); // make the tall sketching operator - RandBLAS::DenseDist D_tall {long_dim, short_dim, distname, ma}; + RandBLAS::DenseDist D_tall(long_dim, short_dim, distname, ma); RandBLAS::DenseSkOp S_tall(D_tall, seed); RandBLAS::fill_dense(S_tall); @@ -411,12 +411,12 @@ class TestDenseSkOpStates : public ::testing::Test uint32_t key, int64_t n_rows, int64_t n_cols, - RandBLAS::DenseDistName dn + RandBLAS::ScalarDist sd ) { randblas_require(n_rows > n_cols); - RandBLAS::DenseDist D1( n_rows, n_cols/2, dn, RandBLAS::MajorAxis::Long); - RandBLAS::DenseDist D2( n_rows, n_cols - n_cols/2, dn, RandBLAS::MajorAxis::Long); - RandBLAS::DenseDist Dfull( n_rows, n_cols, dn, RandBLAS::MajorAxis::Long); + RandBLAS::DenseDist D1( n_rows, n_cols/2, sd, RandBLAS::MajorAxis::Long); + RandBLAS::DenseDist D2( n_rows, n_cols - n_cols/2, sd, RandBLAS::MajorAxis::Long); + RandBLAS::DenseDist Dfull( n_rows, n_cols, sd, RandBLAS::MajorAxis::Long); RandBLAS::RNGState state(key); int64_t size = n_rows * n_cols; @@ -444,12 +444,12 @@ class TestDenseSkOpStates : public ::testing::Test uint32_t key, int64_t n_rows, int64_t n_cols, - RandBLAS::DenseDistName dn + RandBLAS::ScalarDist sd ) { float *buff = new float[n_rows*n_cols]; RandBLAS::RNGState state(key); - RandBLAS::DenseDist D(n_rows, n_cols, dn); + RandBLAS::DenseDist D(n_rows, n_cols, sd); auto actual_final_state = RandBLAS::fill_dense(D, buff, state); auto actual_c = actual_final_state.counter; @@ -468,22 +468,22 @@ class TestDenseSkOpStates : public ::testing::Test TEST_F(TestDenseSkOpStates, concat_tall_with_long_major_axis) { for (uint32_t key : {0, 1, 2}) { - auto dn = RandBLAS::DenseDistName::Gaussian; - test_concatenate_along_columns(key, 13, 7, dn); - test_concatenate_along_columns(key, 80, 40, dn); - test_concatenate_along_columns(key, 83, 41, dn); - test_concatenate_along_columns(key, 91, 43, dn); - test_concatenate_along_columns(key, 97, 47, dn); + auto sd = RandBLAS::ScalarDist::Gaussian; + test_concatenate_along_columns(key, 13, 7, sd); + test_concatenate_along_columns(key, 80, 40, sd); + test_concatenate_along_columns(key, 83, 41, sd); + test_concatenate_along_columns(key, 91, 43, sd); + test_concatenate_along_columns(key, 97, 47, sd); } } TEST_F(TestDenseSkOpStates, compare_skopless_fill_dense_to_compute_next_state) { for (uint32_t key : {0, 1, 2}) { - auto dn = RandBLAS::DenseDistName::Gaussian; - test_compute_next_state(key, 13, 7, dn); - test_compute_next_state(key, 11, 5, dn); - test_compute_next_state(key, 131, 71, dn); - test_compute_next_state(key, 80, 40, dn); - test_compute_next_state(key, 91, 43, dn); + auto sd = RandBLAS::ScalarDist::Gaussian; + test_compute_next_state(key, 13, 7, sd); + test_compute_next_state(key, 11, 5, sd); + test_compute_next_state(key, 131, 71, sd); + test_compute_next_state(key, 80, 40, sd); + test_compute_next_state(key, 91, 43, sd); } } diff --git a/test/test_datastructures/test_spmats/common.hh b/test/test_datastructures/test_spmats/common.hh index c262822e..c41b8735 100644 --- a/test/test_datastructures/test_spmats/common.hh +++ b/test/test_datastructures/test_spmats/common.hh @@ -56,11 +56,11 @@ void iid_sparsify_random_dense( RandBLAS::RNGState state ) { auto spar = new T[n_rows * n_cols]; - auto dist = RandBLAS::DenseDist(n_rows, n_cols, RandBLAS::DenseDistName::Uniform); + auto dist = RandBLAS::DenseDist(n_rows, n_cols, RandBLAS::ScalarDist::Uniform); auto next_state = RandBLAS::fill_dense(dist, spar, state); auto temp = new T[n_rows * n_cols]; - auto D_mat = RandBLAS::DenseDist(n_rows, n_cols, RandBLAS::DenseDistName::Uniform); + auto D_mat = RandBLAS::DenseDist(n_rows, n_cols, RandBLAS::ScalarDist::Uniform); RandBLAS::fill_dense(D_mat, temp, next_state); // We'll pretend both of those matrices are column-major, regardless of the layout diff --git a/test/test_handrolled_lapack.cc b/test/test_handrolled_lapack.cc index 3a97d767..b0c1c683 100644 --- a/test/test_handrolled_lapack.cc +++ b/test/test_handrolled_lapack.cc @@ -12,7 +12,7 @@ #include "RandBLAS/util.hh" #include "RandBLAS/dense_skops.hh" using RandBLAS::DenseDist; -using RandBLAS::DenseDistName; +using RandBLAS::ScalarDist; using RandBLAS::RNGState; #include @@ -175,7 +175,7 @@ class TestHandrolledQR : public ::testing::Test { template void run_cholqr_gaussian(int m, int n, int b, uint32_t key) { - DenseDist D(m, n, DenseDistName::Gaussian); + DenseDist D(m, n, ScalarDist::Gaussian); std::vector A(m*n); T iso_scale = D.isometry_scale; RNGState state(key); @@ -191,7 +191,7 @@ class TestHandrolledQR : public ::testing::Test { template void run_qr_blocked_cgs(int m, int n, int b, uint32_t key) { - DenseDist D(m, n, DenseDistName::Gaussian); + DenseDist D(m, n, ScalarDist::Gaussian); std::vector A(m*n); T iso_scale = D.isometry_scale; RNGState state(key); @@ -251,7 +251,7 @@ std::vector posdef_with_random_eigvecs(std::vector &eigvals, uint32_t key) randblas_require(ev > 0); std::vector work0(n*n, 0.0); T* work0_buff = work0.data(); - DenseDist distn(n, n, DenseDistName::Gaussian); + DenseDist distn(n, n, ScalarDist::Gaussian); RNGState state(key); RandBLAS::fill_dense(distn, work0_buff, state); std::vector work1(n*n, 0.0); diff --git a/test/test_matmul_wrappers/test_sketch_symmetric.cc b/test/test_matmul_wrappers/test_sketch_symmetric.cc index 26861f81..5da21e0c 100644 --- a/test/test_matmul_wrappers/test_sketch_symmetric.cc +++ b/test/test_matmul_wrappers/test_sketch_symmetric.cc @@ -36,7 +36,7 @@ using blas::Layout; using blas::Uplo; -using RandBLAS::DenseDistName; +using RandBLAS::ScalarDist; using RandBLAS::DenseDist; using RandBLAS::DenseSkOp; using RandBLAS::RNGState; @@ -93,7 +93,7 @@ class TestSketchSymmetric : public ::testing::Test { auto [rows_out, cols_out] = dims_of_sketch_symmetric_output(d, n, side_skop); std::vector A(lda*lda, 0.0); random_symmetric_mat(n, A.data(), lda, RNGState(seed_a)); - DenseDist D(rows_out, cols_out, DenseDistName::Uniform, ma); + DenseDist D(rows_out, cols_out, ScalarDist::Uniform, ma); DenseSkOp S(D, seed_skop); RandBLAS::fill_dense(S); int64_t lds = (S.layout == Layout::RowMajor) ? cols_out : rows_out; @@ -122,7 +122,7 @@ class TestSketchSymmetric : public ::testing::Test { auto [rows_out, cols_out] = dims_of_sketch_symmetric_output(d, n, side_skop); std::vector A(lda*lda, 0.0); random_symmetric_mat(n, A.data(), lda, RNGState(seed_a)); - DenseDist D(rows_out, cols_out, DenseDistName::Uniform, ma); + DenseDist D(rows_out, cols_out, ScalarDist::Uniform, ma); DenseSkOp S(D, seed_skop); RandBLAS::fill_dense(S); int64_t lds_init, ldb;