cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment > Class Template Reference
USM allocator. More...
#include <usm.h>
Inheritance diagram for cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >:
Classes | |
struct | rebind |
Allows allocator rebinding. More... | |
Public Types | |
using | value_type = T |
using | instead = T * |
using | instead = const T * |
using | instead = T & |
using | instead = const T & |
using | propagate_on_container_copy_assignment = std::true_type |
using | propagate_on_container_move_assignment = std::true_type |
using | propagate_on_container_swap = std::true_type |
Public Member Functions | |
usm_allocator () noexcept | |
Constructs an allocator using default selected device and context. More... | |
usm_allocator (const usm_allocator &) noexcept=default | |
Copy constructor. More... | |
template<class U > | |
usm_allocator (const usm_allocator< U, AllocKind, Alignment > ©) noexcept | |
Copy constructor from an allocator of different type. More... | |
usm_allocator (const context &ctx, const device &dev) noexcept | |
Constructs an allocator that will allocate memory on the provided device within the context. More... | |
usm_allocator (const queue &q) noexcept | |
Constructs an allocator that will allocate memory on the device associated with the queue. More... | |
value_type * | allocate (size_t count) |
Performs a USM allocation. More... | |
void | deallocate (value_type *ptr, size_t count) |
Frees USM allocated memory. More... | |
Detailed Description
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
class cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >
USM allocator.
- Template Parameters
-
T Underlying data type AllocKind What kind of allocations to perform Alignment Allocation alignment
Member Typedef Documentation
◆ instead [1/4]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
using cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >::instead = T* |
◆ instead [2/4]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
using cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >::instead = const T* |
◆ instead [3/4]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
using cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >::instead = T& |
◆ instead [4/4]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
using cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >::instead = const T& |
◆ propagate_on_container_copy_assignment
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
using cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_copy_assignment = std::true_type |
◆ propagate_on_container_move_assignment
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
using cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_move_assignment = std::true_type |
◆ propagate_on_container_swap
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
using cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_swap = std::true_type |
◆ value_type
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
using cl::sycl::experimental::usm_allocator< T, AllocKind, Alignment >::value_type = T |
Constructor & Destructor Documentation
◆ usm_allocator() [1/5]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
|
inlinenoexcept |
◆ usm_allocator() [2/5]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
|
defaultnoexcept |
Copy constructor.
◆ usm_allocator() [3/5]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
template<class U >
|
inlinenoexcept |
◆ usm_allocator() [4/5]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
|
inlinenoexcept |
◆ usm_allocator() [5/5]
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
|
inlinenoexcept |
Member Function Documentation
◆ allocate()
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
|
inline |
◆ deallocate()
template<typename T, usm::alloc AllocKind, size_t Alignment = 0>
|
inline |
The documentation for this class was generated from the following file: