DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::sycl::usm_allocator< T, AllocKind, Alignment > Class Template Reference

#include <CL/sycl/usm/usm_allocator.hpp>

Classes

struct  rebind
 

Public Types

using value_type = 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=delete
 
 usm_allocator (const context &Ctxt, const device &Dev, const property_list &PropList={}) noexcept
 
 usm_allocator (const queue &Q, const property_list &PropList={}) noexcept
 
 usm_allocator (const usm_allocator &) noexcept=default
 
 usm_allocator (usm_allocator &&) noexcept=default
 
usm_allocatoroperator= (const usm_allocator &Other)
 
usm_allocatoroperator= (usm_allocator &&Other)
 
template<class U >
 usm_allocator (const usm_allocator< U, AllocKind, Alignment > &Other) noexcept
 
Tallocate (size_t NumberOfElements, const detail::code_location CodeLoc=detail::code_location::current())
 Allocates memory. More...
 
void deallocate (T *Ptr, size_t, const detail::code_location CodeLoc=detail::code_location::current())
 Deallocates memory. More...
 

Friends

template<class U , usm::alloc AllocKindU, size_t AlignmentU>
class usm_allocator
 
template<class U , usm::alloc AllocKindU, size_t AlignmentU>
bool operator== (const usm_allocator< T, AllocKind, Alignment > &One, const usm_allocator< U, AllocKindU, AlignmentU > &Two)
 
template<class U , usm::alloc AllocKindU, size_t AlignmentU>
bool operator!= (const usm_allocator< T, AllocKind, Alignment > &One, const usm_allocator< U, AllocKindU, AlignmentU > &Two)
 

Detailed Description

template<typename T, usm::alloc AllocKind, size_t Alignment = alignof(T)>
class cl::sycl::usm_allocator< T, AllocKind, Alignment >

Definition at line 34 of file usm_allocator.hpp.

Member Typedef Documentation

◆ propagate_on_container_copy_assignment

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
using cl::sycl::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_copy_assignment = std::true_type

Definition at line 37 of file usm_allocator.hpp.

◆ propagate_on_container_move_assignment

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
using cl::sycl::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_move_assignment = std::true_type

Definition at line 38 of file usm_allocator.hpp.

◆ propagate_on_container_swap

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
using cl::sycl::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_swap = std::true_type

Definition at line 39 of file usm_allocator.hpp.

◆ value_type

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
using cl::sycl::usm_allocator< T, AllocKind, Alignment >::value_type = T

Definition at line 36 of file usm_allocator.hpp.

Constructor & Destructor Documentation

◆ usm_allocator() [1/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
cl::sycl::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( )
deletenoexcept

◆ usm_allocator() [2/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
cl::sycl::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( const context Ctxt,
const device Dev,
const property_list PropList = {} 
)
inlinenoexcept

Definition at line 51 of file usm_allocator.hpp.

◆ usm_allocator() [3/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
cl::sycl::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( const queue Q,
const property_list PropList = {} 
)
inlinenoexcept

Definition at line 54 of file usm_allocator.hpp.

◆ usm_allocator() [4/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
cl::sycl::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( const usm_allocator< T, AllocKind, Alignment > &  )
defaultnoexcept

◆ usm_allocator() [5/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
cl::sycl::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( usm_allocator< T, AllocKind, Alignment > &&  )
defaultnoexcept

◆ usm_allocator() [6/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
template<class U >
cl::sycl::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( const usm_allocator< U, AllocKind, Alignment > &  Other)
inlinenoexcept

Definition at line 73 of file usm_allocator.hpp.

Member Function Documentation

◆ allocate()

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
T* cl::sycl::usm_allocator< T, AllocKind, Alignment >::allocate ( size_t  NumberOfElements,
const detail::code_location  CodeLoc = detail::code_location::current() 
)
inline

Allocates memory.

Parameters
NumberOfElementsis a count of elements to allocate memory for.

Definition at line 80 of file usm_allocator.hpp.

References cl::sycl::aligned_alloc().

◆ deallocate()

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
void cl::sycl::usm_allocator< T, AllocKind, Alignment >::deallocate ( T Ptr,
size_t  ,
const detail::code_location  CodeLoc = detail::code_location::current() 
)
inline

Deallocates memory.

Parameters
Ptris a pointer to memory being deallocated.
Sizeis a number of elements previously passed to allocate.

Definition at line 96 of file usm_allocator.hpp.

References cl::sycl::free().

◆ operator=() [1/2]

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
usm_allocator& cl::sycl::usm_allocator< T, AllocKind, Alignment >::operator= ( const usm_allocator< T, AllocKind, Alignment > &  Other)
inline

Definition at line 59 of file usm_allocator.hpp.

◆ operator=() [2/2]

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
usm_allocator& cl::sycl::usm_allocator< T, AllocKind, Alignment >::operator= ( usm_allocator< T, AllocKind, Alignment > &&  Other)
inline

Definition at line 65 of file usm_allocator.hpp.

Friends And Related Function Documentation

◆ operator!=

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
template<class U , usm::alloc AllocKindU, size_t AlignmentU>
bool operator!= ( const usm_allocator< T, AllocKind, Alignment > &  One,
const usm_allocator< U, AllocKindU, AlignmentU > &  Two 
)
friend

Definition at line 112 of file usm_allocator.hpp.

◆ operator==

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
template<class U , usm::alloc AllocKindU, size_t AlignmentU>
bool operator== ( const usm_allocator< T, AllocKind, Alignment > &  One,
const usm_allocator< U, AllocKindU, AlignmentU > &  Two 
)
friend

Definition at line 105 of file usm_allocator.hpp.

◆ usm_allocator

template<typename T , usm::alloc AllocKind, size_t Alignment = alignof(T)>
template<class U , usm::alloc AllocKindU, size_t AlignmentU>
friend class usm_allocator
friend

Definition at line 122 of file usm_allocator.hpp.


The documentation for this class was generated from the following file: