Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
abadams committed Dec 20, 2024
1 parent 6f2a85c commit 7a9be6f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/runtime/HalideBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,8 @@ class Buffer {
static Buffer<T, Dims, InClassDimStorage> make_with_shape_of(Buffer<T2, D2, S2> src,
void *(*allocate_fn)(size_t) = nullptr,
void (*deallocate_fn)(void *) = nullptr) {
// Note that src is taken by value because its dims are mutated
// in-place by the helper. Do not change to taking it by reference.
static_assert(Dims == D2 || Dims == AnyDims);
const halide_type_t dst_type = T_is_void ? src.type() : halide_type_of<typename std::remove_cv<not_void_T>::type>();
return Buffer<>::make_with_shape_of_helper(dst_type, src.dimensions(), src.buf.dim,
Expand Down

0 comments on commit 7a9be6f

Please sign in to comment.