cl::sycl::ext::codeplay Namespace Reference
Functions | |
template<typename T > | |
sycl::buffer< T > | get_buffer (T *usmPointer, sycl::context &ctx) |
Get the buffer associated with a USM pointer. More... | |
Function Documentation
◆ get_buffer()
template<typename T >
sycl::buffer<T> cl::sycl::ext::codeplay::get_buffer | ( | T * | usmPointer, |
sycl::context & | ctx | ||
) |
Get the buffer associated with a USM pointer.
If there is not yet an associated buffer, create one.
- Template Parameters
-
The element type of the USM pointer and resulting buffer.
- Parameters
-
usmPointer A USM pointer. ctx The context the pointer is associated with.
- Note
- The current implementation is a prototype. The USM allocation must be allocated using make_shared such that it is accessible by the host. To ensure the USM allocation is up-to-date, use queue::update_host(...).