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

#include <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 ()=delete
 
 usm_allocator (const context &Ctxt, const device &Dev, const property_list &PropList={})
 
 usm_allocator (const queue &Q, const property_list &PropList={})
 
 usm_allocator (const usm_allocator &)=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
 
T * allocate (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...
 
template<typename Property >
bool has_property () const noexcept
 
template<typename Property >
Property get_property () const
 

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 = 0>
class sycl::_V1::usm_allocator< T, AllocKind, Alignment >

Definition at line 25 of file usm_allocator.hpp.

Member Typedef Documentation

◆ propagate_on_container_copy_assignment

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
using sycl::_V1::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_copy_assignment = std::true_type

Definition at line 28 of file usm_allocator.hpp.

◆ propagate_on_container_move_assignment

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
using sycl::_V1::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_move_assignment = std::true_type

Definition at line 29 of file usm_allocator.hpp.

◆ propagate_on_container_swap

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
using sycl::_V1::usm_allocator< T, AllocKind, Alignment >::propagate_on_container_swap = std::true_type

Definition at line 30 of file usm_allocator.hpp.

◆ value_type

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
using sycl::_V1::usm_allocator< T, AllocKind, Alignment >::value_type = T

Definition at line 27 of file usm_allocator.hpp.

Constructor & Destructor Documentation

◆ usm_allocator() [1/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
sycl::_V1::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( )
delete

◆ usm_allocator() [2/6]

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

Definition at line 42 of file usm_allocator.hpp.

◆ usm_allocator() [3/6]

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

Definition at line 45 of file usm_allocator.hpp.

◆ usm_allocator() [4/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
sycl::_V1::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( const usm_allocator< T, AllocKind, Alignment > &  )
default

◆ usm_allocator() [5/6]

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
sycl::_V1::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 = 0>
template<class U >
sycl::_V1::usm_allocator< T, AllocKind, Alignment >::usm_allocator ( const usm_allocator< U, AllocKind, Alignment > &  Other)
inlinenoexcept

Definition at line 64 of file usm_allocator.hpp.

Member Function Documentation

◆ allocate()

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
T* sycl::_V1::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 71 of file usm_allocator.hpp.

References sycl::_V1::aligned_alloc().

◆ deallocate()

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
void sycl::_V1::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 90 of file usm_allocator.hpp.

References sycl::_V1::free().

◆ get_property()

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
template<typename Property >
Property sycl::_V1::usm_allocator< T, AllocKind, Alignment >::get_property ( ) const
inline

Definition at line 116 of file usm_allocator.hpp.

References sycl::_V1::property_list::get_property().

◆ has_property()

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
template<typename Property >
bool sycl::_V1::usm_allocator< T, AllocKind, Alignment >::has_property ( ) const
inlinenoexcept

Definition at line 112 of file usm_allocator.hpp.

References sycl::_V1::property_list::has_property().

◆ operator=() [1/2]

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

Definition at line 50 of file usm_allocator.hpp.

◆ operator=() [2/2]

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

Definition at line 56 of file usm_allocator.hpp.

Friends And Related Function Documentation

◆ operator!=

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
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 106 of file usm_allocator.hpp.

◆ operator==

template<typename T , usm::alloc AllocKind, size_t Alignment = 0>
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 99 of file usm_allocator.hpp.

◆ usm_allocator

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

Definition at line 124 of file usm_allocator.hpp.


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