Define functions for host-side memory handling when using OpenCL devices or no GPU device.
- Author
- Anca Hamuraru anca@.nosp@m.stre.nosp@m.amcom.nosp@m.puti.nosp@m.ng.eu
|
void | pmalloc (void **h_ptr, size_t nbytes, const DeviceContext *) |
| Allocates nbytes of host memory. Use pfree to free memory allocated with this function. More...
|
|
void | pfree (void *h_ptr, const DeviceContext *) |
| Frees memory allocated with pmalloc. More...
|
|
void | pmallocSetDefaultDeviceContext (const DeviceContext *) |
|
void | pmallocClearDefaultDeviceContext () |
|
void pfree |
( |
void * |
h_ptr, |
|
|
const DeviceContext * |
|
|
) |
| |
Frees memory allocated with pmalloc.
- Parameters
-
[in] | h_ptr | Buffer allocated with pmalloc that needs to be freed. |
void pmalloc |
( |
void ** |
h_ptr, |
|
|
size_t |
nbytes, |
|
|
const DeviceContext * |
|
|
) |
| |
Allocates nbytes of host memory. Use pfree to free memory allocated with this function.
This function is a stub for CPU-only and OpenCL builds. CUDA, HIP, and SYCL have special implementations in separate files.
- Parameters
-
[in,out] | h_ptr | Pointer where to store the address of the newly allocated buffer. |
[in] | nbytes | Size in bytes of the buffer to be allocated. |