sycl::malloc_host
void* sycl::malloc_host(size_t num_bytes, const sycl::context& ctxt);
template <typename T> T* sycl::malloc_host(size_t count, const sycl::context& ctxt);
size_t num_bytes |
Number of bytes to allocate |
size_t count |
Number of elements of type T to allocate |
const sycl::context& ctxt |
The SYCL context that contains the devices that will access the host allocation |
Returns a pointer to the newly allocated host memory on success. Memory allocated by sycl::malloc_host must be deallocated with sycl::free in order to avoid memory leaks.
Returns nullptr on failure.