Skip to content

Commit

Permalink
Merge pull request Apress#33 from Pennycook/matrix-multiply-verification
Browse files Browse the repository at this point in the history
Relax correctness test for Ch04 matrix multiply
  • Loading branch information
jamesreinders authored Apr 12, 2022
2 parents 3242729 + 4ddd485 commit 5c8d690
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int main() {
for (int k = 0; k < N; ++k) {
gold += a[j * N + k] * b[k * N + i];
}
if (std::abs(gold - c[j * N + i]) / gold > 1.0E-06) {
if (std::abs(gold - c[j * N + i]) / gold > 1.0E-05) {
passed = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int main() {
for (int k = 0; k < N; ++k) {
gold += a[j * N + k] * b[k * N + i];
}
if (std::abs(gold - c[j * N + i]) / gold > 1.0E-06) {
if (std::abs(gold - c[j * N + i]) / gold > 1.0E-05) {
passed = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int main() {
for (int k = 0; k < N; ++k) {
gold += a[j * N + k] * b[k * N + i];
}
if (std::abs(gold - c[j * N + i]) / gold > 1.0E-06) {
if (std::abs(gold - c[j * N + i]) / gold > 1.0E-05) {
passed = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main() {
for (int k = 0; k < N; ++k) {
gold += a[j * N + k] * b[k * N + i];
}
if (std::abs(gold - c[j * N + i]) / gold > 1.0E-06) {
if (std::abs(gold - c[j * N + i]) / gold > 1.0E-05) {
passed = false;
}
}
Expand Down

0 comments on commit 5c8d690

Please sign in to comment.