gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::MatStore< X, Y > Class Template Reference

Backing store for matrices. More...

#include <matrix.hh>

Public Types

using Container = std::array<uint8_t, LINEAR_SIZE>
 
using MyClass = MatStore<X, Y>
 

Public Member Functions

 MatStore ()
 Constructor.
 
 MatStore (const MatStore &)=default
 
void zero ()
 
template<size_t X2, size_t Y2>
bool operator== (const MatStore< X2, Y2 > &that) const
 Equality operator.
 
template<size_t X2, size_t Y2>
bool operator!= (const MatStore< X2, Y2 > &that) const
 Inequality operator.
 
template<typename ElemType >
auto asTile (size_t index)
 
template<typename ElemType >
auto asHSlice (size_t row_idx)
 
template<typename ElemType >
auto asVSlice (size_t col_idx)
 
MyClassoperator= (const MyClass &that)
 Assignment operators.
 

Static Public Member Functions

static constexpr size_t xSize ()
 
static constexpr size_t ySize ()
 
static constexpr size_t linearSize ()
 

Public Attributes

friend ParseParam< MatStore< X, Y > >
 Used for serialization/unserialisation.
 
friend ShowParam< MatStore< X, Y > >
 

Private Member Functions

template<typename ElemType >
const ElemType * rawPtr () const
 Get pointer to the raw data.
 
template<typename ElemType >
ElemType * rawPtr ()
 

Private Attributes

Container container
 

Static Private Attributes

static constexpr size_t LINEAR_SIZE = X * Y
 

Friends

template<typename , typename , bool >
class HorizontalSlice
 
template<typename , typename , bool >
class VerticalSlice
 
std::ostream & operator<< (std::ostream &os, const MatStore< X, Y > &v)
 

Detailed Description

template<size_t X, size_t Y>
class gem5::MatStore< X, Y >

Backing store for matrices.

This class provides the backing store for matricies, and is largely a wrapper around an std::array of bytes. This class provides some basic interfaces for assignment (copy the backing store) and comparison, and provides the interface for generating views onto the backing store. It is these views that are intended to be used by the end-user of the matrix in most cases.

This class is also responsible for handling the serialisation/unserialisation of matrix registers (see ShowParam and ParseParam).

Template Parameters
XX size in bytes (number of columns).
YY size in bytes (number of rows).

Definition at line 380 of file matrix.hh.

Member Typedef Documentation

◆ Container

template<size_t X, size_t Y>
using gem5::MatStore< X, Y >::Container = std::array<uint8_t, LINEAR_SIZE>

Definition at line 395 of file matrix.hh.

◆ MyClass

template<size_t X, size_t Y>
using gem5::MatStore< X, Y >::MyClass = MatStore<X, Y>

Definition at line 396 of file matrix.hh.

Constructor & Destructor Documentation

◆ MatStore() [1/2]

template<size_t X, size_t Y>
gem5::MatStore< X, Y >::MatStore ( )
inline

Constructor.

Definition at line 403 of file matrix.hh.

◆ MatStore() [2/2]

template<size_t X, size_t Y>
gem5::MatStore< X, Y >::MatStore ( const MatStore< X, Y > & )
default

Member Function Documentation

◆ asHSlice()

template<size_t X, size_t Y>
template<typename ElemType >
auto gem5::MatStore< X, Y >::asHSlice ( size_t row_idx)
inline

Definition at line 468 of file matrix.hh.

References gem5::MatStore< X, Y >::HorizontalSlice.

Referenced by TEST().

◆ asTile()

template<size_t X, size_t Y>
template<typename ElemType >
auto gem5::MatStore< X, Y >::asTile ( size_t index)
inline

Definition at line 461 of file matrix.hh.

References gem5::MipsISA::index.

Referenced by TwoDifferentMatRegs::SetUp(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ asVSlice()

template<size_t X, size_t Y>
template<typename ElemType >
auto gem5::MatStore< X, Y >::asVSlice ( size_t col_idx)
inline

Definition at line 475 of file matrix.hh.

References gem5::MatStore< X, Y >::VerticalSlice.

Referenced by TEST().

◆ linearSize()

template<size_t X, size_t Y>
static constexpr size_t gem5::MatStore< X, Y >::linearSize ( )
inlinestaticconstexpr

Definition at line 393 of file matrix.hh.

References gem5::MatStore< X, Y >::LINEAR_SIZE.

Referenced by TEST().

◆ operator!=()

template<size_t X, size_t Y>
template<size_t X2, size_t Y2>
bool gem5::MatStore< X, Y >::operator!= ( const MatStore< X2, Y2 > & that) const
inline

Inequality operator.

Required to compare thread contexts.

Definition at line 442 of file matrix.hh.

References gem5::MatStore< X, Y >::operator==().

◆ operator=()

template<size_t X, size_t Y>
MyClass & gem5::MatStore< X, Y >::operator= ( const MyClass & that)
inline

Assignment operators.

From MatStore

Definition at line 417 of file matrix.hh.

References gem5::MatStore< X, Y >::container, and gem5::MatStore< X, Y >::LINEAR_SIZE.

◆ operator==()

template<size_t X, size_t Y>
template<size_t X2, size_t Y2>
bool gem5::MatStore< X, Y >::operator== ( const MatStore< X2, Y2 > & that) const
inline

Equality operator.

Required to compare thread contexts.

Definition at line 431 of file matrix.hh.

References gem5::MatStore< X, Y >::container, and gem5::MatStore< X, Y >::LINEAR_SIZE.

Referenced by gem5::MatStore< X, Y >::operator!=().

◆ rawPtr() [1/2]

template<size_t X, size_t Y>
template<typename ElemType >
ElemType * gem5::MatStore< X, Y >::rawPtr ( )
inlineprivate

Definition at line 456 of file matrix.hh.

References gem5::MatStore< X, Y >::container.

◆ rawPtr() [2/2]

template<size_t X, size_t Y>
template<typename ElemType >
const ElemType * gem5::MatStore< X, Y >::rawPtr ( ) const
inlineprivate

Get pointer to the raw data.

Definition at line 450 of file matrix.hh.

References gem5::MatStore< X, Y >::container.

◆ xSize()

template<size_t X, size_t Y>
static constexpr size_t gem5::MatStore< X, Y >::xSize ( )
inlinestaticconstexpr

Definition at line 391 of file matrix.hh.

References gem5::X86ISA::X.

◆ ySize()

template<size_t X, size_t Y>
static constexpr size_t gem5::MatStore< X, Y >::ySize ( )
inlinestaticconstexpr

Definition at line 392 of file matrix.hh.

◆ zero()

template<size_t X, size_t Y>
void gem5::MatStore< X, Y >::zero ( )
inline

Definition at line 408 of file matrix.hh.

References gem5::MatStore< X, Y >::container, and gem5::MatStore< X, Y >::LINEAR_SIZE.

Referenced by TEST().

Friends And Related Symbol Documentation

◆ HorizontalSlice

template<size_t X, size_t Y>
template<typename , typename , bool >
friend class HorizontalSlice
friend

Definition at line 387 of file matrix.hh.

Referenced by gem5::MatStore< X, Y >::asHSlice().

◆ operator<<

template<size_t X, size_t Y>
std::ostream & operator<< ( std::ostream & os,
const MatStore< X, Y > & v )
friend

Definition at line 480 of file matrix.hh.

◆ VerticalSlice

template<size_t X, size_t Y>
template<typename , typename , bool >
friend class VerticalSlice
friend

Definition at line 388 of file matrix.hh.

Referenced by gem5::MatStore< X, Y >::asVSlice().

Member Data Documentation

◆ container

◆ LINEAR_SIZE

template<size_t X, size_t Y>
size_t gem5::MatStore< X, Y >::LINEAR_SIZE = X * Y
staticconstexprprivate

◆ ParseParam< MatStore< X, Y > >

template<size_t X, size_t Y>
friend gem5::MatStore< X, Y >::ParseParam< MatStore< X, Y > >

Used for serialization/unserialisation.

Definition at line 500 of file matrix.hh.

◆ ShowParam< MatStore< X, Y > >

template<size_t X, size_t Y>
friend gem5::MatStore< X, Y >::ShowParam< MatStore< X, Y > >

Definition at line 501 of file matrix.hh.


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

Generated on Tue Jun 18 2024 16:24:12 for gem5 by doxygen 1.11.0