Low-Level Abstraction of Memory Access
llama::mapping::Heatmap< Mapping, Granularity, TCountType > Struct Template Reference

#include <Heatmap.hpp>

+ Inheritance diagram for llama::mapping::Heatmap< Mapping, Granularity, TCountType >:
+ Collaboration diagram for llama::mapping::Heatmap< Mapping, Granularity, TCountType >:

Public Types

using Inner = Mapping
 
using CountType = TCountType
 
using ArrayExtents = typename Mapping::ArrayExtents
 
using RecordDim = typename Mapping::RecordDim
 

Public Member Functions

constexpr Heatmap ()=default
 
 Heatmap (Mapping mapping)
 
template<typename... Args>
 Heatmap (Args &&... innerArgs)
 
constexpr auto blobSize (size_type blobIndex) const -> size_type
 
template<std::size_t... RecordCoords, typename Blobs >
auto compute (ArrayIndex ai, RecordCoord< RecordCoords... > rc, Blobs &blobs) const -> decltype(auto)
 
auto blockHitsSize (size_type forBlobI) const -> size_type
 
template<typename Blobs >
auto blockHitsPtr (size_type forBlobI, Blobs &blobs) const -> CopyConst< Blobs, CountType > *
 
template<typename Blobs , typename OStream >
void writeGnuplotDataFileAscii (const Blobs &blobs, OStream &&os, bool trimEnd=true, std::size_t wrapAfterBlocks=64) const
 
template<typename Blobs , typename OStream >
void writeGnuplotDataFileBinary (const Blobs &blobs, OStream &&os, bool trimEnd=true, std::size_t afterBlobRoundUpTo=64) const
 

Static Public Member Functions

template<std::size_t... RecordCoords>
static constexpr auto isComputed (RecordCoord< RecordCoords... >)
 

Static Public Attributes

static constexpr std::size_t granularity = Granularity
 
static constexpr std::size_t blobCount = Mapping::blobCount * 2
 
static constexpr std::string_view gnuplotScriptAscii
 
static constexpr std::string_view gnuplotScriptBinary
 

Detailed Description

template<typename Mapping, typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
struct llama::mapping::Heatmap< Mapping, Granularity, TCountType >

Forwards all calls to the inner mapping. Counts all accesses made to blocks inside the blobs, allowing to extract a heatmap.

Template Parameters
MappingThe type of the inner mapping.
GranularityThe granularity in bytes on which to could accesses. A value of 1 counts every byte. individually. A value of e.g. 64, counts accesses per 64 byte block.
TCountTypeData type used to count the number of accesses. Atomic increments must be supported for this type.

Definition at line 31 of file Heatmap.hpp.

Member Typedef Documentation

◆ ArrayExtents

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
using llama::mapping::Heatmap< Mapping, Granularity, TCountType >::ArrayExtents = typename Mapping::ArrayExtents

Definition at line 43 of file Heatmap.hpp.

◆ CountType

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
using llama::mapping::Heatmap< Mapping, Granularity, TCountType >::CountType = TCountType

Definition at line 42 of file Heatmap.hpp.

◆ Inner

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
using llama::mapping::Heatmap< Mapping, Granularity, TCountType >::Inner = Mapping

Definition at line 40 of file Heatmap.hpp.

◆ RecordDim

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
using llama::mapping::Heatmap< Mapping, Granularity, TCountType >::RecordDim = typename Mapping::RecordDim

Definition at line 44 of file Heatmap.hpp.

Constructor & Destructor Documentation

◆ Heatmap() [1/3]

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
constexpr llama::mapping::Heatmap< Mapping, Granularity, TCountType >::Heatmap ( )
constexprdefault

◆ Heatmap() [2/3]

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
llama::mapping::Heatmap< Mapping, Granularity, TCountType >::Heatmap ( Mapping  mapping)
inlineexplicit

Definition at line 52 of file Heatmap.hpp.

◆ Heatmap() [3/3]

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
template<typename... Args>
llama::mapping::Heatmap< Mapping, Granularity, TCountType >::Heatmap ( Args &&...  innerArgs)
inlineexplicit

Definition at line 57 of file Heatmap.hpp.

Member Function Documentation

◆ blobSize()

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
constexpr auto llama::mapping::Heatmap< Mapping, Granularity, TCountType >::blobSize ( size_type  blobIndex) const -> size_type
inlineconstexpr

Definition at line 72 of file Heatmap.hpp.

◆ blockHitsPtr()

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
template<typename Blobs >
auto llama::mapping::Heatmap< Mapping, Granularity, TCountType >::blockHitsPtr ( size_type  forBlobI,
Blobs blobs 
) const -> CopyConst<Blobs, CountType>*
inline

Definition at line 116 of file Heatmap.hpp.

◆ blockHitsSize()

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
auto llama::mapping::Heatmap< Mapping, Granularity, TCountType >::blockHitsSize ( size_type  forBlobI) const -> size_type
inline

Definition at line 108 of file Heatmap.hpp.

◆ compute()

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
template<std::size_t... RecordCoords, typename Blobs >
auto llama::mapping::Heatmap< Mapping, Granularity, TCountType >::compute ( ArrayIndex  ai,
RecordCoord< RecordCoords... >  rc,
Blobs blobs 
) const -> decltype(auto)
inline

Definition at line 86 of file Heatmap.hpp.

◆ isComputed()

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
template<std::size_t... RecordCoords>
static constexpr auto llama::mapping::Heatmap< Mapping, Granularity, TCountType >::isComputed ( RecordCoord< RecordCoords... >  )
inlinestaticconstexpr

Definition at line 80 of file Heatmap.hpp.

◆ writeGnuplotDataFileAscii()

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
template<typename Blobs , typename OStream >
void llama::mapping::Heatmap< Mapping, Granularity, TCountType >::writeGnuplotDataFileAscii ( const Blobs blobs,
OStream &&  os,
bool  trimEnd = true,
std::size_t  wrapAfterBlocks = 64 
) const
inline

Writes a data file suitable for gnuplot containing the heatmap data. You can use the script provided by gnuplotScript to plot this data file.

Parameters
blobsThe blobs of the view containing this mapping
osThe stream to write the data to. Should be some form of std::ostream.

Definition at line 144 of file Heatmap.hpp.

◆ writeGnuplotDataFileBinary()

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
template<typename Blobs , typename OStream >
void llama::mapping::Heatmap< Mapping, Granularity, TCountType >::writeGnuplotDataFileBinary ( const Blobs blobs,
OStream &&  os,
bool  trimEnd = true,
std::size_t  afterBlobRoundUpTo = 64 
) const
inline

Definition at line 169 of file Heatmap.hpp.

Member Data Documentation

◆ blobCount

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
constexpr std::size_t llama::mapping::Heatmap< Mapping, Granularity, TCountType >::blobCount = Mapping::blobCount * 2
inlinestaticconstexpr

Definition at line 47 of file Heatmap.hpp.

◆ gnuplotScriptAscii

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
constexpr std::string_view llama::mapping::Heatmap< Mapping, Granularity, TCountType >::gnuplotScriptAscii
staticconstexpr

An example script for plotting the ASCII heatmap data using gnuplot.

Definition at line 192 of file Heatmap.hpp.

◆ gnuplotScriptBinary

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
constexpr std::string_view llama::mapping::Heatmap< Mapping, Granularity, TCountType >::gnuplotScriptBinary
staticconstexpr

An example script for plotting the binary heatmap data using gnuplot.

Definition at line 207 of file Heatmap.hpp.

◆ granularity

template<typename Mapping , typename Mapping::ArrayExtents::value_type Granularity = 1, typename TCountType = std::size_t>
constexpr std::size_t llama::mapping::Heatmap< Mapping, Granularity, TCountType >::granularity = Granularity
inlinestaticconstexpr

Definition at line 41 of file Heatmap.hpp.


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