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

Description

Define utility routines for SYCL.

Author
Andrey Alekseenko al42a.nosp@m.nd@g.nosp@m.mail..nosp@m.com

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 was copied from OpenCL implementation, not tuned for SYCL at all. Once SYCL2020 is out, might be worthwhile to look into USM and sycl::malloc_host / sycl::aligned_alloc_host. Overall, it is better to directly use sycl::buffer instead of pinned arrays. But this function is needed to compile some PME code with SYCL enabled, even if it is never used.
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.