Gromacs  2022.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pmalloc_ocl.cpp File Reference
#include "gmxpre.h"
#include "pmalloc.h"
#include "gromacs/utility/smalloc.h"
+ Include dependency graph for pmalloc_ocl.cpp:

Description

Define functions for host-side memory handling when using OpenCL devices.

Author
Anca Hamuraru anca@.nosp@m.stre.nosp@m.amcom.nosp@m.puti.nosp@m.ng.eu

Functions

void pmalloc (void **h_ptr, size_t nbytes)
 Allocates nbytes of host memory. Use pfree to free memory allocated with this function. More...
 
void pfree (void *h_ptr)
 Frees memory allocated with pmalloc. More...
 

Function Documentation

void pfree ( void *  h_ptr)

Frees memory allocated with pmalloc.

Parameters
[in]h_ptrBuffer allocated with pmalloc that needs to be freed.
void pmalloc ( void **  h_ptr,
size_t  nbytes 
)

Allocates nbytes of host memory. Use pfree to free memory allocated with this function.

Todo:
This function should allocate page-locked memory to help reduce D2H and H2D transfer times, similar with pmalloc from pmalloc.cu.
Parameters
[in,out]h_ptrPointer where to store the address of the newly allocated buffer.
[in]nbytesSize in bytes of the buffer to be allocated.