fupermod: Functional Performance Models of heterogeneous processors

Wrappers for memory management

Enumerations

enum  fupermod_mem_mode {
  FUPERMOD_MEM_DEFAULT = -0x01, FUPERMOD_MEM_PAGELOCKED = 0x00, FUPERMOD_MEM_PORTABLE = 0x01, FUPERMOD_MEM_MAPPED = 0x02,
  FUPERMOD_MEM_WRITECOMBINED = 0x04
}

Functions

void * fupermod_malloc (size_t size, fupermod_process_conf *conf)
void fupermod_free (void *ptr, fupermod_process_conf *conf)

Detailed Description

API to handle data that can be allocated either in main or in GPU memory: for example, blocks of matrices in hybrid (CPU/GPU) matrix multiplication.


Enumeration Type Documentation

Memory allocation modes, including C standard malloc and CUDA memory allocation. CUDA flags can be combined with "|"

Enumerator:
FUPERMOD_MEM_DEFAULT 

C standard malloc

FUPERMOD_MEM_PAGELOCKED 

Cuda memory allocation, allocate host memory as page-locked

FUPERMOD_MEM_PORTABLE 

Cuda memory allocation, allocate host memory as page-locked by all CUDA contexts, not just the one that performed the allocation

FUPERMOD_MEM_MAPPED 

Cuda memory allocation, maps the allocation into the CUDA address space

FUPERMOD_MEM_WRITECOMBINED 

Cuda memory allocation, allocate host memory as write-combined, WC memory can be transferred quickly on PCI but cannot be read efficiently by most CPU


Function Documentation

void* fupermod_malloc ( size_t  size,
fupermod_process_conf conf 
)

Allocate a block of size bytes of memory. If NULL is returned, then there is something wrong

Parameters:
size size of memory to be allocated
conf process configuration
Returns:
a pointer to the beginning of the memory block
void fupermod_free ( void *  ptr,
fupermod_process_conf conf 
)

Free memory

Parameters:
ptr the beginning of the memory block to be freed
conf process configuration