From e65a57ac6192e9d3c2862e698ccaa03f914d1afe Mon Sep 17 00:00:00 2001 From: "Yu-Hsiang M. Tsai" Date: Thu, 24 Oct 2024 15:39:41 +0200 Subject: [PATCH] matrix test with half --- reference/test/matrix/coo_kernels.cpp | 40 ++++++++-------- reference/test/matrix/csr_kernels.cpp | 44 +++++++++--------- reference/test/matrix/dense_kernels.cpp | 17 +++---- reference/test/matrix/diagonal_kernels.cpp | 14 +++--- reference/test/matrix/ell_kernels.cpp | 46 ++++++++++--------- reference/test/matrix/hybrid_kernels.cpp | 20 ++++---- reference/test/matrix/identity.cpp | 6 ++- reference/test/matrix/sellp_kernels.cpp | 19 ++++---- .../test/matrix/sparsity_csr_kernels.cpp | 12 ++--- 9 files changed, 116 insertions(+), 102 deletions(-) diff --git a/reference/test/matrix/coo_kernels.cpp b/reference/test/matrix/coo_kernels.cpp index 922c107aa0f..a7bc1a036b4 100644 --- a/reference/test/matrix/coo_kernels.cpp +++ b/reference/test/matrix/coo_kernels.cpp @@ -32,7 +32,8 @@ class Coo : public ::testing::Test { using Csr = gko::matrix::Csr; using Mtx = gko::matrix::Coo; using Vec = gko::matrix::Dense; - using MixedVec = gko::matrix::Dense>; + using MixedVec = + gko::matrix::Dense>; Coo() : exec(gko::ReferenceExecutor::create()), mtx(Mtx::create(exec)) { @@ -72,24 +73,24 @@ class Coo : public ::testing::Test { std::unique_ptr uns_mtx; }; -TYPED_TEST_SUITE(Coo, gko::test::ValueIndexTypes, PairTypenameNameGenerator); +TYPED_TEST_SUITE(Coo, gko::test::ValueIndexTypesWithHalf, + PairTypenameNameGenerator); TYPED_TEST(Coo, ConvertsToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Coo = typename TestFixture::Mtx; using OtherCoo = gko::matrix::Coo; auto tmp = OtherCoo::create(this->exec); auto res = Coo::create(this->exec); // If OtherType is more precise: 0, otherwise r - auto residual = r::value < r::value - ? gko::remove_complex{0} - : gko::remove_complex{ - static_cast>( - r::value)}; + auto residual = + r::value < r::value + ? gko::remove_complex{0} + : static_cast>(r::value); this->mtx->convert_to(tmp); tmp->convert_to(res); @@ -102,17 +103,16 @@ TYPED_TEST(Coo, MovesToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Coo = typename TestFixture::Mtx; using OtherCoo = gko::matrix::Coo; auto tmp = OtherCoo::create(this->exec); auto res = Coo::create(this->exec); // If OtherType is more precise: 0, otherwise r - auto residual = r::value < r::value - ? gko::remove_complex{0} - : gko::remove_complex{ - static_cast>( - r::value)}; + auto residual = + r::value < r::value + ? gko::remove_complex{0} + : static_cast>(r::value); this->mtx->move_to(tmp); tmp->move_to(res); @@ -218,7 +218,7 @@ TYPED_TEST(Coo, ConvertsEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Coo = typename TestFixture::Mtx; using OtherCoo = gko::matrix::Coo; auto empty = OtherCoo::create(this->exec); @@ -235,7 +235,7 @@ TYPED_TEST(Coo, MovesEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Coo = typename TestFixture::Mtx; using OtherCoo = gko::matrix::Coo; auto empty = OtherCoo::create(this->exec); @@ -706,7 +706,7 @@ TYPED_TEST(Coo, AppliesToComplex) TYPED_TEST(Coo, AppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using Vec = gko::matrix::Dense; auto exec = gko::ReferenceExecutor::create(); @@ -762,7 +762,7 @@ TYPED_TEST(Coo, AdvancedAppliesToComplex) TYPED_TEST(Coo, AdvancedAppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using MixedDense = gko::matrix::Dense; using MixedDenseComplex = gko::matrix::Dense; @@ -820,7 +820,7 @@ TYPED_TEST(Coo, ApplyAddsToComplex) TYPED_TEST(Coo, ApplyAddsToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using MixedVec = gko::matrix::Dense; auto exec = gko::ReferenceExecutor::create(); @@ -877,7 +877,7 @@ TYPED_TEST(Coo, ApplyAddsScaledToComplex) TYPED_TEST(Coo, ApplyAddsScaledToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using MixedDense = gko::matrix::Dense; using MixedDenseComplex = gko::matrix::Dense; diff --git a/reference/test/matrix/csr_kernels.cpp b/reference/test/matrix/csr_kernels.cpp index f1a2f2bce4b..ab1b2ab2e81 100644 --- a/reference/test/matrix/csr_kernels.cpp +++ b/reference/test/matrix/csr_kernels.cpp @@ -46,7 +46,8 @@ class Csr : public ::testing::Test { using Ell = gko::matrix::Ell; using Hybrid = gko::matrix::Hybrid; using Vec = gko::matrix::Dense; - using MixedVec = gko::matrix::Dense>; + using MixedVec = + gko::matrix::Dense>; using Perm = gko::matrix::Permutation; using ScaledPerm = gko::matrix::ScaledPermutation; @@ -347,7 +348,8 @@ class Csr : public ::testing::Test { index_type invalid_index = gko::invalid_index(); }; -TYPED_TEST_SUITE(Csr, gko::test::ValueIndexTypes, PairTypenameNameGenerator); +TYPED_TEST_SUITE(Csr, gko::test::ValueIndexTypesWithHalf, + PairTypenameNameGenerator); TYPED_TEST(Csr, AppliesToDenseVector) @@ -368,7 +370,7 @@ TYPED_TEST(Csr, MixedAppliesToDenseVector1) { // Both vectors have the same value type which differs from the matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec = typename gko::matrix::Dense; auto x = gko::initialize({2.0, 1.0, 4.0}, this->exec); auto y = Vec::create(this->exec, gko::dim<2>{2, 1}); @@ -383,7 +385,7 @@ TYPED_TEST(Csr, MixedAppliesToDenseVector2) { // Input vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto x = gko::initialize({2.0, 1.0, 4.0}, this->exec); @@ -399,9 +401,9 @@ TYPED_TEST(Csr, MixedAppliesToDenseVector3) { // Output vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; - using Vec2 = gko::matrix::Dense>; + using Vec2 = gko::matrix::Dense>; auto x = gko::initialize({2.0, 1.0, 4.0}, this->exec); auto y = Vec1::create(this->exec, gko::dim<2>{2, 1}); @@ -432,7 +434,7 @@ TYPED_TEST(Csr, MixedAppliesToDenseMatrix1) { // Both vectors have the same value type which differs from the matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec = gko::matrix::Dense; // clang-format off auto x = gko::initialize( @@ -456,7 +458,7 @@ TYPED_TEST(Csr, MixedAppliesToDenseMatrix2) { // Input vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; // clang-format off @@ -481,7 +483,7 @@ TYPED_TEST(Csr, MixedAppliesToDenseMatrix3) { // Output vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; // clang-format off @@ -522,7 +524,7 @@ TYPED_TEST(Csr, MixedAppliesLinearCombinationToDenseVector1) { // Both vectors have the same value type which differs from the matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); auto beta = gko::initialize({2.0}, this->exec); @@ -539,7 +541,7 @@ TYPED_TEST(Csr, MixedAppliesLinearCombinationToDenseVector2) { // Input vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); @@ -557,7 +559,7 @@ TYPED_TEST(Csr, MixedAppliesLinearCombinationToDenseVector3) { // Output vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); @@ -595,7 +597,7 @@ TYPED_TEST(Csr, MixedAppliesLinearCombinationToDenseMatrix1) { // Both vectors have the same value type which differs from the matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); auto beta = gko::initialize({2.0}, this->exec); @@ -619,7 +621,7 @@ TYPED_TEST(Csr, MixedAppliesLinearCombinationToDenseMatrix2) { // Input vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); @@ -639,7 +641,7 @@ TYPED_TEST(Csr, MixedAppliesLinearCombinationToDenseMatrix3) { // Output vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); @@ -788,7 +790,7 @@ TYPED_TEST(Csr, ConvertsToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Csr = typename TestFixture::Mtx; using OtherCsr = gko::matrix::Csr; auto tmp = OtherCsr::create(this->exec); @@ -815,7 +817,7 @@ TYPED_TEST(Csr, MovesToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Csr = typename TestFixture::Mtx; using OtherCsr = gko::matrix::Csr; auto tmp = OtherCsr::create(this->exec); @@ -994,7 +996,7 @@ TYPED_TEST(Csr, ConvertsEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Csr = typename TestFixture::Mtx; using OtherCsr = gko::matrix::Csr; auto empty = OtherCsr::create(this->exec); @@ -1013,7 +1015,7 @@ TYPED_TEST(Csr, MovesEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Csr = typename TestFixture::Mtx; using OtherCsr = gko::matrix::Csr; auto empty = OtherCsr::create(this->exec); @@ -2050,7 +2052,7 @@ TYPED_TEST(Csr, AppliesToComplex) TYPED_TEST(Csr, AppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using Vec = gko::matrix::Dense; auto exec = gko::ReferenceExecutor::create(); @@ -2106,7 +2108,7 @@ TYPED_TEST(Csr, AdvancedAppliesToComplex) TYPED_TEST(Csr, AdvancedAppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using MixedDense = gko::matrix::Dense; using MixedDenseComplex = gko::matrix::Dense; diff --git a/reference/test/matrix/dense_kernels.cpp b/reference/test/matrix/dense_kernels.cpp index a8d37ce5a09..5951f7cca7d 100644 --- a/reference/test/matrix/dense_kernels.cpp +++ b/reference/test/matrix/dense_kernels.cpp @@ -37,7 +37,8 @@ class Dense : public ::testing::Test { protected: using value_type = T; using Mtx = gko::matrix::Dense; - using MixedMtx = gko::matrix::Dense>; + using MixedMtx = + gko::matrix::Dense>; using ComplexMtx = gko::to_complex; using RealMtx = gko::remove_complex; Dense() @@ -80,7 +81,7 @@ class Dense : public ::testing::Test { }; -TYPED_TEST_SUITE(Dense, gko::test::ValueTypes, TypenameNameGenerator); +TYPED_TEST_SUITE(Dense, gko::test::ValueTypesWithHalf, TypenameNameGenerator); TYPED_TEST(Dense, CopyRespectsStride) @@ -745,7 +746,7 @@ TYPED_TEST(Dense, ConvertsToPrecision) { using Dense = typename TestFixture::Mtx; using T = typename TestFixture::value_type; - using OtherT = typename gko::next_precision; + using OtherT = typename gko::next_precision_with_half; using OtherDense = typename gko::matrix::Dense; auto tmp = OtherDense::create(this->exec); auto res = Dense::create(this->exec); @@ -767,7 +768,7 @@ TYPED_TEST(Dense, MovesToPrecision) { using Dense = typename TestFixture::Mtx; using T = typename TestFixture::value_type; - using OtherT = typename gko::next_precision; + using OtherT = typename gko::next_precision_with_half; using OtherDense = typename gko::matrix::Dense; auto tmp = OtherDense::create(this->exec); auto res = Dense::create(this->exec); @@ -1066,7 +1067,7 @@ TYPED_TEST(Dense, AppliesToComplex) TYPED_TEST(Dense, AppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using Vec = gko::matrix::Dense; auto exec = gko::ReferenceExecutor::create(); @@ -1120,7 +1121,7 @@ TYPED_TEST(Dense, AdvancedAppliesToComplex) TYPED_TEST(Dense, AdvancedAppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using MixedDense = gko::matrix::Dense; using MixedDenseComplex = gko::matrix::Dense; @@ -2013,7 +2014,7 @@ TYPED_TEST(Dense, ConvertsEmptyToPrecision) { using Dense = typename TestFixture::Mtx; using T = typename TestFixture::value_type; - using OtherT = typename gko::next_precision; + using OtherT = typename gko::next_precision_with_half; using OtherDense = typename gko::matrix::Dense; auto empty = OtherDense::create(this->exec); auto res = Dense::create(this->exec); @@ -2028,7 +2029,7 @@ TYPED_TEST(Dense, MovesEmptyToPrecision) { using Dense = typename TestFixture::Mtx; using T = typename TestFixture::value_type; - using OtherT = typename gko::next_precision; + using OtherT = typename gko::next_precision_with_half; using OtherDense = typename gko::matrix::Dense; auto empty = OtherDense::create(this->exec); auto res = Dense::create(this->exec); diff --git a/reference/test/matrix/diagonal_kernels.cpp b/reference/test/matrix/diagonal_kernels.cpp index 4ff6a86db97..a792ff5d1fa 100644 --- a/reference/test/matrix/diagonal_kernels.cpp +++ b/reference/test/matrix/diagonal_kernels.cpp @@ -30,7 +30,8 @@ class Diagonal : public ::testing::Test { using Csr = gko::matrix::Csr; using Diag = gko::matrix::Diagonal; using Dense = gko::matrix::Dense; - using MixedDense = gko::matrix::Dense>; + using MixedDense = + gko::matrix::Dense>; Diagonal() : exec(gko::ReferenceExecutor::create()), @@ -79,13 +80,14 @@ class Diagonal : public ::testing::Test { std::unique_ptr dense3; }; -TYPED_TEST_SUITE(Diagonal, gko::test::ValueTypes, TypenameNameGenerator); +TYPED_TEST_SUITE(Diagonal, gko::test::ValueTypesWithHalf, + TypenameNameGenerator); TYPED_TEST(Diagonal, ConvertsToPrecision) { using ValueType = typename TestFixture::value_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Diagonal = typename TestFixture::Diag; using OtherDiagonal = gko::matrix::Diagonal; auto tmp = OtherDiagonal::create(this->exec); @@ -107,7 +109,7 @@ TYPED_TEST(Diagonal, ConvertsToPrecision) TYPED_TEST(Diagonal, MovesToPrecision) { using ValueType = typename TestFixture::value_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Diagonal = typename TestFixture::Diag; using OtherDiagonal = gko::matrix::Diagonal; auto tmp = OtherDiagonal::create(this->exec); @@ -575,7 +577,7 @@ TYPED_TEST(Diagonal, AppliesToComplex) TYPED_TEST(Diagonal, AppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using Vec = gko::matrix::Dense; auto exec = gko::ReferenceExecutor::create(); @@ -635,7 +637,7 @@ TYPED_TEST(Diagonal, AppliesLinearCombinationToComplex) TYPED_TEST(Diagonal, AppliesLinearCombinationToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using Vec = gko::matrix::Dense; using Scalar = gko::matrix::Dense; diff --git a/reference/test/matrix/ell_kernels.cpp b/reference/test/matrix/ell_kernels.cpp index 23bd54d4c34..f7437d48bf9 100644 --- a/reference/test/matrix/ell_kernels.cpp +++ b/reference/test/matrix/ell_kernels.cpp @@ -30,7 +30,8 @@ class Ell : public ::testing::Test { using Mtx = gko::matrix::Ell; using Csr = gko::matrix::Csr; using Vec = gko::matrix::Dense; - using MixedVec = gko::matrix::Dense>; + using MixedVec = + gko::matrix::Dense>; Ell() : exec(gko::ReferenceExecutor::create()), @@ -72,7 +73,8 @@ class Ell : public ::testing::Test { std::unique_ptr mtx2; }; -TYPED_TEST_SUITE(Ell, gko::test::ValueIndexTypes, PairTypenameNameGenerator); +TYPED_TEST_SUITE(Ell, gko::test::ValueIndexTypesWithHalf, + PairTypenameNameGenerator); TYPED_TEST(Ell, AppliesToDenseVector) @@ -91,7 +93,7 @@ TYPED_TEST(Ell, MixedAppliesToDenseVector1) { // Both vectors have the same value type which differs from the matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec = typename gko::matrix::Dense; auto x = gko::initialize({2.0, 1.0, 4.0}, this->exec); auto y = Vec::create(this->exec, gko::dim<2>{2, 1}); @@ -106,7 +108,7 @@ TYPED_TEST(Ell, MixedAppliesToDenseVector2) { // Input vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto x = gko::initialize({2.0, 1.0, 4.0}, this->exec); @@ -122,9 +124,9 @@ TYPED_TEST(Ell, MixedAppliesToDenseVector3) { // Output vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; - using Vec2 = gko::matrix::Dense>; + using Vec2 = gko::matrix::Dense>; auto x = gko::initialize({2.0, 1.0, 4.0}, this->exec); auto y = Vec1::create(this->exec, gko::dim<2>{2, 1}); @@ -160,7 +162,7 @@ TYPED_TEST(Ell, MixedAppliesToDenseMatrix1) { // Both vectors have the same value type which differs from the matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec = gko::matrix::Dense; // clang-format off auto x = gko::initialize( @@ -184,7 +186,7 @@ TYPED_TEST(Ell, MixedAppliesToDenseMatrix2) { // Input vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; // clang-format off @@ -209,7 +211,7 @@ TYPED_TEST(Ell, MixedAppliesToDenseMatrix3) { // Output vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; // clang-format off @@ -248,7 +250,7 @@ TYPED_TEST(Ell, MixedAppliesLinearCombinationToDenseVector1) { // Both vectors have the same value type which differs from the matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); auto beta = gko::initialize({2.0}, this->exec); @@ -265,7 +267,7 @@ TYPED_TEST(Ell, MixedAppliesLinearCombinationToDenseVector2) { // Input vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); @@ -283,7 +285,7 @@ TYPED_TEST(Ell, MixedAppliesLinearCombinationToDenseVector3) { // Output vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); @@ -327,7 +329,7 @@ TYPED_TEST(Ell, MixedAppliesLinearCombinationToDenseMatrix1) { // Both vectors have the same value type which differs from the matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); auto beta = gko::initialize({2.0}, this->exec); @@ -355,7 +357,7 @@ TYPED_TEST(Ell, MixedAppliesLinearCombinationToDenseMatrix2) { // Input vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); @@ -384,7 +386,7 @@ TYPED_TEST(Ell, MixedAppliesLinearCombinationToDenseMatrix3) { // Output vector has same value type as matrix using T = typename TestFixture::value_type; - using next_T = gko::next_precision; + using next_T = gko::next_precision_with_half; using Vec1 = typename TestFixture::Vec; using Vec2 = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); @@ -443,7 +445,7 @@ TYPED_TEST(Ell, ConvertsToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Ell = typename TestFixture::Mtx; using OtherEll = gko::matrix::Ell; auto tmp = OtherEll::create(this->exec); @@ -466,7 +468,7 @@ TYPED_TEST(Ell, MovesToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Ell = typename TestFixture::Mtx; using OtherEll = gko::matrix::Ell; auto tmp = OtherEll::create(this->exec); @@ -736,7 +738,7 @@ TYPED_TEST(Ell, ConvertsEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Ell = typename TestFixture::Mtx; using OtherEll = gko::matrix::Ell; auto empty = Ell::create(this->exec); @@ -753,7 +755,7 @@ TYPED_TEST(Ell, MovesEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Ell = typename TestFixture::Mtx; using OtherEll = gko::matrix::Ell; auto empty = Ell::create(this->exec); @@ -898,7 +900,7 @@ TYPED_TEST(Ell, AppliesToComplex) TYPED_TEST(Ell, AppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using Vec = gko::matrix::Dense; auto exec = gko::ReferenceExecutor::create(); @@ -955,7 +957,7 @@ TYPED_TEST(Ell, AdvancedAppliesToComplex) TYPED_TEST(Ell, AdvancedAppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using MixedDense = gko::matrix::Dense; using MixedDenseComplex = gko::matrix::Dense; @@ -993,7 +995,7 @@ class EllComplex : public ::testing::Test { using Mtx = gko::matrix::Ell; }; -TYPED_TEST_SUITE(EllComplex, gko::test::ComplexValueIndexTypes, +TYPED_TEST_SUITE(EllComplex, gko::test::ComplexValueIndexTypesWithHalf, PairTypenameNameGenerator); diff --git a/reference/test/matrix/hybrid_kernels.cpp b/reference/test/matrix/hybrid_kernels.cpp index d918c902c81..f48e311130e 100644 --- a/reference/test/matrix/hybrid_kernels.cpp +++ b/reference/test/matrix/hybrid_kernels.cpp @@ -32,7 +32,8 @@ class Hybrid : public ::testing::Test { using Mtx = gko::matrix::Hybrid; using Vec = gko::matrix::Dense; using Csr = gko::matrix::Csr; - using MixedVec = gko::matrix::Dense>; + using MixedVec = + gko::matrix::Dense>; Hybrid() : exec(gko::ReferenceExecutor::create()), @@ -96,7 +97,8 @@ class Hybrid : public ::testing::Test { std::unique_ptr mtx3; }; -TYPED_TEST_SUITE(Hybrid, gko::test::ValueIndexTypes, PairTypenameNameGenerator); +TYPED_TEST_SUITE(Hybrid, gko::test::ValueIndexTypesWithHalf, + PairTypenameNameGenerator); TYPED_TEST(Hybrid, AppliesToDenseVector) @@ -233,7 +235,7 @@ TYPED_TEST(Hybrid, ConvertsToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Hybrid = typename TestFixture::Mtx; using OtherHybrid = gko::matrix::Hybrid; auto tmp = OtherHybrid::create(this->exec); @@ -256,7 +258,7 @@ TYPED_TEST(Hybrid, MovesToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Hybrid = typename TestFixture::Mtx; using OtherHybrid = gko::matrix::Hybrid; auto tmp = OtherHybrid::create(this->exec); @@ -368,7 +370,7 @@ TYPED_TEST(Hybrid, ConvertsEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Hybrid = typename TestFixture::Mtx; using OtherHybrid = gko::matrix::Hybrid; auto other = Hybrid::create(this->exec); @@ -385,7 +387,7 @@ TYPED_TEST(Hybrid, MovesEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Hybrid = typename TestFixture::Mtx; using OtherHybrid = gko::matrix::Hybrid; auto other = Hybrid::create(this->exec); @@ -700,7 +702,7 @@ TYPED_TEST(Hybrid, AppliesToComplex) TYPED_TEST(Hybrid, AppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using Vec = gko::matrix::Dense; auto exec = gko::ReferenceExecutor::create(); @@ -757,7 +759,7 @@ TYPED_TEST(Hybrid, AdvancedAppliesToComplex) TYPED_TEST(Hybrid, AdvancedAppliesToMixedComplex) { using mixed_value_type = - gko::next_precision; + gko::next_precision_with_half; using mixed_complex_type = gko::to_complex; using MixedDense = gko::matrix::Dense; using MixedDenseComplex = gko::matrix::Dense; @@ -796,7 +798,7 @@ class HybridComplex : public ::testing::Test { using Mtx = gko::matrix::Hybrid; }; -TYPED_TEST_SUITE(HybridComplex, gko::test::ComplexValueIndexTypes, +TYPED_TEST_SUITE(HybridComplex, gko::test::ComplexValueIndexTypesWithHalf, PairTypenameNameGenerator); diff --git a/reference/test/matrix/identity.cpp b/reference/test/matrix/identity.cpp index 11953de338a..82704145978 100644 --- a/reference/test/matrix/identity.cpp +++ b/reference/test/matrix/identity.cpp @@ -19,7 +19,8 @@ class Identity : public ::testing::Test { using value_type = T; using Id = gko::matrix::Identity; using Vec = gko::matrix::Dense; - using MixedVec = gko::matrix::Dense>; + using MixedVec = + gko::matrix::Dense>; using ComplexVec = gko::to_complex; using MixedComplexVec = gko::to_complex; @@ -29,7 +30,8 @@ class Identity : public ::testing::Test { }; -TYPED_TEST_SUITE(Identity, gko::test::ValueTypes, TypenameNameGenerator); +TYPED_TEST_SUITE(Identity, gko::test::ValueTypesWithHalf, + TypenameNameGenerator); TYPED_TEST(Identity, AppliesToVector) diff --git a/reference/test/matrix/sellp_kernels.cpp b/reference/test/matrix/sellp_kernels.cpp index 3208b8c42be..23251c63b8f 100644 --- a/reference/test/matrix/sellp_kernels.cpp +++ b/reference/test/matrix/sellp_kernels.cpp @@ -50,7 +50,8 @@ class Sellp : public ::testing::Test { std::unique_ptr mtx2; }; -TYPED_TEST_SUITE(Sellp, gko::test::ValueIndexTypes, PairTypenameNameGenerator); +TYPED_TEST_SUITE(Sellp, gko::test::ValueIndexTypesWithHalf, + PairTypenameNameGenerator); TYPED_TEST(Sellp, AppliesToDenseVector) @@ -67,7 +68,8 @@ TYPED_TEST(Sellp, AppliesToDenseVector) TYPED_TEST(Sellp, AppliesToMixedDenseVector) { - using value_type = gko::next_precision; + using value_type = + gko::next_precision_with_half; using Vec = gko::matrix::Dense; auto x = gko::initialize({2.0, 1.0, 4.0}, this->exec); auto y = Vec::create(this->exec, gko::dim<2>{2, 1}); @@ -116,7 +118,8 @@ TYPED_TEST(Sellp, AppliesLinearCombinationToDenseVector) TYPED_TEST(Sellp, AppliesLinearCombinationToMixedDenseVector) { - using value_type = gko::next_precision; + using value_type = + gko::next_precision_with_half; using Vec = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); auto beta = gko::initialize({2.0}, this->exec); @@ -189,7 +192,7 @@ TYPED_TEST(Sellp, ConvertsToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Sellp = typename TestFixture::Mtx; using OtherSellp = gko::matrix::Sellp; auto tmp = OtherSellp::create(this->exec); @@ -212,7 +215,7 @@ TYPED_TEST(Sellp, MovesToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Sellp = typename TestFixture::Mtx; using OtherSellp = gko::matrix::Sellp; auto tmp = OtherSellp::create(this->exec); @@ -310,7 +313,7 @@ TYPED_TEST(Sellp, ConvertsEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Sellp = typename TestFixture::Mtx; using OtherSellp = gko::matrix::Sellp; auto empty = OtherSellp::create(this->exec); @@ -329,7 +332,7 @@ TYPED_TEST(Sellp, MovesEmptyToPrecision) { using ValueType = typename TestFixture::value_type; using IndexType = typename TestFixture::index_type; - using OtherType = gko::next_precision; + using OtherType = gko::next_precision_with_half; using Sellp = typename TestFixture::Mtx; using OtherSellp = gko::matrix::Sellp; auto empty = OtherSellp::create(this->exec); @@ -751,7 +754,7 @@ class SellpComplex : public ::testing::Test { using Mtx = gko::matrix::Sellp; }; -TYPED_TEST_SUITE(SellpComplex, gko::test::ComplexValueIndexTypes, +TYPED_TEST_SUITE(SellpComplex, gko::test::ComplexValueIndexTypesWithHalf, PairTypenameNameGenerator); diff --git a/reference/test/matrix/sparsity_csr_kernels.cpp b/reference/test/matrix/sparsity_csr_kernels.cpp index f08d6c352ca..30805d033ab 100644 --- a/reference/test/matrix/sparsity_csr_kernels.cpp +++ b/reference/test/matrix/sparsity_csr_kernels.cpp @@ -125,7 +125,7 @@ class SparsityCsr : public ::testing::Test { std::unique_ptr mtx3_unsorted; }; -TYPED_TEST_SUITE(SparsityCsr, gko::test::ValueIndexTypes, +TYPED_TEST_SUITE(SparsityCsr, gko::test::ValueIndexTypesWithHalf, PairTypenameNameGenerator); @@ -145,7 +145,7 @@ TYPED_TEST(SparsityCsr, AppliesToDenseVector) TYPED_TEST(SparsityCsr, AppliesToMixedDenseVector) { - using T = gko::next_precision; + using T = gko::next_precision_with_half; using Vec = gko::matrix::Dense; auto x = gko::initialize({2.0, 1.0, 4.0}, this->exec); auto y = Vec::create(this->exec, gko::dim<2>{2, 1}); @@ -192,7 +192,7 @@ TYPED_TEST(SparsityCsr, AppliesLinearCombinationToDenseVector) TYPED_TEST(SparsityCsr, AppliesLinearCombinationToMixedDenseVector) { - using T = gko::next_precision; + using T = gko::next_precision_with_half; using Vec = gko::matrix::Dense; auto alpha = gko::initialize({-1.0}, this->exec); auto beta = gko::initialize({2.0}, this->exec); @@ -243,8 +243,8 @@ TYPED_TEST(SparsityCsr, AppliesToComplex) TYPED_TEST(SparsityCsr, AppliesToMixedComplex) { - using T = - gko::next_precision>; + using T = gko::next_precision_with_half< + gko::to_complex>; using Vec = gko::matrix::Dense; auto x = gko::initialize({T{2.0, 4.0}, T{1.0, 2.0}, T{4.0, 8.0}}, this->exec); @@ -279,7 +279,7 @@ TYPED_TEST(SparsityCsr, AppliesLinearCombinationToComplex) TYPED_TEST(SparsityCsr, AppliesLinearCombinationToMixedComplex) { using Vec = gko::matrix::Dense< - gko::next_precision>; + gko::next_precision_with_half>; using ComplexVec = gko::to_complex; using T = typename ComplexVec::value_type; auto alpha = gko::initialize({-1.0}, this->exec);