MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
ScratchSpaceBase Class Referenceabstract

This class is a base class for all ScratchSpaces. More...

#include <scratch.h>

Inheritance diagram for ScratchSpaceBase:
[legend]
Collaboration diagram for ScratchSpaceBase:
[legend]

Public Member Functions

 ScratchSpaceBase (size_t num, size_t size, MString name, MString varname)
 Constructor. More...
 
virtual MString printSelfReport () const =0
 
virtual MString printSelf () const =0
 

Public Attributes

const size_t m_memsize
 
const size_t m_memsizePadded
 
const MString m_calling_function
 
const MString m_variable_name
 
MInt m_object_id {}
 
MBool m_nonterminal
 
MBool m_destroy
 

Static Public Attributes

static const uintptr_t ALIGNMENT_BOUNDARY = MAIA_SCRATCH_ALIGNMENT_BOUNDARY
 

Detailed Description

Author
Andreas Lintermann, Christoph Siewert
Date
10.05.2011, 21.10.2011

This class is the base of all derived scratch space elements.

Definition at line 182 of file scratch.h.

Constructor & Destructor Documentation

◆ ScratchSpaceBase()

ScratchSpaceBase::ScratchSpaceBase ( size_t  num,
size_t  size,
MString  name,
MString  varname 
)
inline
Author
Andreas Lintermann, Christoph Siewert
Date
10.05.2011, 21.10.2011
Note
Each ScratchSpace now points to an aligned memory address, Lennart Schneiders, 12.12.2012

Sets the scratch space elements properties.

Parameters
[num]num number of elements in array
[size]size the size of the array in bytes
[name]name the name of the calling function
[varname]varname the name of the array variable

Definition at line 208 of file scratch.h.

209 : m_memsize(num * size),
210 m_memsizePadded((num * size) + ((ALIGNMENT_BOUNDARY - ((num * size) % ALIGNMENT_BOUNDARY)) % ALIGNMENT_BOUNDARY)),
211 m_calling_function(std::move(name)),
212 m_variable_name(std::move(varname)),
213 m_nonterminal(false),
214 m_destroy(false) {
215 ASSERT((((uintptr_t)Scratch::m_nextfree) % ALIGNMENT_BOUNDARY == 0), "Scratch memory is not aligned");
216 }
static char * m_nextfree
Definition: scratch.h:168
MBool m_nonterminal
Definition: scratch.h:191
const MString m_variable_name
Definition: scratch.h:189
MBool m_destroy
Definition: scratch.h:192
const MString m_calling_function
Definition: scratch.h:188
static const uintptr_t ALIGNMENT_BOUNDARY
Definition: scratch.h:184
const size_t m_memsizePadded
Definition: scratch.h:187
const size_t m_memsize
Definition: scratch.h:186

Member Function Documentation

◆ printSelf()

virtual MString ScratchSpaceBase::printSelf ( ) const
pure virtual

Implemented in ScratchSpace< T >.

◆ printSelfReport()

virtual MString ScratchSpaceBase::printSelfReport ( ) const
pure virtual

Implemented in ScratchSpace< T >.

Member Data Documentation

◆ ALIGNMENT_BOUNDARY

const uintptr_t ScratchSpaceBase::ALIGNMENT_BOUNDARY = MAIA_SCRATCH_ALIGNMENT_BOUNDARY
static

Definition at line 184 of file scratch.h.

◆ m_calling_function

const MString ScratchSpaceBase::m_calling_function

Definition at line 188 of file scratch.h.

◆ m_destroy

MBool ScratchSpaceBase::m_destroy

Definition at line 192 of file scratch.h.

◆ m_memsize

const size_t ScratchSpaceBase::m_memsize

Definition at line 186 of file scratch.h.

◆ m_memsizePadded

const size_t ScratchSpaceBase::m_memsizePadded

Definition at line 187 of file scratch.h.

◆ m_nonterminal

MBool ScratchSpaceBase::m_nonterminal

Definition at line 191 of file scratch.h.

◆ m_object_id

MInt ScratchSpaceBase::m_object_id {}

Definition at line 190 of file scratch.h.

◆ m_variable_name

const MString ScratchSpaceBase::m_variable_name

Definition at line 189 of file scratch.h.


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