Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kAlloc_Copy ( kAlloc  destAlloc,
void *  dest,
kAlloc  srcAlloc,
const void *  src,
kSize  size,
kObject  context = kNULL 
)
protected

Copies memory allocated by one allocator to memory allocated with a different allocator.

Normally, copy operations can be supported by directly copying buffers with the host CPU (e.g., kMemCopy). The kAlloc_Copy method additionally supports copy operations involving non-host memory domains (e.g. Cuda device memory). Note, direct copy operations between two distinct foreign memory domains are not supported; if required, these kinds of copy operations must be performed in two steps, using a temporary host memory buffer in between.

Parameters
destAllocAllocator associated with destination memory.
destDestination for the memory copy.
srcAllocAllocator associated with source memory.
srcSource for the memory copy.
sizeSize of memory block to be copied, in bytes.
contextContext for copy operation (allocator specific; may be required by some foreign domain allocators).
Returns
Operation status.