Skip to content

Commit 52da814

Browse files
authored
Merge pull request #5165 from halide/abadams/rungen_set_host_dirty
Make sure to set_host_dirty in rungen
2 parents 49d0476 + aa92f5c commit 52da814

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/RunGen.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ inline Buffer<> allocate_buffer(const halide_type_t &type, const Shape &shape) {
387387
if (b.number_of_elements() > 0) {
388388
b.check_overflow();
389389
b.allocate();
390+
b.set_host_dirty();
390391
}
391392
return b;
392393
}
@@ -875,6 +876,10 @@ struct ArgData {
875876

876877
buffer_value = allocate_buffer(metadata->type, new_shape);
877878

879+
// allocate_buffer conservatively sets host dirty. Don't waste
880+
// time copying output buffers to device.
881+
buffer_value.set_host_dirty(false);
882+
878883
info() << "Output " << name << ": BoundsQuery result is " << constrained_shape;
879884
info() << "Output " << name << ": Shape is " << get_shape(buffer_value);
880885
}

0 commit comments

Comments
 (0)