Graph Framework
Loading...
Searching...
No Matches
jit_test.cpp File Reference

Tests for the jit code. More...

#include <cassert>
#include "../graph_framework/dispersion.hpp"

Functions

template<jit::float_scalar T>
void check (const T test, const T tolarance)
 Assert when difference is greater than the tolarance.
 
template<jit::float_scalar T>
void compile (graph::input_nodes< T > inputs, graph::output_nodes< T > outputs, graph::map_nodes< T > setters, const T expected, const T tolarance)
 Compile kernal and check the result of the output.
 
template<jit::float_scalar T>
void run_math_tests ()
 Run tests to test simple math operations are the same.
 
template<dispersion::function DISPERSION_FUNCTION>
void run_dispersion_test (equilibrium::shared< typename DISPERSION_FUNCTION::base > &eq, const typename DISPERSION_FUNCTION::base tolarance)
 Run dispersion tests.
 
template<typename T >
void run_dispersion_tests ()
 Run dispersion tests.
 
template<jit::float_scalar T>
void run_tests ()
 Run tests.
 
int main (int argc, const char *argv[])
 Main program of the test.
 

Detailed Description

Tests for the jit code.

Function Documentation

◆ check()

template<jit::float_scalar T>
void check ( const T  test,
const T  tolarance 
)

Assert when difference is greater than the tolarance.

Specialize to check for complex numbers since complex has not <= operator.

Template Parameters
TBase type of the calculation.
Parameters
[in]testTest value.
[in]tolaranceTest tolarance.

◆ compile()

template<jit::float_scalar T>
void compile ( graph::input_nodes< T >  inputs,
graph::output_nodes< T >  outputs,
graph::map_nodes< T >  setters,
const T  expected,
const T  tolarance 
)

Compile kernal and check the result of the output.

Template Parameters
TBase type of the calculation.
Parameters
[in]inputsKernel input nodes.
[in]outputsKernel output nodes.
[in]settersKernel set nodes.
[in]expectedExpected result.
[in]tolaranceCheck tolarances.

◆ main()

int main ( int  argc,
const char *  argv[] 
)

Main program of the test.

Parameters
[in]argcNumber of commandline arguments.
[in]argvArray of commandline arguments.

◆ run_dispersion_test()

template<dispersion::function DISPERSION_FUNCTION>
void run_dispersion_test ( equilibrium::shared< typename DISPERSION_FUNCTION::base > &  eq,
const typename DISPERSION_FUNCTION::base  tolarance 
)

Run dispersion tests.

Template Parameters
DISPERSION_FUNCTIONClass of dispersion function to use.
Parameters
[in,out]eqEquilibrium for the dispersion function.
[in]tolaranceThe test tolarance for check results to.

◆ run_dispersion_tests()

template<typename T >
void run_dispersion_tests ( )

Run dispersion tests.

Template Parameters
TBase type of the calculation.

◆ run_math_tests()

template<jit::float_scalar T>
void run_math_tests ( )

Run tests to test simple math operations are the same.

Template Parameters
TBase type of the calculation.

◆ run_tests()

template<jit::float_scalar T>
void run_tests ( )

Run tests.

Template Parameters
TBase type of the calculation.