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... | |
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.
SLMAmount | The amount allocated in bytes |
Definition at line 3923 of file memory.hpp.
|
inline |
Allocates the amount of SLM which is class' template parameter.
Definition at line 3928 of file memory.hpp.
|
inline |
Releases the SLM chunk allocated in the constructor.
Definition at line 3934 of file memory.hpp.
|
inline |
Definition at line 3931 of file memory.hpp.