Define utility routines for SYCL.
- Author
- Andrey Alekseenko al42a.nosp@m.nd@g.nosp@m.mail..nosp@m.com
|
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...
|
|
void pfree |
( |
void * |
h_ptr | ) |
|
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 |
|
) |
| |
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_ptr | Pointer where to store the address of the newly allocated buffer. |
[in] | nbytes | Size in bytes of the buffer to be allocated. |