Skip to content

Commit

Permalink
More C++ verification
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Nov 10, 2024
1 parent 58f9ec4 commit cfde05c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
5 changes: 1 addition & 4 deletions benchmarks/C++/src/cd.h
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,7 @@ class CD : public Benchmark {
}

static bool verify_result(size_t actualCollisions, int32_t numAircrafts) {
if (numAircrafts == 1000) {
return actualCollisions == 14484;
}
if (numAircrafts == 500) {
if (numAircrafts >= 500) {
return actualCollisions == 14484;
}
if (numAircrafts == 250) {
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/C++/src/havlak.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ class Havlak : public Benchmark {
}

bool verifyResult(std::array<int32_t, 2> r, int32_t innerIterations) {
if (innerIterations == 40000) {
return r[0] == 121602 && r[1] == 5213;
}
if (innerIterations == 15000) {
return r[0] == 46602 && r[1] == 5213;
}
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/C++/src/mandelbrot.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class Mandelbrot : public Benchmark {

private:
bool verify_result(int32_t result, int32_t inner_iterations) {
if (inner_iterations == 2000) {
return result == 187;
}
if (inner_iterations == 750) {
return result == 50;
}
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/C++/src/nbody.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ class NBodySystem {
class NBody : public Benchmark {
private:
bool verify_result(double result, int32_t innerIterations) {
if (innerIterations == 10000000) {
return result == -0.1690778416543499;
}
if (innerIterations == 1000000) {
return result == -0.16908618459850192;
}
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/JavaScript/cd.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,7 @@ class CD extends Benchmark {
}

verifyResult(actualCollisions, numAircrafts) {
if (numAircrafts === 1000) { return actualCollisions === 14484; }
if (numAircrafts === 500) { return actualCollisions === 14484; }
if (numAircrafts >= 500) { return actualCollisions === 14484; }
if (numAircrafts === 250) { return actualCollisions === 10830; }
if (numAircrafts === 200) { return actualCollisions === 8655; }
if (numAircrafts === 100) { return actualCollisions === 4305; }
Expand Down

0 comments on commit cfde05c

Please sign in to comment.