76 if (!stream.is_open()) {
77 cerr <<
"couldn't open input file: " <<
filename << endl;
81 while (getline(stream,
line)) {
82 if (
line.empty())
continue;
83 if (
line.find(
"BEGIN MEASUREMENTS ALL POT SIZES") == 0) {
85 cerr <<
"Input file " <<
filename <<
" contains redundant BEGIN MEASUREMENTS lines";
91 if (
line.find(
"BEGIN MEASUREMENTS DEFAULT SIZES") == 0) {
93 cerr <<
"Input file " <<
filename <<
" contains redundant BEGIN MEASUREMENTS lines";
105 unsigned int product_size, block_size;
107 int sscanf_result = sscanf(
line.c_str(),
"%x %x %f", &product_size, &block_size, &gflops);
108 if (3 != sscanf_result || !product_size || product_size > 0xfff || !block_size || block_size > 0xfff ||
110 cerr <<
"ill-formed input file: " <<
filename << endl;
111 cerr <<
"offending line:" << endl <<
line << endl;
125 unsigned int product_size;
128 int sscanf_result = sscanf(
line.c_str(),
"%x default(%d, %d, %d) %f", &product_size, &bk, &bm, &bn, &gflops);
129 if (5 != sscanf_result || !product_size || product_size > 0xfff || !
isfinite(gflops)) {
130 cerr <<
"ill-formed input file: " <<
filename << endl;
131 cerr <<
"offending line:" << endl <<
line << endl;
152 cerr <<
"Unrecognized input file " <<
filename << endl;
156 cerr <<
"didn't find any measurements in input file: " <<
filename << endl;
bool only_cubic_sizes
Definition: analyze-blocking-sizes.cpp:29
#define isfinite(X)
Definition: main.h:111
std::uint16_t uint16_t
Definition: Meta.h:38
line
Definition: calibrate.py:103
Definition: analyze-blocking-sizes.cpp:60
uint16_t product_size
Definition: analyze-blocking-sizes.cpp:61
size_triple_t nonpot_block_size
Definition: analyze-blocking-sizes.cpp:63
uint16_t pot_block_size
Definition: analyze-blocking-sizes.cpp:62
float gflops
Definition: analyze-blocking-sizes.cpp:64
Definition: analyze-blocking-sizes.cpp:45