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

Base class of an operation on memory. More...

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

Inheritance diagram for umpire::op::MemoryOperation:

Public Member Functions

virtual ~MemoryOperation ()=default
 
virtual void transform (void *src_ptr, void **dst_ptr, util::AllocationRecord *src_allocation, util::AllocationRecord *dst_allocation, std::size_t length)
 Transform length bytes of memory from src_ptr to dst_ptr. More...
 
virtual camp::resources::EventProxy< camp::resources::Resourcetransform_async (void *src_ptr, void **dst_ptr, util::AllocationRecord *src_allocation, util::AllocationRecord *dst_allocation, std::size_t length, 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

Base class of an operation on memory.

Neither the transform or apply methods are pure virtual, so inheriting classes only need overload the appropriate method. However, both methods will throw an error if called.

Constructor & Destructor Documentation

◆ ~MemoryOperation()

virtual umpire::op::MemoryOperation::~MemoryOperation ( )
virtualdefault

Member Function Documentation

◆ transform()

void umpire::op::MemoryOperation::transform ( void *  src_ptr,
void **  dst_ptr,
util::AllocationRecord src_allocation,
util::AllocationRecord dst_allocation,
std::size_t  length 
)
virtual

Transform length bytes of memory from src_ptr to dst_ptr.

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 in umpire::op::SyclCopyToOperation, umpire::op::SyclCopyFromOperation, umpire::op::SyclCopyOperation, umpire::op::OpenMPTargetCopyOperation, umpire::op::NumaMoveOperation, umpire::op::HostCopyOperation, umpire::op::HipCopyOperation, umpire::op::CudaCopyOperation, umpire::op::HostReallocateOperation, and umpire::op::GenericReallocateOperation.

References UMPIRE_ERROR.

Referenced by transform_async().

◆ transform_async()

camp::resources::EventProxy< camp::resources::Resource > umpire::op::MemoryOperation::transform_async ( void *  src_ptr,
void **  dst_ptr,
util::AllocationRecord src_allocation,
util::AllocationRecord dst_allocation,
std::size_t  length,
camp::resources::Resource ctx 
)
virtual

◆ apply()

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

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 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 
)
virtual