MCPcopy Create free account
hub / github.com/Derious/cuMPC / test_product

Function test_product

dependence/eigen-3.4.0/test/bfloat16_float.cpp:351–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351void test_product()
352{
353 typedef Matrix<bfloat16,Dynamic,Dynamic> MatrixXh;
354 Index rows = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
355 Index cols = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
356 Index depth = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
357 MatrixXh Ah = MatrixXh::Random(rows,depth);
358 MatrixXh Bh = MatrixXh::Random(depth,cols);
359 MatrixXh Ch = MatrixXh::Random(rows,cols);
360 MatrixXf Af = Ah.cast<float>();
361 MatrixXf Bf = Bh.cast<float>();
362 MatrixXf Cf = Ch.cast<float>();
363 VERIFY_IS_APPROX(Ch.noalias()+=Ah*Bh, (Cf.noalias()+=Af*Bf).cast<bfloat16>());
364}
365
366EIGEN_DECLARE_TEST(bfloat16_float)
367{

Callers 1

EIGEN_DECLARE_TESTFunction · 0.70

Calls 1

noaliasMethod · 0.80

Tested by

no test coverage detected