UMPIRE
Umpire: resource management and provision
umpire::op::GenericReallocateOperation Class Reference

#include </home/docs/checkouts/readthedocs.org/user_builds/umpire/checkouts/develop/src/umpire/op/GenericReallocateOperation.hpp>

Inheritance diagram for umpire::op::GenericReallocateOperation:

Public Member Functions

void transform (void *current_ptr, void **new_ptr, util::AllocationRecord *current_allocation, util::AllocationRecord *new_allocation, std::size_t new_size)
 Transform length bytes of memory from src_ptr to dst_ptr. More...
 
camp::resources::EventProxy< camp::resources::Resourcetransform_async (void *current_ptr, void **new_ptr, util::AllocationRecord *current_allocation, util::AllocationRecord *new_allocation, std::size_t new_size, camp::resources::Resource &ctx)
 
virtual void apply (void *src_ptr, util::AllocationRecord *src_allocation, int val, std::size_t length)
 Apply val to the first length bytes of src_ptr. More...
 
virtual camp::resources::EventProxy< camp::resources::Resourceapply_async (void *src_ptr, util::AllocationRecord *src_allocation, int val, std::size_t length, camp::resources::Resource &ctx)
 

Detailed Description

Generic reallocate operation to work on any current_ptr location.

Member Function Documentation

◆ transform()

void umpire::op::GenericReallocateOperation::transform ( void *  current_ptr,
void **  new_ptr,
util::AllocationRecord current_allocation,
util::AllocationRecord new_allocation,
std::size_t  new_size 
)
virtual

Transform length bytes of memory from src_ptr to dst_ptr.

This operation relies on ResourceManager::copy, AllocationStrategy::allocate and AllocationStrategy::deallocate to implement a reallocate operation that can work for any current_ptr location.

Parameters
src_ptrPointer to source memory location.
dst_ptrPointer to destinatino memory location.
src_allocationAllocationRecord of source.
dst_allocationAllocationRecord of destination.
lengthNumber of bytes to transform.
Exceptions
util::runtime_error

Reimplemented from umpire::op::MemoryOperation.

References umpire::ResourceManager::copy(), umpire::ResourceManager::getInstance(), umpire::util::AllocationRecord::size, and umpire::util::AllocationRecord::strategy.

◆ transform_async()

camp::resources::EventProxy< camp::resources::Resource > umpire::op::GenericReallocateOperation::transform_async ( void *  current_ptr,
void **  new_ptr,
util::AllocationRecord current_allocation,
util::AllocationRecord new_allocation,
std::size_t  new_size,
camp::resources::Resource ctx 
)
virtual

◆ apply()

void umpire::op::MemoryOperation::apply ( void *  src_ptr,
util::AllocationRecord src_allocation,
int  val,
std::size_t  length 
)
virtualinherited

Apply val to the first length bytes of src_ptr.

Parameters
src_ptrPointer to source memory location.
src_allocationAllocationRecord of source.
valValue to apply.
lengthNumber of bytes to modify.
Exceptions
util::runtime_error

Reimplemented in umpire::op::HipAdviseOperation, umpire::op::CudaAdviseOperation, umpire::op::SyclMemsetOperation, umpire::op::HipMemsetOperation, umpire::op::CudaMemsetOperation, umpire::op::HostMemsetOperation, umpire::op::SyclMemPrefetchOperation, umpire::op::OpenMPTargetMemsetOperation, and umpire::op::CudaMemPrefetchOperation.

References UMPIRE_ERROR.

Referenced by umpire::op::MemoryOperation::apply_async().

◆ apply_async()

camp::resources::EventProxy< camp::resources::Resource > umpire::op::MemoryOperation::apply_async ( void *  src_ptr,
util::AllocationRecord src_allocation,
int  val,
std::size_t  length,
camp::resources::Resource ctx 
)
virtualinherited