MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / print_statistics

Function print_statistics

src/program.cpp:368–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366}
367
368static void print_statistics(std::ostream& os, const argument& a)
369{
370 a.visit(
371 [&](auto t) {
372 os << "Min value: " << *std::min_element(t.begin(), t.end()) << ", ";
373 os << "Max value: " << *std::max_element(t.begin(), t.end()) << ", ";
374 double num_elements = t.size();
375 auto mean = std::accumulate(t.begin(), t.end(), 0.0) / num_elements;
376 auto stddev = std::sqrt(
377 std::accumulate(t.begin(),
378 t.end(),
379 0.0,
380 [&](auto r, auto v) { return r + std::pow((v - mean), 2.0); }) /
381 num_elements);
382 os << "Mean: " << mean << ", ";
383 os << "StdDev: " << stddev << "\n";
384 },
385 [&](const auto& xs) {
386 for(const auto& x : xs)
387 {
388 print_statistics(os, x);
389 }
390 });
391}
392
393static std::unordered_set<std::string> classify_argument(const argument& a)
394{

Callers 1

evalMethod · 0.85

Calls 8

min_elementFunction · 0.85
accumulateFunction · 0.85
sqrtClass · 0.85
powClass · 0.85
visitMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected