Graph Framework
Loading...
Searching...
No Matches
workflow::manager< T, SAFE_MATH > Class Template Reference

Class representing a workflow manager. More...

#include <workflow.hpp>

Public Member Functions

 manager (const size_t index)
 Workflow manager constructor.
 
void add_preitem (graph::input_nodes< T, SAFE_MATH > in, graph::output_nodes< T, SAFE_MATH > out, graph::map_nodes< T, SAFE_MATH > maps, graph::shared_random_state< T, SAFE_MATH > state, const std::string name, const size_t size)
 Add a pre workflow item.
 
void add_item (graph::input_nodes< T, SAFE_MATH > in, graph::output_nodes< T, SAFE_MATH > out, graph::map_nodes< T, SAFE_MATH > maps, graph::shared_random_state< T, SAFE_MATH > state, const std::string name, const size_t size)
 Add a workflow item.
 
void add_converge_item (graph::input_nodes< T, SAFE_MATH > in, graph::output_nodes< T, SAFE_MATH > out, graph::map_nodes< T, SAFE_MATH > maps, graph::shared_random_state< T, SAFE_MATH > state, const std::string name, const size_t size, const T tol=1.0E-30, const size_t max_iter=1000)
 Add a converge item.
 
void compile ()
 Compile the workflow items.
 
void pre_run ()
 Run pre work items.
 
void run ()
 Run work items.
 
void wait ()
 Wait for GPU queue to finish.
 
void copy_to_device (graph::shared_leaf< T, SAFE_MATH > &node, T *destination)
 Copy buffer contents to the device.
 
void copy_to_host (graph::shared_leaf< T, SAFE_MATH > &node, T *destination)
 Copy contexts of buffer to host.
 
void print (const size_t index, const graph::output_nodes< T, SAFE_MATH > &nodes)
 Print results.
 
check_value (const size_t index, const graph::shared_leaf< T, SAFE_MATH > &node)
 Check the value.
 
jit::context< T, SAFE_MATH > & get_context ()
 Get the jit context.
 

Detailed Description

template<jit::float_scalar T, bool SAFE_MATH = false>
class workflow::manager< T, SAFE_MATH >

Class representing a workflow manager.

Template Parameters
TBase type of the calculation.
SAFE_MATHUse Safe Math operations.

Constructor & Destructor Documentation

◆ manager()

template<jit::float_scalar T, bool SAFE_MATH = false>
workflow::manager< T, SAFE_MATH >::manager ( const size_t  index)
inline

Workflow manager constructor.

For GPU devices, this select the device number to run on. For CPU devices this parameter is ignored.

Note
It is possible to create multiple workflow managers for the same GPU device and may have performance benefits todo so.
Parameters
[in]indexDevice index.

Member Function Documentation

◆ add_converge_item()

template<jit::float_scalar T, bool SAFE_MATH = false>
void workflow::manager< T, SAFE_MATH >::add_converge_item ( graph::input_nodes< T, SAFE_MATH >  in,
graph::output_nodes< T, SAFE_MATH >  out,
graph::map_nodes< T, SAFE_MATH >  maps,
graph::shared_random_state< T, SAFE_MATH >  state,
const std::string  name,
const size_t  size,
const T  tol = 1.0E-30,
const size_t  max_iter = 1000 
)
inline

Add a converge item.

Parameters
[in]inInput variables.
[in]outOutput nodes.
[in]mapsSetter maps.
[in]stateRandom state node.
[in]nameName of the work item.
[in]sizeSize of the work item.
[in]tolTolerance to converge the function to.
[in]max_iterMaximum number of iterations before giving up.

◆ add_item()

template<jit::float_scalar T, bool SAFE_MATH = false>
void workflow::manager< T, SAFE_MATH >::add_item ( graph::input_nodes< T, SAFE_MATH >  in,
graph::output_nodes< T, SAFE_MATH >  out,
graph::map_nodes< T, SAFE_MATH >  maps,
graph::shared_random_state< T, SAFE_MATH >  state,
const std::string  name,
const size_t  size 
)
inline

Add a workflow item.

Parameters
[in]inInput variables.
[in]outOutput nodes.
[in]mapsSetter maps.
[in]stateRandom state node.
[in]nameName of the work item.
[in]sizeSize of the work item.

◆ add_preitem()

template<jit::float_scalar T, bool SAFE_MATH = false>
void workflow::manager< T, SAFE_MATH >::add_preitem ( graph::input_nodes< T, SAFE_MATH >  in,
graph::output_nodes< T, SAFE_MATH >  out,
graph::map_nodes< T, SAFE_MATH >  maps,
graph::shared_random_state< T, SAFE_MATH >  state,
const std::string  name,
const size_t  size 
)
inline

Add a pre workflow item.

Parameters
[in]inInput variables.
[in]outOutput nodes.
[in]mapsSetter maps.
[in]stateRandom state node.
[in]nameName of the work item.
[in]sizeSize of the work item.

◆ check_value()

template<jit::float_scalar T, bool SAFE_MATH = false>
T workflow::manager< T, SAFE_MATH >::check_value ( const size_t  index,
const graph::shared_leaf< T, SAFE_MATH > &  node 
)
inline

Check the value.

Parameters
[in]indexParticle index to check value for.
[in]nodeNode to check the value for.
Returns
The value at the index.

◆ copy_to_device()

template<jit::float_scalar T, bool SAFE_MATH = false>
void workflow::manager< T, SAFE_MATH >::copy_to_device ( graph::shared_leaf< T, SAFE_MATH > &  node,
T *  destination 
)
inline

Copy buffer contents to the device.

Parameters
[in]nodeNode to copy buffer to.
[in]destinationHost side buffer to copy from.

◆ copy_to_host()

template<jit::float_scalar T, bool SAFE_MATH = false>
void workflow::manager< T, SAFE_MATH >::copy_to_host ( graph::shared_leaf< T, SAFE_MATH > &  node,
T *  destination 
)
inline

Copy contexts of buffer to host.

Parameters
[in]nodeNode to copy buffer from.
[in,out]destinationHost side buffer to copy to.

◆ get_context()

template<jit::float_scalar T, bool SAFE_MATH = false>
jit::context< T, SAFE_MATH > & workflow::manager< T, SAFE_MATH >::get_context ( )
inline

Get the jit context.

Returns
The jit context.

◆ print()

template<jit::float_scalar T, bool SAFE_MATH = false>
void workflow::manager< T, SAFE_MATH >::print ( const size_t  index,
const graph::output_nodes< T, SAFE_MATH > &  nodes 
)
inline

Print results.

Parameters
[in]indexParticle index to print.
[in]nodesNodes to output.

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