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

Tests for piecewise constants nodes. More...

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 piecewise_1D ()
 Tests for 1D piecewise nodes.
 
template<jit::float_scalar T>
void piecewise_2D ()
 Tests for 2D piecewise nodes.
 
template<jit::float_scalar T>
void run_tests ()
 Run tests with a specified backend.
 
int main (int argc, const char *argv[])
 Main program of the test.
 

Detailed Description

Tests for piecewise constants nodes.

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.

◆ piecewise_1D()

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

Tests for 1D piecewise nodes.

Template Parameters
TBase type of the calculation.

◆ piecewise_2D()

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

Tests for 2D piecewise nodes.

Template Parameters
TBase type of the calculation.

◆ run_tests()

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

Run tests with a specified backend.

Template Parameters
TBase type of the calculation.