Skip to content

Commit 26cd723

Browse files
committed
PC::make_alike<Allocator>
Change the template default of `make_alike<>()` to use the same allocator as the creating allocator. This is a breaking change. In practice, this was so far used to create a pinned allocator, e.g., for I/O operations. It is more sensible to create the same allocator if unspecified as the creating PC and it also makes "modern"/future AMReX, which uses PCs with `PolymorphicArena` allocators, shorter/cleaner in user code.
1 parent e727197 commit 26cd723

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Src/Particle/AMReX_ParticleContainer.H

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,14 +1370,14 @@ public:
13701370
/** Create an empty particle container
13711371
*
13721372
* This creates a new AMReX particle container type with same compile-time
1373-
* and run-time attributes. But, it can change its allocator. This is
1374-
* helpful when creating temporary particle buffers for filter operations
1373+
* and run-time attributes. But, it can change its allocator (default: same allocator).
1374+
* This is helpful when creating temporary particle buffers for filter operations
13751375
* and device-to-host copies.
13761376
*
1377-
* @tparam Allocator AMReX allocator, e.g., amrex::PinnedArenaAllocator
1377+
* @tparam Allocator AMReX allocator, e.g., amrex::PinnedArenaAllocator, default: same allocator as the creating PC
13781378
* @return an empty particle container
13791379
* */
1380-
template <template<class> class NewAllocator=amrex::DefaultAllocator>
1380+
template <template<class> class NewAllocator=Allocator>
13811381
ContainerLike<NewAllocator>
13821382
make_alike () const
13831383
{

0 commit comments

Comments
 (0)