SLATE 2024.05.31
Software for Linear Algebra Targeting Exascale
Loading...
Searching...
No Matches
slate::Debug Class Reference

Slate::Debug - helper class used for debugging during development. More...

#include <Debug.hh>

Static Public Member Functions

static void on ()
 Enable debugging output.
 
static void off ()
 Disable debugging output.
 
template<typename scalar_t >
static void diffLapackMatrices (int64_t m, int64_t n, scalar_t const *A, int64_t lda, scalar_t const *B, int64_t ldb, int64_t mb, int64_t nb)
 Prints a summary of differences between matrices A and B.
 
template<typename scalar_t >
static void checkTilesLives (BaseMatrix< scalar_t > const &A)
 Prints information about tiles with local instances.
 
template<typename scalar_t >
static bool checkTilesLayout (BaseMatrix< scalar_t > const &A)
 Checks if existing tile instances in matrix have the same layout as the matrix.
 
template<typename scalar_t >
static void printTiles_ (BaseMatrix< scalar_t > const &A, const char *name, int fields, const char *func, const char *file, int line)
 Prints map of all tiles with requested fields.
 
static void printNumFreeMemBlocks (Memory const &m)
 Prints the number of free blocks for each device.
 
static void checkHostMemoryLeaks (Memory const &m)
 Checks whether blocks were leaked or freed too many times, for host.
 
static void checkDeviceMemoryLeaks (Memory const &m, int device)
 Checks whether blocks were leaked or freed too many times, for device.
 
template<typename scalar_t >
static void printNumFreeMemBlocks (BaseMatrix< scalar_t > const &A)
 

Detailed Description

Slate::Debug - helper class used for debugging during development.

Member Function Documentation

◆ diffLapackMatrices()

template<typename scalar_t >
template void slate::Debug::diffLapackMatrices ( int64_t  m,
int64_t  n,
scalar_t const *  A,
int64_t  lda,
scalar_t const *  B,
int64_t  ldb,
int64_t  mb,
int64_t  nb 
)
static

Prints a summary of differences between matrices A and B.

Uses "." for small relative error, "#" for large relative error in an entry. For each tile, checks only the four corner 2x2 blocks, marked by letters:

[ a e - - i m ]  output as:  -----------
[ b f - - j n ]              | a e i m |
[ - - - - - - ]              | b f j n |
[ - - - - - - ]              | c g k o |
[ c g - - k o ]              | d h l p |
[ d h - - l p ]              -----------

◆ printTiles_()

template<typename scalar_t >
template void slate::Debug::printTiles_ ( BaseMatrix< scalar_t > const &  A,
const char *  name,
int  fields,
const char *  func,
const char *  file,
int  line 
)
static

Prints map of all tiles with requested fields.

The printTiles macro adds the matrix name, function, file, and line. Example usage:

Debug::printTiles( A, Field_Kind | Field_MOSI )

For each tile (i, j), prints instances, first Host, then device 0, 1, etc. Each instance is a collection of letters as described below.

For all fields:

  • '.' if tile doesn't exist

For Field_Kind:

  • 'u' if user-owned origin
  • 'o' if slate-owned origin (local non-workspace)
  • 'w' if slate-owned workspace

For Field_MOSI:

  • 'm' if modified, 'M' if also on hold
  • 's' if shared, 'S' if also on hold
  • 'i' if invalid, 'I' if also on hold

For Field_Layout:

  • 'c' if ColMajor
  • 'r' if RowMajor

For Field_Buffer:

  • 'b' if regular buffer
  • 'e' if extended

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