TDLS 0.2.0
Tiny Device-callable Linear Solvers
Loading...
Searching...
No Matches
tdls::TileOperations< T, tile_size, unroll_inner > Struct Template Reference

tile_size x tile_size register-tile micro-kernels shared by the solver families. More...

#include <tile_operations.hpp>

Inheritance diagram for tdls::TileOperations< T, tile_size, unroll_inner >:
[legend]

Static Public Member Functions

template<int k_extent>
TDLS_HOST_DEVICE static TDLS_FORCEINLINE constexpr void swap_rows (T *TDLS_RESTRICT t, int k, int r) noexcept
 Row swap k <-> r inside the KExKE active part of the tile, compile-time indexed on both sides.
 
template<int diag_extent, int col_extent>
TDLS_HOST_DEVICE static TDLS_FORCEINLINE constexpr void trsm_left_unit (const T *TDLS_RESTRICT lu, T *TDLS_RESTRICT B) noexcept
 B := L^-1 B, with L the unit lower part of the factored diagonal tile. L is KDxKD, B is KDxC.
 
template<int diag_extent, int row_extent>
TDLS_HOST_DEVICE static TDLS_FORCEINLINE constexpr void trsm_right (const T *TDLS_RESTRICT lu, T *TDLS_RESTRICT B) noexcept
 B := B U^-1, with U the upper part of the factored diagonal tile. U is KDxKD, B is RxKD.
 
template<int row_extent, int col_extent, int k_extent>
TDLS_HOST_DEVICE static TDLS_FORCEINLINE constexpr void gemm_sub (T *TDLS_RESTRICT Ct, const T *TDLS_RESTRICT At, const T *TDLS_RESTRICT Bt) noexcept
 Ct -= At*Bt with per-element dot-product accumulation. At is RxK, Bt is KxC, Ct is RxC.
 

Detailed Description

template<typename T, int tile_size, bool unroll_inner>
struct tdls::TileOperations< T, tile_size, unroll_inner >

tile_size x tile_size register-tile micro-kernels shared by the solver families.

Template Parameters
Tscalar type
tile_sizetile size (int, row stride of the register tiles)
unroll_innerunroll knob, forwarded from the solver configuration

Member Function Documentation

◆ gemm_sub()

template<typename T , int tile_size, bool unroll_inner>
template<int row_extent, int col_extent, int k_extent>
TDLS_HOST_DEVICE static TDLS_FORCEINLINE constexpr void tdls::TileOperations< T, tile_size, unroll_inner >::gemm_sub ( T *TDLS_RESTRICT Ct,
const T *TDLS_RESTRICT At,
const T *TDLS_RESTRICT Bt )
inlinestaticconstexprnoexcept

Ct -= At*Bt with per-element dot-product accumulation. At is RxK, Bt is KxC, Ct is RxC.

Template Parameters
row_extentrow extent of Ct and At
col_extentcolumn extent of Ct and Bt
k_extentinner extent (columns of At, rows of Bt)
Parameters
[in,out]Ctaccumulator tile
[in]Atleft factor tile
[in]Btright factor tile

◆ swap_rows()

template<typename T , int tile_size, bool unroll_inner>
template<int k_extent>
TDLS_HOST_DEVICE static TDLS_FORCEINLINE constexpr void tdls::TileOperations< T, tile_size, unroll_inner >::swap_rows ( T *TDLS_RESTRICT t,
int k,
int r )
inlinestaticconstexprnoexcept

Row swap k <-> r inside the KExKE active part of the tile, compile-time indexed on both sides.

The equality test against every unrolled row index keeps the tile addressing static; a dynamic t[r*tile_size+j] would spill the tile. k_extent bounds both loops, so the phantom slots of trailing tiles are never touched, as in every other micro-kernel.

Template Parameters
k_extentactive extent of the tile
Parameters
[in,out]tregister tile
[in]kdestination row
[in]rsource row to swap in

◆ trsm_left_unit()

template<typename T , int tile_size, bool unroll_inner>
template<int diag_extent, int col_extent>
TDLS_HOST_DEVICE static TDLS_FORCEINLINE constexpr void tdls::TileOperations< T, tile_size, unroll_inner >::trsm_left_unit ( const T *TDLS_RESTRICT lu,
T *TDLS_RESTRICT B )
inlinestaticconstexprnoexcept

B := L^-1 B, with L the unit lower part of the factored diagonal tile. L is KDxKD, B is KDxC.

Template Parameters
diag_extentextent of the factored diagonal tile
col_extentcolumn extent of B
Parameters
[in]lufactored diagonal tile (L\U)
[in,out]Bupdated register tile

◆ trsm_right()

template<typename T , int tile_size, bool unroll_inner>
template<int diag_extent, int row_extent>
TDLS_HOST_DEVICE static TDLS_FORCEINLINE constexpr void tdls::TileOperations< T, tile_size, unroll_inner >::trsm_right ( const T *TDLS_RESTRICT lu,
T *TDLS_RESTRICT B )
inlinestaticconstexprnoexcept

B := B U^-1, with U the upper part of the factored diagonal tile. U is KDxKD, B is RxKD.

The diagonal of lu must already hold the pivot RECIPROCALS: no divisions here.

Template Parameters
diag_extentextent of the factored diagonal tile
row_extentrow extent of B
Parameters
[in]lufactored diagonal tile (L\U, reciprocal diagonal)
[in,out]Bupdated register tile

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