-
Notifications
You must be signed in to change notification settings - Fork 50
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
Modify example: 05_slice
to use 'DefaultExecutionSpace'
#673
Conversation
1. Create aosoa_host using `Cabana::create_mirror_view_and_copy` function
@@ -64,8 +64,12 @@ void sliceExample() | |||
allocated on NVIDIA devices use `Kokkos::CudaSpace` instead of | |||
`Kokkos::HostSpace`. | |||
*/ | |||
// using MemorySpace = Kokkos::CudaSpace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
@@ -64,8 +64,12 @@ void sliceExample() | |||
allocated on NVIDIA devices use `Kokkos::CudaSpace` instead of | |||
`Kokkos::HostSpace`. | |||
*/ | |||
// using MemorySpace = Kokkos::CudaSpace; | |||
// using ExecutionSpace = Kokkos::Cuda; | |||
|
|||
using MemorySpace = Kokkos::HostSpace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to match the execution space. using MemorySpace = typename ExecutionSpace::memory_space;
auto slice_0 = Cabana::slice<0>( aosoa, "my_slice_0" ); | ||
auto slice_1 = Cabana::slice<1>( aosoa, "my_slice_1" ); | ||
auto slice_2 = Cabana::slice<2>( aosoa, "my_slice_2" ); | ||
// Create a mirror view of the aosoa on the host for accessing it legally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this mirror creation above the slice comment
@@ -64,8 +64,12 @@ void sliceExample() | |||
allocated on NVIDIA devices use `Kokkos::CudaSpace` instead of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment will need to be updated to describe that this example uses default spaces to work across all supported backends, but explicit choices like HostSpace and CudaSpace can also be used.
I will create a new branch and reopen this PR. I am running into rebase issues. |
I have modified
05_slice
example to useDefaultExecutionSpace
. The current code works forCuda
space andDefaultHostExecutionSpace
. However, I am currently running into error while usingDefaultExecutionSpace
.I couldn't actually able to find a fix for this. Can you please tell me how can I fix this? I will modify the code accordingly and push and change other examples as soon as this is fixed.
Many thanks.
Here is the error message.
#624