DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::ext::intel::esimd::slm_allocator< SLMAmount > Class Template Reference

RAII-style class used to implement "semi-dynamic" SLM allocation. More...

#include <sycl/ext/intel/experimental/esimd/memory.hpp>

Public Member Functions

 slm_allocator ()
 Allocates the amount of SLM which is class' template parameter. More...
 
ESIMD_INLINE int get_offset () const
 
 ~slm_allocator ()
 Releases the SLM chunk allocated in the constructor. More...
 

Detailed Description

template<int SLMAmount>
class sycl::_V1::ext::intel::esimd::slm_allocator< SLMAmount >

RAII-style class used to implement "semi-dynamic" SLM allocation.

SLM is allocated in the constructor and released in the destructor, that's why it is "dynamic", as opposed to fully static allocation style of 'slm_init'. Actual offset of SLM chunk allocated by the call is calculated at compile time, that's why it is "semi-". To calculate SLM usage by a kernel, compiler finds a path in a callgraph with the largest amount of SLM "locked" by slm_allocator objects live along the paths. slm_init call also participates in calculating SLM budget. It can be modelled as slm_allocator object declared at the very beginning of a kernel and live till its the very end. Only compile-time constant SLM amount is supported for now, it is provided as a class' template argument.

Since a call graph is used, function pointers and recursion is not supported.

Template Parameters
SLMAmountThe amount allocated in bytes

Definition at line 2929 of file memory.hpp.

Constructor & Destructor Documentation

◆ slm_allocator()

template<int SLMAmount>
sycl::_V1::ext::intel::esimd::slm_allocator< SLMAmount >::slm_allocator ( )
inline

Allocates the amount of SLM which is class' template parameter.

Definition at line 2934 of file memory.hpp.

◆ ~slm_allocator()

template<int SLMAmount>
sycl::_V1::ext::intel::esimd::slm_allocator< SLMAmount >::~slm_allocator ( )
inline

Releases the SLM chunk allocated in the constructor.

Definition at line 2940 of file memory.hpp.

Member Function Documentation

◆ get_offset()

template<int SLMAmount>
ESIMD_INLINE int sycl::_V1::ext::intel::esimd::slm_allocator< SLMAmount >::get_offset ( ) const
inline
Returns
The allocated chunk's offset in bytes.

Definition at line 2937 of file memory.hpp.


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