-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Copy link
Description
This repro:
#include "Halide.h"
using namespace Halide;
using namespace Halide::Internal;
int main(int argc, char **argv) {
Param<float> p, p_min, p_max;
Scope<Interval> scope;
scope.push(p.name(), Interval{p_min, p_max});
std::cout << "ops \t non-strict \t strict\n";
for (int limit = 1; limit < 100; limit++) {
Expr e = p;
int ops = 0;
for (int i = 0; i < limit; i++) {
e = e * p + (i + 1);
ops += 2;
}
auto t1 = std::chrono::high_resolution_clock::now();
bounds_of_expr_in_scope(e, scope);
auto t2 = std::chrono::high_resolution_clock::now();
e = strictify_float(e);
auto t3 = std::chrono::high_resolution_clock::now();
bounds_of_expr_in_scope(e, scope);
auto t4 = std::chrono::high_resolution_clock::now();
// Print us per multiply op in the expr
std::cout << ops << " \t "
<< std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count() << " \t "
<< std::chrono::duration_cast<std::chrono::microseconds>(t4 - t3).count() << "\n";
}
return 0;
}
Produces this output:
ops non-strict strict
2 62 22
4 9 60
6 13 231
8 17 944
10 21 3709
12 13 7372
14 15 29597
16 17 118067
18 19 473886
20 21 1895721
Seems to be exponential.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels