YASK
Yet Another Stencil Kit: a software framework for creating HPC stencil code. Copyright 2014-2023 Intel Corporation.
|
A base class for defining solutions to be kept in a common registry. More...
#include <yc_solution_api.hpp>
Public Types | |
typedef std::map< std::string, yc_solution_base * > | soln_map |
Type for a common registry shared among all yc_solution_base objects. | |
Public Member Functions | |
yc_solution_base (const std::string &name) | |
Constructor. | |
yc_solution_base (yc_solution_base &base) | |
[Advanced] Constructor that uses an existing yc_solution_base to share underlying solutions. | |
virtual | ~yc_solution_base () |
Destructor. | |
virtual void | define () |
Define all functionality of this solution. | |
yc_solution_ptr | get_soln () |
Access the underlying solution. | |
yc_index_node_ptr | new_step_index (const std::string &name) |
A simple wrapper for yc_node_factory::new_step_index(). | |
yc_index_node_ptr | new_domain_index (const std::string &name) |
A simple wrapper for yc_node_factory::new_domain_index(). | |
yc_index_node_ptr | new_misc_index (const std::string &name) |
A simple wrapper for yc_node_factory::new_misc_index(). | |
yc_number_node_ptr | new_number_node (yc_number_any_arg arg) |
A simple wrapper for yc_node_factory::new_number_node(). | |
yc_number_node_ptr | first_domain_index (yc_index_node_ptr dim) |
A simple wrapper for yc_node_factory::new_first_domain_index(). | |
yc_number_node_ptr | last_domain_index (yc_index_node_ptr dim) |
A simple wrapper for yc_node_factory::new_last_domain_index(). | |
Static Public Member Functions | |
static soln_map & | get_registry () |
Access to the registry. | |
A base class for defining solutions to be kept in a common registry.
This is a wrapper around a yc_solution pointer and a static registry used to hold all yc_solution_base objects.
This base class must be extended via inheritance. When using the provided YASK compiler utility, the define()
method must be overloaded to add stencil equations and other functionality needed to implement the concrete solution.
typedef std::map<std::string, yc_solution_base*> yask::yc_solution_base::soln_map |
Type for a common registry shared among all yc_solution_base objects.
The map key is the name of the solution.
yask::yc_solution_base::yc_solution_base | ( | const std::string & | name | ) |
Constructor.
Creates a new yc_solution object and adds this object to the registry.
yask_exception | if a solution with this name already exists. |
yask::yc_solution_base::yc_solution_base | ( | yc_solution_base & | base | ) |
[Advanced] Constructor that uses an existing yc_solution_base to share underlying solutions.
This constructor allows the use of object-oriented composition instead of inheritance when creating classes that participate in solution definition.
|
static |
Access to the registry.
|
virtual |
Define all functionality of this solution.
If using the provided YASK compiler utility yask_compiler.exe
, when a stencil solution is selected via stencil=name
when invoking make
or via -stencil name
on the YASK compiler command-line, this function in the named solution will be called.
In this case, this function must be implemented by each concrete stencil solution to add vars and equations as needed to define the stencil. In general, any YASK compiler API functions may be called from this function.
For custom code using the YASK compiler library but not the YASK compiler utility, calling define() is possible but optional.
Reimplemented in yask::yc_solution_with_radius_base.