Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8534 #8535

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/runtime/HalideBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1991,9 +1991,11 @@ class Buffer {
/** Make a buffer with the same shape and memory nesting order as
* another buffer. It may have a different type. */
template<typename T2, int D2, int S2>
static Buffer<T, Dims, InClassDimStorage> make_with_shape_of(const Buffer<T2, D2, S2> &src,
static Buffer<T, Dims, InClassDimStorage> make_with_shape_of(Buffer<T2, D2, S2> src,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably need to add a NOLINT comment here once we move to clang-tidy-19 but that can (and should) be done in the other CL since exact placement and syntax may be a bit fussy: https://clang.llvm.org/extra/clang-tidy/#suppressing-undesired-diagnostics

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