MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
impl::MemRefDataVerifier< T > Struct Template Reference

Verify the result of two computations are equivalent up to a small numerical error and return the number of errors. More...

#include "mlir/ExecutionEngine/RunnerUtils.h"

Public Member Functions

bool verifyElem (double actual, double expected)
 
bool verifyElem (float actual, float expected)
 

Static Public Member Functions

static bool verifyRelErrorSmallerThan (T actual, T expected, T epsilon)
 Verify the relative difference of the values is smaller than epsilon. More...
 
static bool verifyElem (T actual, T expected)
 Verify the values are equivalent (integers) or are close (floating-point). More...
 
static int64_t verify (std::ostream &os, T *actualBasePtr, T *expectedBasePtr, int64_t dim, int64_t offset, const int64_t *sizes, const int64_t *strides, int64_t &printCounter)
 Verify the data element-by-element and return the number of errors. More...
 

Static Public Attributes

static constexpr int printLimit = 10
 Maximum number of errors printed by the verifier. More...
 

Detailed Description

template<typename T>
struct impl::MemRefDataVerifier< T >

Verify the result of two computations are equivalent up to a small numerical error and return the number of errors.

Definition at line 245 of file RunnerUtils.h.

Member Function Documentation

◆ verify()

template<typename T >
int64_t impl::MemRefDataVerifier< T >::verify ( std::ostream &  os,
T *  actualBasePtr,
T *  expectedBasePtr,
int64_t  dim,
int64_t  offset,
const int64_t *  sizes,
const int64_t *  strides,
int64_t &  printCounter 
)
static

Verify the data element-by-element and return the number of errors.

Definition at line 290 of file RunnerUtils.h.

References mlir::verify().

Referenced by impl::verifyMemRef().

◆ verifyElem() [1/3]

bool impl::MemRefDataVerifier< double >::verifyElem ( double  actual,
double  expected 
)
inline

Definition at line 278 of file RunnerUtils.h.

◆ verifyElem() [2/3]

bool impl::MemRefDataVerifier< float >::verifyElem ( float  actual,
float  expected 
)
inline

Definition at line 284 of file RunnerUtils.h.

◆ verifyElem() [3/3]

template<typename T >
bool impl::MemRefDataVerifier< T >::verifyElem ( actual,
expected 
)
static

Verify the values are equivalent (integers) or are close (floating-point).

Definition at line 273 of file RunnerUtils.h.

◆ verifyRelErrorSmallerThan()

template<typename T >
bool impl::MemRefDataVerifier< T >::verifyRelErrorSmallerThan ( actual,
expected,
epsilon 
)
static

Verify the relative difference of the values is smaller than epsilon.

Definition at line 262 of file RunnerUtils.h.

References mlir::presburger::abs().

Member Data Documentation

◆ printLimit

template<typename T >
constexpr int impl::MemRefDataVerifier< T >::printLimit = 10
staticconstexpr

Maximum number of errors printed by the verifier.

Definition at line 247 of file RunnerUtils.h.


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