Skip to content
Discussion options

You must be logged in to vote

I think there was a mistake in the answer to the first discussion. std::allocator is allocated and accessible on the CPU; however, it is not accessible by the GPU. Instead, amrex::PinnedArenaAllocator should be used, which is also allocated in CPU memory but is accessible by both the CPU and GPU.

using HostTile = typename ContainerLike<amrex::PinnedArenaAllocator>::ParticleTileType;

This should work; however, from a performance standpoint, I would expect it to be better to not copy the particles to the CPU and to instead copy the solver output to the GPU and use ParallelFor to update the particles.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Afraid31
Comment options

@atmyers
Comment options

@Afraid31
Comment options

Answer selected by Afraid31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants