Support copying the overlapping region from one buffer to another.#8463
Merged
mcourteaux merged 2 commits intohalide:mainfrom Mar 1, 2025
Merged
Support copying the overlapping region from one buffer to another.#8463mcourteaux merged 2 commits intohalide:mainfrom
mcourteaux merged 2 commits intohalide:mainfrom
Conversation
Contributor
Author
|
One of the build bots died? Can we restart one build specifically manually? Or will everything have to rerun? |
Contributor
Sorry, I had to restart the buildmaster. You may need to rerun everything :-/ |
zvookin
reviewed
Nov 8, 2024
Member
There was a problem hiding this comment.
This is just to satisfy the formatter right?
Contributor
Author
There was a problem hiding this comment.
Yes. I put a comment on it in the PR. I have clang-format-18, but the build bots still run clang-format-17. Version 18 wants this change for some reason.
zvookin
reviewed
Nov 8, 2024
…stead of being restricted to copy to the entire dst buffer).
272f2d7 to
14c5a3c
Compare
Contributor
Author
|
All tests passing. Can we land this? |
abadams
approved these changes
Feb 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).
dst_beginindevice_copy.src_beginanddst_beginvalues.CL_MISALIGNED_SUB_BUFFER_OFFSET#8235 where I make new a new buffer that acts as a crop (but is not), and copy the result back to the original buffer after the pipeline is done.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).