Loading...
Searching...
No Matches
gpr::linalg::canonical::AlignedTile Class Reference

#include <gpr/linalg/CanonicalTriangular.h>

Public Member Functions

template<typename Derived>
 AlignedTile (const Eigen::MatrixBase< Derived > &source)
 AlignedTile (const AlignedTile &)=delete
AlignedTile & operator= (const AlignedTile &)=delete
 ~AlignedTile ()
Eigen::Map< Eigen::MatrixXd, Eigen::Aligned64 > map () noexcept

Detailed Description

A tile copied into storage aligned to 64 bytes. The vector kernels of Eigen and of the BLAS split a product or a reduction at the first aligned address of an operand, so the order of the additions follows the operand's address modulo the vector width; heap blocks from the system allocator are aligned to 16 bytes, which leaves that order to address randomisation. Copying every operand of a tile kernel to a 64-byte boundary (the widest vector, AVX-512) with a fixed leading dimension fixes the order, so a run repeats its rounding bit for bit.

Definition at line 193 of file CanonicalTriangular.h.

Constructor & Destructor Documentation

◆ AlignedTile() [1/2]

template<typename Derived>
gpr::linalg::canonical::AlignedTile::AlignedTile ( const Eigen::MatrixBase< Derived > & source)
inlineexplicit

Definition at line 196 of file CanonicalTriangular.h.

197 : rows_(source.rows()),
198 cols_(source.cols()),
199 bytes_(padded(static_cast<std::size_t>(source.rows()) *
200 static_cast<std::size_t>(source.cols()))),
201 storage_(AlignedBlockCache::acquire(bytes_))
202 {
203 if (storage_ == nullptr) throw std::bad_alloc();
204 map() = source;
205 }
static double * acquire(std::size_t bytes)
Eigen::Map< Eigen::MatrixXd, Eigen::Aligned64 > map() noexcept

◆ AlignedTile() [2/2]

gpr::linalg::canonical::AlignedTile::AlignedTile ( const AlignedTile & )
delete

◆ ~AlignedTile()

gpr::linalg::canonical::AlignedTile::~AlignedTile ( )
inline

Definition at line 208 of file CanonicalTriangular.h.

209 {
210 AlignedBlockCache::release(storage_, bytes_);
211 }
static void release(double *storage, std::size_t bytes) noexcept

Member Function Documentation

◆ map()

Eigen::Map< Eigen::MatrixXd, Eigen::Aligned64 > gpr::linalg::canonical::AlignedTile::map ( )
inlinenodiscardnoexcept

Definition at line 212 of file CanonicalTriangular.h.

213 {
214 return Eigen::Map<Eigen::MatrixXd, Eigen::Aligned64>(storage_, rows_,
215 cols_);
216 }

◆ operator=()

AlignedTile & gpr::linalg::canonical::AlignedTile::operator= ( const AlignedTile & )
delete

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