Public Member Functions | |
| MachineShMemWinMemoryAllocator (IParallelMng *pm) | |
| bool | hasRealloc (MemoryAllocationArgs) const override |
| Indicates whether the allocator supports realloc semantics. | |
| AllocatedMemoryInfo | allocate (MemoryAllocationArgs, Int64 new_size) override |
| Allocates memory for new_size bytes and returns the pointer. | |
| AllocatedMemoryInfo | reallocate (MemoryAllocationArgs, AllocatedMemoryInfo current_ptr, Int64 new_size) override |
| Reallocates memory for new_size bytes and returns the pointer. | |
| void | deallocate (MemoryAllocationArgs, AllocatedMemoryInfo ptr) override |
| Frees the memory whose base address is ptr. | |
| Int64 | adjustedCapacity (MemoryAllocationArgs, Int64 wanted_capacity, Int64) const override |
| Adjusts the capacity based on the element size. | |
| size_t | guaranteedAlignment (MemoryAllocationArgs) const override |
| Value of the alignment guaranteed by the allocator. | |
| bool | isCollective () const override |
| Indicates whether calls to the allocator must be performed collectively. | |
| Public Member Functions inherited from Arcane::IMemoryAllocator | |
| virtual | ~IMemoryAllocator ()=default |
| Destroys the allocator. | |
| virtual size_t | guarantedAlignment (MemoryAllocationArgs args) const |
| Value of the alignment guaranteed by the allocator. | |
| virtual void | notifyMemoryArgsChanged (MemoryAllocationArgs old_args, MemoryAllocationArgs new_args, AllocatedMemoryInfo ptr) |
| Notifies of a change in instance-specific arguments. | |
| virtual void | copyMemory (MemoryAllocationArgs args, AllocatedMemoryInfo destination, AllocatedMemoryInfo source) |
| Copies memory between two regions. | |
| virtual eMemoryResource | memoryResource () const |
| Memory resource provided by the allocator. | |
Static Public Member Functions | |
| static ConstArrayView< Int32 > | machineRanks (AllocatedMemoryInfo ptr) |
| static void | barrier (AllocatedMemoryInfo ptr) |
| static Span< std::byte > | segmentView (AllocatedMemoryInfo ptr) |
| static Span< std::byte > | segmentView (AllocatedMemoryInfo ptr, Int32 rank) |
Static Private Member Functions | |
| static MachineShMemWinBase * | _windowBase (AllocatedMemoryInfo ptr) |
Private Attributes | |
| IParallelMng * | m_pm |
Definition at line 35 of file MachineShMemWinMemoryAllocator.h.
|
explicit |
Definition at line 35 of file MachineShMemWinMemoryAllocator.cc.
|
staticprivate |
Definition at line 183 of file MachineShMemWinMemoryAllocator.cc.
|
inlineoverridevirtual |
Adjusts the capacity based on the element size.
This method is used to optionally modify the number of allocated elements based on their size. This allows, for example, aligned allocators to ensure that the number of elements allocated is a multiple of this alignment.
Implements Arcane::IMemoryAllocator.
Definition at line 49 of file MachineShMemWinMemoryAllocator.h.
|
overridevirtual |
Allocates memory for new_size bytes and returns the pointer.
The semantics are equivalent to malloc():
Implements Arcane::IMemoryAllocator.
Definition at line 43 of file MachineShMemWinMemoryAllocator.cc.
References Arcane::MessagePassing::ReduceMax.
Referenced by reallocate().
|
static |
Definition at line 152 of file MachineShMemWinMemoryAllocator.cc.
|
overridevirtual |
Frees the memory whose base address is ptr.
The pointer ptr must have been allocated via a call to allocate() or reallocate() on this instance.
The semantics of this method are equivalent to free(), and thus ptr may be null, in which case no operation is performed.
Implements Arcane::IMemoryAllocator.
Definition at line 119 of file MachineShMemWinMemoryAllocator.cc.
References Arcane::AllocatedMemoryInfo::baseAddress(), Arcane::SpanImpl< T, SizeType, Extent >::data(), Arcane::MachineShMemWinBase::segmentView(), Arcane::AllocatedMemoryInfo::size(), and Arcane::SpanImpl< T, SizeType, Extent >::size().
|
inlineoverridevirtual |
Value of the alignment guaranteed by the allocator.
This method ensures that an allocator has sufficient alignment for certain operations such as vectorization, for example.
If there is no guarantee, it returns 0.
Implements Arcane::IMemoryAllocator.
Definition at line 53 of file MachineShMemWinMemoryAllocator.h.
|
inlineoverridevirtual |
Indicates whether the allocator supports realloc semantics.
Default C allocators (malloc/realloc/free) obviously support realloc, but this is not necessarily the case for specific allocators with memory alignment (such as posix_memalign).
Reimplemented from Arcane::IMemoryAllocator.
Definition at line 45 of file MachineShMemWinMemoryAllocator.h.
|
inlineoverridevirtual |
Indicates whether calls to the allocator must be performed collectively.
Reimplemented from Arcane::IMemoryAllocator.
Definition at line 57 of file MachineShMemWinMemoryAllocator.h.
|
static |
Definition at line 143 of file MachineShMemWinMemoryAllocator.cc.
|
overridevirtual |
Reallocates memory for new_size bytes and returns the pointer.
The pointer current_ptr must have been allocated via a call to allocate() or reallocate() on this instance.
The semantics of this method are equivalent to realloc():
Implements Arcane::IMemoryAllocator.
Definition at line 81 of file MachineShMemWinMemoryAllocator.cc.
References allocate(), Arcane::AllocatedMemoryInfo::baseAddress(), Arcane::SpanImpl< T, SizeType, Extent >::data(), Arcane::MachineShMemWinBase::resize(), Arcane::MachineShMemWinBase::segmentView(), and Arcane::SpanImpl< T, SizeType, Extent >::size().
|
static |
Definition at line 161 of file MachineShMemWinMemoryAllocator.cc.
|
static |
Definition at line 172 of file MachineShMemWinMemoryAllocator.cc.
|
private |
Definition at line 75 of file MachineShMemWinMemoryAllocator.h.