Skip to content

Reference-Aware Algorithms - #2153

Open
RobertLeahy wants to merge 15 commits into
NVIDIA:mainfrom
RobertLeahy:p4288_20260731
Open

Reference-Aware Algorithms#2153
RobertLeahy wants to merge 15 commits into
NVIDIA:mainfrom
RobertLeahy:p4288_20260731

Conversation

@RobertLeahy

Copy link
Copy Markdown
Contributor

Implements Stop the Decay P4288R0.

Also contains the following fixes:

  • continues_on now implements the standard behavior of scheduling when storing the result datums of the predecessor throws
  • finally now runs the successor even if storing the result datums throws

Does not fully implement P4288R0's design for storage_for_completion_signature because std::tuple is not device compatible.

Several headers in exec depend on __storage.hpp.
Allows for template arguments deduced from a completion, for example in:

  template<typename... Args>
  void set_value(Args&&...);

To be used to determine which completion signature such a completion
corresponds to.

See P4288.
Provides a turnkey, reference-aware way to store completion signatures
for later examination or transmission.

See P4288.

Note that this implementation diverges from the implementation described
in P4288. In order to remain device compatible this implementation
stores a __tuple rather than a std::tuple. Therefore
storage_for_completion_signature::arguments cannot be provided (since it
returns a reference to the directly stored std::tuple, which doesn't
exist in this implementation).

Moreover to support algorithms which aim to be usable on host and device
the implementation in this commit provides both
storage_for_completion_signature::forward_arguments and
::__forward_arguments where the latter returns a __tuple and can
therefore be marked as being device compatible.
In addition to adding reference awareness also fixes (and brings under
test) a previous defect: If decay-copying the result datums threw the
successor operation was previously skipped.
See P4288.

Also brings the implementation into alignment with the standard: The
standard specifies that if storage the value result datums throws the
schedule operation is started whereas the previous implementation
delivered such a failure inline.
No longer used in favor of storage_for_completion_signatures (which is
reference aware).
@copy-pr-bot

copy-pr-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant