You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The precondition check should reject sizes that do not match the backend chunking rules. Instead, it only checks alignment and overlap, then forwards the byte count unchanged. Device implementations copy fixed 2/4/8/16-byte chunks while offset < size, so a short tail is copied past the requested extent.
Note: CodeRabbit is enabled on this repository as a convenience for maintainers
and contributors. Use your best judgment when considering its review comments and
suggestions — a suggested change may be inadequate, unnecessary, or safe to ignore.
Contributors are not expected to address every comment. Human reviews are what
ultimately matter for merging.
Updated __memcpy_async_check_pre to better enforce valid copy sizes for backend chunking rules. The check now derives a chunk size from alignment (min(16, align)) and rejects byte counts that are not a multiple of that chunk. It also keeps source/destination alignment validation while switching the overlap test to ::cuda::ranges_overlap over the actual byte ranges.
Also adjusted the void* overload to forward the size into the updated typed implementation and added the new overlap header include.
Walkthrough
important: __memcpy_async_check_pre adds a copy-chunk divisibility check, keeps alignment checks, and replaces the overlap test with cuda::ranges_overlap; the void* overload forwards __size_bytes into the updated typed overload.
Adds the memcpy_async copy-chunk multiple check, keeps alignment validation, switches the non-overlap test to cuda::ranges_overlap, and forwards __size_bytes through the void* overload.
Comment @coderabbitai help to get the list of available commands.
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
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.
Description
memcpy_asyncpreconditions:and added a couple of improvements