Skip to content

Ensure all execution policies are also environments#8155

Merged
miscco merged 6 commits intoNVIDIA:mainfrom
miscco:execution_policy_with_env
Mar 31, 2026
Merged

Ensure all execution policies are also environments#8155
miscco merged 6 commits intoNVIDIA:mainfrom
miscco:execution_policy_with_env

Conversation

@miscco
Copy link
Copy Markdown
Contributor

@miscco miscco commented Mar 24, 2026

We want to be able to pass additional information to execution policies.

We already settled on the sender & receiver approach with queries and key value pairs.

This refactors the current approach to turn __execution_policy_base into a proper environment. That has the advantage that we do not need to handle the cuda execution policy in a special way.

The only cuda specific code is when we want to ensure that streams are passed as cuda::stream_ref and memory resources as cuda::mr::resource_ref

This is currently failing some tests we had in place that relied on special handling of the cuda policy wrt to memory resources

I am not sure if that is something we want to change?

@miscco miscco requested review from a team as code owners March 24, 2026 16:09
@miscco miscco requested a review from jrhemstad March 24, 2026 16:09
@github-project-automation github-project-automation bot moved this to Todo in CCCL Mar 24, 2026
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Mar 24, 2026
@github-actions

This comment has been minimized.

@miscco miscco force-pushed the execution_policy_with_env branch 9 times, most recently from 8322290 to 228e42c Compare March 25, 2026 16:51
@github-actions

This comment has been minimized.

@miscco miscco force-pushed the execution_policy_with_env branch from 228e42c to 8bdc9c9 Compare March 25, 2026 19:10
@miscco miscco requested a review from a team as a code owner March 25, 2026 19:10
@miscco miscco force-pushed the execution_policy_with_env branch from 8bdc9c9 to 08e209d Compare March 25, 2026 19:17
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@miscco miscco force-pushed the execution_policy_with_env branch 3 times, most recently from d470fb4 to 0b18867 Compare March 30, 2026 08:17
@github-actions

This comment has been minimized.

@miscco miscco force-pushed the execution_policy_with_env branch from 0b18867 to 45a5d6c Compare March 30, 2026 11:44
@miscco miscco force-pushed the execution_policy_with_env branch from 45a5d6c to a364f81 Compare March 30, 2026 11:46
Comment on lines +262 to +265
test(cuda::std::execution::seq);
test(cuda::std::execution::par);
test(cuda::std::execution::par_unseq);
test(cuda::std::execution::unseq);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Why should the standard policies accept streams and memory resources?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memory resources are universally useful also for potential host execution policies

regarding streams, its a bit more questionable, but I believe if we add a way to add a backend to an execution policy it will make sense

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really not allow this for any of the standard execution policies, even if we saw a use for this in the future. Users are going to do unimaginable things if they have a chance to ;)

@miscco miscco force-pushed the execution_policy_with_env branch 2 times, most recently from 8997d7a to f110f72 Compare March 30, 2026 12:30
miscco added 3 commits March 30, 2026 14:38
We want to be able to pass additional information to execution policies.

We already settled on the sender & receiver approach with queries and key value pairs.

This refactors the current approach to turn `__execution_policy_base` into a proper environment. That has the advantage that we do not need to handle the cuda execution policy in a special way.

The only cuda specific code is when we want to ensure that streams are passed as `cuda::stream_ref` and memory resources as `cuda::mr::resource_ref`
@miscco miscco force-pushed the execution_policy_with_env branch from d9ef7ea to 1a8e3e9 Compare March 30, 2026 12:39
@miscco miscco force-pushed the execution_policy_with_env branch from 1a8e3e9 to 2c63149 Compare March 30, 2026 13:31
@github-actions

This comment has been minimized.

@miscco miscco force-pushed the execution_policy_with_env branch from 34406e7 to d91096a Compare March 31, 2026 07:05
@miscco miscco enabled auto-merge (squash) March 31, 2026 09:54
@github-actions
Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 47m: Pass: 100%/137 | Total: 4d 16h | Max: 2h 46m | Hits: 58%/281638

See results here.

@miscco miscco merged commit e97471a into NVIDIA:main Mar 31, 2026
157 of 158 checks passed
@miscco miscco deleted the execution_policy_with_env branch March 31, 2026 10:39
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants