Skip to content

Commit ce4d69b

Browse files
author
Daniel Heck
committed
Merge remote-tracking branch 'origin/master' into llvm-ldflags
2 parents 090dfdb + 28232c6 commit ce4d69b

23 files changed

+557
-262
lines changed

apps/resize/resize.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Expr kernel_box(Expr x) {
3333

3434
Expr kernel_linear(Expr x) {
3535
Expr xx = abs(x);
36-
return select(xx < 1.0f, xx, 0.0f);
36+
return select(xx < 1.0f, 1.0f - xx, 0.0f);
3737
}
3838

3939
Expr kernel_cubic(Expr x) {

src/AllocationBoundsInference.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ class AllocationInference : public IRMutator {
2222
using IRMutator::visit;
2323

2424
const map<string, Function> &env;
25+
const FuncValueBounds &func_bounds;
2526
set<string> touched_by_extern;
2627

2728
void visit(const Realize *op) {
2829
map<string, Function>::const_iterator iter = env.find(op->name);
2930
assert (iter != env.end());
3031
Function f = iter->second;
3132

32-
Box b = box_touched(op->body, op->name);
33+
Box b = box_touched(op->body, op->name, Scope<Interval>(), func_bounds);
3334

3435
if (touched_by_extern.count(f.name())) {
3536
// The region touched is at least the region required at this
@@ -64,7 +65,8 @@ class AllocationInference : public IRMutator {
6465
}
6566

6667
public:
67-
AllocationInference(const map<string, Function> &e) : env(e) {
68+
AllocationInference(const map<string, Function> &e, const FuncValueBounds &fb) :
69+
env(e), func_bounds(fb) {
6870
// Figure out which buffers are touched by extern stages
6971
for (map<string, Function>::const_iterator iter = e.begin();
7072
iter != e.end(); ++iter) {
@@ -82,8 +84,10 @@ class AllocationInference : public IRMutator {
8284
}
8385
};
8486

85-
Stmt allocation_bounds_inference(Stmt s, const map<string, Function> &env) {
86-
AllocationInference inf(env);
87+
Stmt allocation_bounds_inference(Stmt s,
88+
const map<string, Function> &env,
89+
const FuncValueBounds &fb) {
90+
AllocationInference inf(env, fb);
8791
s = inf.mutate(s);
8892
return s;
8993
}

src/AllocationBoundsInference.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77

88
#include <map>
99
#include <string>
10+
1011
#include "IR.h"
12+
#include "Bounds.h"
1113

1214
namespace Halide {
1315
namespace Internal {
1416

1517
/** Take a partially statement with Realize nodes in terms of
1618
* variables, and define values for those variables. */
17-
Stmt allocation_bounds_inference(Stmt s, const std::map<std::string, Function> &env);
18-
19+
Stmt allocation_bounds_inference(Stmt s,
20+
const std::map<std::string, Function> &env,
21+
const std::map<std::pair<std::string, int>, Interval> &func_bounds);
1922
}
2023
}
2124

0 commit comments

Comments
 (0)