Skip to content

Add Unmanaged to scratch View in TeamPolicy example #699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JBludau
Copy link
Contributor

@JBludau JBludau commented Jul 21, 2025

From a discussion with @dalg24 and @dholladay00 on slack.
The Unmanaged trait seems to be missing in the view allocation in the example. This PR also adds a hint on the ScratchMemorySpace requiring Unmanaged

@@ -168,7 +168,7 @@ Examples
int scan = team_handle.team_scan(tid+1, &global);
// scan == tid*(tid+1)/2 on every thread
// global == ts*(ts-1)/2 on every thread
Kokkos::View<int*, policy_type::execution_space::scratch_memory_type>
Kokkos::View<int*, policy_type::execution_space::scratch_memory_type, Kokkos::MemoryTraits<Kokkos::Unmanaged>>

Choose a reason for hiding this comment

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

Just to note that I couldn't find any reference to a scratch_memory_type alias in recent versions of the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, grep shows no hits ... I will change to scratch_memory_space

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done 79c16f7

Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

I found "works" a little unclear and suggested a slight rewording. Otherwise, this looks good.

@masterleinad
Copy link
Contributor

The Unmanaged trait seems to be missing in the view allocation in the example.

Of course, that's not required to create an unmanaged View. The example would also work without it.

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.

3 participants