SENSEI
A frame work for generic in situ analytics
MemoryUtils.h File Reference
#include "senseiConfig.h"
#include <memory>
Include dependency graph for MemoryUtils.h:

Go to the source code of this file.

Namespaces

 sensei
 SENSEI.
 
 sensei::MemoryUtils
 Functions for dealing with memory access across heterogeneous architectures.
 

Functions

int sensei::MemoryUtils::CudaAccessible (const void *ptr)
 return true if the pointer is accessible by code running on a CUDA GPU More...
 
int sensei::MemoryUtils::HostAccessible (const void *ptr)
 return true if the pointer is accessible by code running on the CPU More...
 
void sensei::MemoryUtils::FreeCudaPtr (void *ptr)
 callback that can free memory managed by CUDA More...
 
void sensei::MemoryUtils::FreeHostPtr (void *ptr)
 callback that can free memory managed by malloc More...
 
void sensei::MemoryUtils::DontFreePtr (void *ptr)
 A callback that does not free the pointer. More...
 
MakedCudaAccessible

returns a pointer to data that is accessible from CUDA kernels.

If the data is already accessible, this call is a noop. On the other hand if the data is not accessible it will be moved. The accessible data is returned as a shared pointer so that in the case data needed to be moved, the buffers on the GPU will automatically be released.

std::shared_ptr< void > sensei::MemoryUtils::MakeCudaAccessible_ (void *ptr, size_t nBytes)
 
template<typename data_t >
std::shared_ptr< data_t > sensei::MemoryUtils::MakeCudaAccessible (data_t *ptr, size_t nVals)
 
MakeHostAccessible

returns a pointer to data that is accessible from CPU codes.

If the data is already accessible, this call is a noop. On the other hand if the data is not accessible it will be moved. The accessible data is returned as a shared pointer so that in the case data needed to be moved, the buffers on the CPU will automatically be released.

std::shared_ptr< void > sensei::MemoryUtils::MakeHostAccessible_ (void *ptr, size_t nBytes)
 
template<typename data_t >
std::shared_ptr< data_t > sensei::MemoryUtils::MakeHostAccessible (data_t *ptr, size_t nVals)