Gromacs  2026.0-dev-20241204-d69d709
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pmalloc_hip.cpp File Reference
#include "gmxpre.h"
#include <cstdlib>
#include "gromacs/gpu_utils/hiputils.h"
#include "gromacs/utility/cstringutil.h"
#include "pmalloc.h"
+ Include dependency graph for pmalloc_hip.cpp:

Description

Define functions for host-side memory handling when using AMD with HIP devices.

Author
Paul Bauerl paul..nosp@m.baue.nosp@m.r.q@g.nosp@m.mail.nosp@m..com

Functions

void pmalloc (void **h_ptr, size_t nbytes, const DeviceContext *)
 
void pfree (void *h_ptr, const DeviceContext *)
 
void pmallocSetDefaultDeviceContext (const DeviceContext *)
 
void pmallocClearDefaultDeviceContext ()
 

Function Documentation

void pfree ( void *  h_ptr,
const DeviceContext *   
)

Frees page locked memory allocated with pmalloc. This function can safely be called also with a pointer to a page-locked memory allocated directly with HIP API calls.

void pmalloc ( void **  h_ptr,
size_t  nbytes,
const DeviceContext *   
)

Allocates nbytes of page-locked memory. This memory should always be freed using pfree (or with the page-locked free functions provied by the HIP library).