Skip to content
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 05_slice example to use DefaultExecutionSpace #677

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dineshadepu
Copy link
Contributor

@dineshadepu dineshadepu commented Aug 26, 2023

Closes #624 .

  • 01_hello_world (Not needed)
  • 02_tuple (Not needed)
  • 03_struct_of_arrays (Not needed)
  • 04_aosoa
  • 04_aosoa_advanced_unmanaged
  • 05_slice
  • 05_slice_advanced_cuda (Not needed)
  • 05_slice_advanced_openmp (Not needed)
  • 06_deep_copy (Not needed)
  • 07_sorting
  • 08_linked_cell_list
  • 09_neighbor_list
  • 09_neighbor_list_arborx
  • 10_neighbor_parallel_for
  • 10_simd_parallel_for
  • 11_migration
  • 12_halo_exchange
  • 13_hdf5_output

Copy link
Member

@streeve streeve left a comment

Choose a reason for hiding this comment

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

The code will need to be formatted - see https://github.com/ECP-copa/Cabana/blob/master/CONTRIBUTING.md for clang-format and pre-commit details

using MemorySpace = Kokkos::HostSpace;
using ExecutionSpace = Kokkos::DefaultHostExecutionSpace;
using ExecutionSpace = Kokkos::DefaultExecutionSpace;
using MemorySpace = typename ExecutionSpace::memory_space;
using DeviceType = Kokkos::Device<ExecutionSpace, MemorySpace>;
Copy link
Member

Choose a reason for hiding this comment

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

Just a note that #585 will change most of the examples to use memory_space directly - it may be best to wait until that is merged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will update the rest of the examples after #585 is merged. Will keep the PR open until then.

Copy link
Member

Choose a reason for hiding this comment

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

@dineshadepu should be okay to continue this PR now that we've merged the blocking PR - let me know if those changes are confusing in any way. But I do not plan to include this in the imminent release, so feel free to wait until that's finished

@@ -78,6 +77,9 @@ void sliceExample()
Cabana::AoSoA<DataTypes, DeviceType, VectorLength> aosoa( "my_aosoa",
num_tuple );

// Create a mirror view of the aosoa on the host for accessing it legally
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Create a mirror view of the aosoa on the host for accessing it legally
// Create a mirror of the AoSoA on the host (this will not make a new copy if the memory is already allocated on the host, but will if it is in device memory) in order to print out the data.

Comment on lines +63 to +64
We declare the memory space in which the AoSoA will be allocated
on the default execution space we are dealing with.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
We declare the memory space in which the AoSoA will be allocated
on the default execution space we are dealing with.
We create the AoSoA particle data in the memory space associated
with the default execution space (see https://kokkos.github.io/kokkos-core-wiki/ProgrammingGuide/Initialization.html).

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.

Run examples on host or device
2 participants