void checkResults()

in benchmarks/trivial_compute_benchmark.cpp [37:52]


void checkResults(uint32_t input, uint64_t actual, int foo, size_t num_elements) {
  if (!foo)
    return;
  if (input != getInputs(num_elements)) {
    std::cerr << "Failed to recover input!" << std::endl;
    abort();
  }
  uint64_t expected = 0;
  for (size_t i = 0; i < num_elements; ++i) {
    expected += calculate(input, i, foo);
  }
  if (expected != actual) {
    std::cerr << "FAIL! " << expected << " vs " << actual << std::endl;
    abort();
  }
}