halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.91k stars 1.07k forks source link

Support copying the overlapping region from one buffer to another. #8463

Open mcourteaux opened 2 weeks ago

mcourteaux commented 2 weeks ago

TLDR: This PR makes it possible to copy from a smaller buffer to a bigger buffer as well (i.e. blit a buffer onto another buffer). Use case: workaround for #8235: realize pipeline to a buffer that acts as a crop, and then copy the result back.


This PR makes it possible to copy from any buffer to any other buffer with the same number of dimensions. This is in contrast to the original functionality where it tries to copy from src to the entire number of elements in the dst buffer (even if src is smaller).

Irrelevant: my clang-format for some reason wanted to move two things in Halide::Runtime::Buffer, which is compatible with the one on the automatic test here. It seems to be the difference between clang-format-17 (github test) and clang-format-18 (my machine).

mcourteaux commented 2 weeks ago

One of the build bots died? Can we restart one build specifically manually? Or will everything have to rerun?

steven-johnson commented 2 weeks ago

One of the build bots died? Can we restart one build specifically manually? Or will everything have to rerun?

Sorry, I had to restart the buildmaster. You may need to rerun everything :-/

mcourteaux commented 2 weeks ago

I ran into a crash on my application. Will try to figure out what that is before I reopen for review. It seems to be an out-of-memory issue which is not reported as such.