Skip to content

Commit

Permalink
TEST: Check correctness of result values
Browse files Browse the repository at this point in the history
  • Loading branch information
czgdp1807 committed Dec 21, 2023
1 parent 5c65099 commit d826654
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions integration_tests/array_08.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ int main() {
xt::xtensor<double, 2> a = xt::empty<double>({3, 2});
xt::xtensor<double, 2> b = xt::empty<double>({2, 3});
xt::xtensor<double, 2> c = xt::empty<double>({3, 3});
xt::xtensor<double, 2> ce = {
{0.0, 0.0, 0.0},
{0.0, 6.0, 12.0},
{0.0, 12.0, 24.0}};

for( int i = 0; i < a.shape(0); i++ ) {
for( int j = 0; j < a.shape(1); j++ ) {
Expand All @@ -39,6 +43,13 @@ int main() {
std::cout << a << b << std::endl;
c = matmul(a, b);
std::cout << c << std::endl;
for( int i = 0; i < c.shape(0); i++ ) {
for( int j = 0; j < c.shape(1); j++ ) {
if( c(i, j) != ce(i, j) ) {
exit(2);
}
}
}

return 0;
}

0 comments on commit d826654

Please sign in to comment.