Skip to content

Commit

Permalink
Fix two warnings on GCC 14.2.1. (#8430)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcourteaux authored Oct 11, 2024
1 parent c4199ad commit 9a55d9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Derivative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1816,8 +1816,8 @@ void ReverseAccumulationVisitor::propagate_halide_function_call(
}
// If previous update has a different set of reduction variables,
// don't merge
const vector<ReductionVariable> &rvars =
func_to_update.function().update(update_id).schedule().rvars();
Function func = func_to_update.function();
const vector<ReductionVariable> &rvars = func.update(update_id).schedule().rvars();
if (!merged_r.defined()) {
return rvars.empty();
}
Expand Down
16 changes: 8 additions & 8 deletions src/runtime/HalideBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1431,23 +1431,23 @@ class Buffer {
// into a static dispatch to the right-sized copy.)
if (T_is_void ? (type().bytes() == 1) : (sizeof(not_void_T) == 1)) {
using MemType = uint8_t;
auto &typed_dst = (Buffer<MemType, Dims, InClassDimStorage> &)dst;
auto &typed_src = (Buffer<const MemType, D2, S2> &)src;
auto &typed_dst = reinterpret_cast<Buffer<MemType, Dims, InClassDimStorage> &>(dst);
auto &typed_src = reinterpret_cast<Buffer<const MemType, D2, S2> &>(src);
typed_dst.for_each_value([&](MemType &dst, MemType src) { dst = src; }, typed_src);
} else if (T_is_void ? (type().bytes() == 2) : (sizeof(not_void_T) == 2)) {
using MemType = uint16_t;
auto &typed_dst = (Buffer<MemType, Dims, InClassDimStorage> &)dst;
auto &typed_src = (Buffer<const MemType, D2, S2> &)src;
auto &typed_dst = reinterpret_cast<Buffer<MemType, Dims, InClassDimStorage> &>(dst);
auto &typed_src = reinterpret_cast<Buffer<const MemType, D2, S2> &>(src);
typed_dst.for_each_value([&](MemType &dst, MemType src) { dst = src; }, typed_src);
} else if (T_is_void ? (type().bytes() == 4) : (sizeof(not_void_T) == 4)) {
using MemType = uint32_t;
auto &typed_dst = (Buffer<MemType, Dims, InClassDimStorage> &)dst;
auto &typed_src = (Buffer<const MemType, D2, S2> &)src;
auto &typed_dst = reinterpret_cast<Buffer<MemType, Dims, InClassDimStorage> &>(dst);
auto &typed_src = reinterpret_cast<Buffer<const MemType, D2, S2> &>(src);
typed_dst.for_each_value([&](MemType &dst, MemType src) { dst = src; }, typed_src);
} else if (T_is_void ? (type().bytes() == 8) : (sizeof(not_void_T) == 8)) {
using MemType = uint64_t;
auto &typed_dst = (Buffer<MemType, Dims, InClassDimStorage> &)dst;
auto &typed_src = (Buffer<const MemType, D2, S2> &)src;
auto &typed_dst = reinterpret_cast<Buffer<MemType, Dims, InClassDimStorage> &>(dst);
auto &typed_src = reinterpret_cast<Buffer<const MemType, D2, S2> &>(src);
typed_dst.for_each_value([&](MemType &dst, MemType src) { dst = src; }, typed_src);
} else {
assert(false && "type().bytes() must be 1, 2, 4, or 8");
Expand Down

0 comments on commit 9a55d9c

Please sign in to comment.