Skip to content

Commit

Permalink
Use CommonTestFixture value_type
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikvn committed Oct 6, 2023
1 parent 887a6f7 commit f200e51
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/matrix/batch_dense_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

class Dense : public CommonTestFixture {
protected:
using vtype = double;
using Mtx = gko::batch::matrix::Dense<vtype>;
using MVec = gko::batch::MultiVector<vtype>;
using Mtx = gko::batch::matrix::Dense<value_type>;
using MVec = gko::batch::MultiVector<value_type>;

Dense() : rand_engine(15) {}

Expand Down Expand Up @@ -87,7 +86,7 @@ class Dense : public CommonTestFixture {
expected = MVec::create(
ref,
gko::batch_dim<2>(batch_size, gko::dim<2>{num_rows, num_vecs}));
expected->fill(gko::one<vtype>());
expected->fill(gko::one<value_type>());
dresult = gko::clone(exec, expected);
}

Expand All @@ -114,7 +113,7 @@ TEST_F(Dense, SingleVectorApplyIsEquivalentToRef)
x->apply(y.get(), expected.get());
dx->apply(dy.get(), dresult.get());

GKO_ASSERT_BATCH_MTX_NEAR(dresult, expected, 1e-14);
GKO_ASSERT_BATCH_MTX_NEAR(dresult, expected, r<value_type>::value);
}


Expand All @@ -125,5 +124,5 @@ TEST_F(Dense, SingleVectorAdvancedApplyIsEquivalentToRef)
x->apply(alpha.get(), y.get(), beta.get(), expected.get());
dx->apply(dalpha.get(), dy.get(), dbeta.get(), dresult.get());

GKO_ASSERT_BATCH_MTX_NEAR(dresult, expected, 1e-14);
GKO_ASSERT_BATCH_MTX_NEAR(dresult, expected, r<value_type>::value);
}

0 comments on commit f200e51

Please sign in to comment.