MLIR  15.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"

+ Collaboration diagram for impl::MemRefDataVerifier< T >:

Public Member Functions

template<>
bool verifyElem (double actual, double expected)
 
template<>
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 235 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 280 of file RunnerUtils.h.

References mlir::verify().

Referenced by impl::verifyMemRef().

◆ verifyElem() [1/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 263 of file RunnerUtils.h.

◆ verifyElem() [2/3]

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

Definition at line 268 of file RunnerUtils.h.

◆ verifyElem() [3/3]

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

Definition at line 274 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 252 of file RunnerUtils.h.

References mlir::presburger::detail::abs().

Member Data Documentation

◆ printLimit

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

Maximum number of errors printed by the verifier.

Definition at line 237 of file RunnerUtils.h.


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