YASK
Yet Another Stencil Kit: a software framework for creating HPC stencil code. Copyright 2014-2023 Intel Corporation.
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
YASK Compiler

Classes

class  yask::yc_factory
 Bootstrap factory to create objects needed to define a stencil solution. More...
 
class  yask::yc_solution
 Stencil solution. More...
 
class  yask::yc_var
 A compile-time data variable. More...
 
class  yask::yc_var_proxy
 A wrapper or "proxy" class around a yc_var pointer. More...
 
class  yask::yc_expr_node
 Base class for all AST nodes. More...
 
class  yask::yc_equation_node
 Equation node. More...
 
class  yask::yc_number_node
 Base class for all numerical AST nodes. More...
 
class  yask::yc_bool_node
 Base class for all boolean AST nodes. More...
 
class  yask::yc_index_node
 A dimension or an index in that dimension. More...
 
class  yask::yc_var_point_node
 A reference to a point in a var. More...
 
class  yask::yc_const_number_node
 A constant numerical value. More...
 
class  yask::yc_negate_node
 A numerical negation operator. More...
 
class  yask::yc_commutative_number_node
 Base class for commutative numerical operators. More...
 
class  yask::yc_add_node
 An addition node. More...
 
class  yask::yc_multiply_node
 A multiplication node. More...
 
class  yask::yc_binary_number_node
 Base class for numerical binary operators. More...
 
class  yask::yc_subtract_node
 A subtraction node. More...
 
class  yask::yc_divide_node
 A division node. More...
 
class  yask::yc_mod_node
 A modulo node. More...
 
class  yask::yc_not_node
 A boolean inversion operator. More...
 
class  yask::yc_binary_bool_node
 Base class for boolean binary operators that take boolean inputs. More...
 
class  yask::yc_and_node
 A boolean 'and' operator. More...
 
class  yask::yc_or_node
 A boolean 'or' operator. More...
 
class  yask::yc_binary_comparison_node
 Base class for boolean binary operators that take numerical inputs. More...
 
class  yask::yc_equals_node
 A numerical-comparison 'equals' operator. More...
 
class  yask::yc_not_equals_node
 A numerical-comparison 'not_equals' operator. More...
 
class  yask::yc_less_than_node
 A numerical-comparison 'less_than' operator. More...
 
class  yask::yc_greater_than_node
 A numerical-comparison 'greater_than' operator. More...
 
class  yask::yc_not_less_than_node
 A numerical-comparison 'not_less_than' operator. More...
 
class  yask::yc_not_greater_than_node
 A numerical-comparison 'not_greater_than' operator. More...
 
class  yask::yc_number_ptr_arg
 Arguments that may be YASK numeric pointer types. More...
 
class  yask::yc_number_const_arg
 Arguments that may be non-YASK numeric types. More...
 
class  yask::yc_number_any_arg
 Arguments that may be YASK or non-YASK numeric types. More...
 
class  yask::yc_node_factory
 Factory to create AST nodes. More...
 
class  yask::yc_solution_base
 A base class for defining solutions to be kept in a common registry. More...
 
class  yask::yc_solution_with_radius_base
 A base class for stencils that have a "radius" size parameter. More...
 

Macros

#define UNARY_MATH_EXPR(fn_name)    yc_number_node_ptr fn_name(const yc_number_node_ptr rhs)
 Unary math functions. Used internally to define sqrt(), sin(), etc.
 
#define BINARY_MATH_EXPR(fn_name)
 Binary math functions. Used internally.
 
#define BOOL_OPER(oper, fn)
 Binary numerical-to-boolean operators. Used internally to define ==, <, etc.
 
#define EQUALS   <<
 Recommended macro to make the "equality" operator readable and self-explanatory.
 
#define IF_DOMAIN   ^=
 Recommended macro to make the domain-condition operator readable and self-explanatory.
 
#define IF_STEP   |=
 Recommended macro to make the step-condition operator readable and self-explanatory.
 
#define MAKE_STEP_INDEX(dim_name)   yc_index_node_ptr dim_name = new_step_index(#dim_name)
 Convenience macro for declaring a step index in a class derived from yask::yc_solution_base.
 
#define MAKE_DOMAIN_INDEX(dim_name)   yc_index_node_ptr dim_name = new_domain_index(#dim_name)
 Convenience macro for declaring a domain index in a class derived from yask::yc_solution_base.
 
#define MAKE_MISC_INDEX(dim_name)   yc_index_node_ptr dim_name = new_misc_index(#dim_name)
 Convenience macro for declaring a misc index in a class derived from yask::yc_solution_base.
 
#define MAKE_VAR(var_name, ...)    yc_var_proxy var_name = yc_var_proxy(#var_name, get_soln(), { __VA_ARGS__ }, false)
 Convenience macro for creating a yask::yc_var_proxy for an n-dimensional YASK variable.
 
#define MAKE_SCRATCH_VAR(var_name, ...)    yc_var_proxy var_name = yc_var_proxy(#var_name, get_soln(), { __VA_ARGS__ }, true)
 Convenience macro for creating a yask::yc_var_proxy for an n-dimensional YASK scratch variable.
 
#define MAKE_SCALAR_VAR(var_name)   MAKE_VAR(var_name)
 Convenience macro for creating a yask::yc_var_proxy for a scalar YASK variable.
 
#define REGISTER_SOLUTION(class_name)    static class_name class_name ## _instance
 Convenience macro for declaring an object of a type derived from yask::yc_solution_base.
 

Typedefs

typedef std::shared_ptr< yc_solutionyask::yc_solution_ptr
 Shared pointer to yc_solution.
 
typedef yc_varyask::yc_var_ptr
 Pointer to yc_var.
 
typedef std::shared_ptr< yc_expr_nodeyask::yc_expr_node_ptr
 Shared pointer to yc_expr_node.
 
typedef std::shared_ptr< yc_bool_nodeyask::yc_bool_node_ptr
 Shared pointer to yc_bool_node.
 
typedef std::shared_ptr< yc_number_nodeyask::yc_number_node_ptr
 Shared pointer to yc_number_node.
 
typedef std::shared_ptr< yc_index_nodeyask::yc_index_node_ptr
 Shared pointer to yc_index_node.
 
typedef std::shared_ptr< yc_equation_nodeyask::yc_equation_node_ptr
 Shared pointer to yc_equation_node.
 
typedef std::shared_ptr< yc_var_point_nodeyask::yc_var_point_node_ptr
 Shared pointer to yc_var_point_node.
 
typedef std::shared_ptr< yc_const_number_nodeyask::yc_const_number_node_ptr
 Shared pointer to yc_const_number_node.
 
typedef std::shared_ptr< yc_negate_nodeyask::yc_negate_node_ptr
 Shared pointer to yc_negate_node.
 
typedef std::shared_ptr< yc_commutative_number_nodeyask::yc_commutative_number_node_ptr
 Shared pointer to yc_commutative_number_node.
 
typedef std::shared_ptr< yc_binary_number_nodeyask::yc_binary_number_node_ptr
 Shared pointer to yc_binary_number_node.
 
typedef std::shared_ptr< yc_binary_bool_nodeyask::yc_binary_bool_node_ptr
 Shared pointer to yc_binary_bool_node.
 
typedef std::shared_ptr< yc_binary_comparison_nodeyask::yc_binary_comparison_node_ptr
 Shared pointer to yc_binary_comparison_node.
 
typedef std::shared_ptr< yc_add_nodeyask::yc_add_node_ptr
 Shared pointer to yc_add_node.
 
typedef std::shared_ptr< yc_multiply_nodeyask::yc_multiply_node_ptr
 Shared pointer to yc_multiply_node.
 
typedef std::shared_ptr< yc_subtract_nodeyask::yc_subtract_node_ptr
 Shared pointer to yc_subtract_node.
 
typedef std::shared_ptr< yc_divide_nodeyask::yc_divide_node_ptr
 Shared pointer to yc_divide_node.
 
typedef std::shared_ptr< yc_mod_nodeyask::yc_mod_node_ptr
 Shared pointer to yc_mod_node.
 
typedef std::shared_ptr< yc_not_nodeyask::yc_not_node_ptr
 Shared pointer to yc_not_node.
 
typedef std::shared_ptr< yc_equals_nodeyask::yc_equals_node_ptr
 Shared pointer to yc_equals_node.
 
typedef std::shared_ptr< yc_not_equals_nodeyask::yc_not_equals_node_ptr
 Shared pointer to yc_not_equals_node.
 
typedef std::shared_ptr< yc_less_than_nodeyask::yc_less_than_node_ptr
 Shared pointer to yc_less_than_node.
 
typedef std::shared_ptr< yc_greater_than_nodeyask::yc_greater_than_node_ptr
 Shared pointer to yc_greater_than_node.
 
typedef std::shared_ptr< yc_not_less_than_nodeyask::yc_not_less_than_node_ptr
 Shared pointer to yc_not_less_than_node.
 
typedef std::shared_ptr< yc_not_greater_than_nodeyask::yc_not_greater_than_node_ptr
 Shared pointer to yc_not_greater_than_node.
 
typedef std::shared_ptr< yc_and_nodeyask::yc_and_node_ptr
 Shared pointer to yc_and_node.
 
typedef std::shared_ptr< yc_or_nodeyask::yc_or_node_ptr
 Shared pointer to yc_or_node.
 

Functions

 yask::UNARY_MATH_EXPR (sqrt)
 Create an expression node to calculate the square-root of the argument node.
 
 yask::UNARY_MATH_EXPR (cbrt)
 Create an expression node to calculate the cube-root of the argument node.
 
 yask::UNARY_MATH_EXPR (fabs)
 Create an expression node to calculate the absolute-value of the argument node.
 
 yask::UNARY_MATH_EXPR (erf)
 Create an expression node to calculate the error function of the argument node.
 
 yask::UNARY_MATH_EXPR (exp)
 Create an expression node to calculate the natural exponent of the argument node.
 
 yask::UNARY_MATH_EXPR (log)
 Create an expression node to calculate the natural log of the argument node.
 
 yask::UNARY_MATH_EXPR (sin)
 Create an expression node to calculate the sine of the argument node.
 
 yask::UNARY_MATH_EXPR (cos)
 Create an expression node to calculate the cosine of the argument node.
 
 yask::UNARY_MATH_EXPR (atan)
 Create an expression node to calculate the arc-tangent of the argument node.
 
 yask::BINARY_MATH_EXPR (pow)
 Power function.
 
 yask::BINARY_MATH_EXPR (min)
 Minimum function.
 
 yask::BINARY_MATH_EXPR (max)
 Maximum function.
 
yc_number_node_ptr yask::operator- (yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_negate_node().
 
yc_number_node_ptr yask::operator+ (yc_number_ptr_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_add_node().
 
yc_number_node_ptr yask::operator+ (yc_number_const_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_add_node().
 
yc_number_node_ptr yask::operator+ (yc_number_ptr_arg lhs, yc_number_const_arg rhs)
 Operator version of yc_node_factory::new_add_node().
 
yc_number_node_ptr yask::operator/ (yc_number_ptr_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_divide_node().
 
yc_number_node_ptr yask::operator/ (yc_number_const_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_divide_node().
 
yc_number_node_ptr yask::operator/ (yc_number_ptr_arg lhs, yc_number_const_arg rhs)
 Operator version of yc_node_factory::new_divide_node().
 
yc_number_node_ptr yask::operator% (yc_number_ptr_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_mod_node().
 
yc_number_node_ptr yask::operator% (yc_number_const_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_mod_node().
 
yc_number_node_ptr yask::operator% (yc_number_ptr_arg lhs, yc_number_const_arg rhs)
 Operator version of yc_node_factory::new_mod_node().
 
yc_number_node_ptr yask::operator* (yc_number_ptr_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_multiply_node().
 
yc_number_node_ptr yask::operator* (yc_number_const_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_multiply_node().
 
yc_number_node_ptr yask::operator* (yc_number_ptr_arg lhs, yc_number_const_arg rhs)
 Operator version of yc_node_factory::new_multiply_node().
 
yc_number_node_ptr yask::operator- (yc_number_ptr_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_subtract_node().
 
yc_number_node_ptr yask::operator- (yc_number_const_arg lhs, yc_number_ptr_arg rhs)
 Operator version of yc_node_factory::new_subtract_node().
 
yc_number_node_ptr yask::operator- (yc_number_ptr_arg lhs, yc_number_const_arg rhs)
 Operator version of yc_node_factory::new_subtract_node().
 
void yask::operator+= (yc_number_node_ptr &lhs, yc_number_node_ptr rhs)
 Shortcut for creating expression A = A + B.
 
void yask::operator+= (yc_number_node_ptr &lhs, yc_number_const_arg rhs)
 Shortcut for creating expression A = A + B.
 
void yask::operator-= (yc_number_node_ptr &lhs, yc_number_node_ptr rhs)
 Shortcut for creating expression A = A - B.
 
void yask::operator-= (yc_number_node_ptr &lhs, yc_number_const_arg rhs)
 Shortcut for creating expression A = A - B.
 
void yask::operator*= (yc_number_node_ptr &lhs, yc_number_node_ptr rhs)
 Shortcut for creating expression A = A * B.
 
void yask::operator*= (yc_number_node_ptr &lhs, yc_number_const_arg rhs)
 Shortcut for creating expression A = A * B.
 
void yask::operator/= (yc_number_node_ptr &lhs, yc_number_node_ptr rhs)
 Shortcut for creating expression A = A / B.
 
void yask::operator/= (yc_number_node_ptr &lhs, yc_number_const_arg rhs)
 Shortcut for creating expression A = A / B.
 
yc_bool_node_ptr yask::operator! (yc_bool_node_ptr rhs)
 Operator version of yc_node_factory::new_not_node().
 
yc_bool_node_ptr yask::operator|| (yc_bool_node_ptr lhs, yc_bool_node_ptr rhs)
 Operator version of yc_node_factory::new_or_node().
 
yc_bool_node_ptr yask::operator&& (yc_bool_node_ptr lhs, yc_bool_node_ptr rhs)
 Operator version of yc_node_factory::new_and_node().
 
yc_equation_node_ptr yask::operator EQUALS (yc_var_point_node_ptr gpp, const yc_number_any_arg rhs)
 The operator version of yc_node_factory::new_equation_node() used for defining a var-point value.
 
yc_equation_node_ptr yask::operator IF_DOMAIN (yc_equation_node_ptr expr, const yc_bool_node_ptr cond)
 The operator version of yc_equation_node::set_cond() to add a domain condition.
 
yc_equation_node_ptr yask::operator IF_STEP (yc_equation_node_ptr expr, const yc_bool_node_ptr cond)
 The operator version of yc_equation_node::set_step_cond() to add a domain condition.
 

Detailed Description

Types, clases, and functions used in the YASK Stencil Compiler API.

Macro Definition Documentation

◆ BINARY_MATH_EXPR

#define BINARY_MATH_EXPR (   fn_name)
Value:
yc_number_node_ptr fn_name(const yc_number_node_ptr arg1, const yc_number_node_ptr arg2); \
yc_number_node_ptr fn_name(double arg1, const yc_number_node_ptr arg2); \
yc_number_node_ptr fn_name(const yc_number_node_ptr arg1, double arg2)

Binary math functions. Used internally.

◆ BOOL_OPER

#define BOOL_OPER (   oper,
  fn 
)
Value:
inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_number_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_index_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_number_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_index_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_number_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_index_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, double rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); } \
inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, double rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); } \
inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, double rhs) { \
yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); }
std::shared_ptr< yc_bool_node > yc_bool_node_ptr
Shared pointer to yc_bool_node.
Definition yask_compiler_api.hpp:65

Binary numerical-to-boolean operators. Used internally to define ==, <, etc.

Must provide more explicit ptr-type operands than used with math operators to keep compiler from using built-in pointer comparison. Const values must be on RHS of operator, e.g., 'x > 5' is ok, but '5 < x' is not.

◆ EQUALS

#define EQUALS   <<

Recommended macro to make the "equality" operator readable and self-explanatory.

Uses an otherwise unneeded binary operator that has a lower priority than the math ops and a higher priority than the IF_* operators. See http://en.cppreference.com/w/cpp/language/operator_precedence. It is also required that this not be an operator that is defined for shared pointers. See https://en.cppreference.com/w/cpp/memory/shared_ptr.

◆ IF_DOMAIN

#define IF_DOMAIN   ^=

Recommended macro to make the domain-condition operator readable and self-explanatory.

Uses an otherwise unneeded binary operator that has a low priority. See http://en.cppreference.com/w/cpp/language/operator_precedence.

◆ IF_STEP

#define IF_STEP   |=

Recommended macro to make the step-condition operator readable and self-explanatory.

Uses an otherwise unneeded binary operator that has a low priority. See http://en.cppreference.com/w/cpp/language/operator_precedence.

Function Documentation

◆ BINARY_MATH_EXPR() [1/3]

yask::BINARY_MATH_EXPR ( pow  )

Power function.

Create an expression node to calculate the first argument node raised to the power of the second argument node.

◆ BINARY_MATH_EXPR() [2/3]

yask::BINARY_MATH_EXPR ( min  )

Minimum function.

Create an expression node to return the minimum of the first argument node and the second argument node.

◆ BINARY_MATH_EXPR() [3/3]

yask::BINARY_MATH_EXPR ( max  )

Maximum function.

Create an expression node to return the maximum of the first argument node and the second argument node.

◆ operator!()

yc_bool_node_ptr yask::operator! ( yc_bool_node_ptr  rhs)

Operator version of yc_node_factory::new_not_node().

For Python, use rhs.yc_not()

◆ operator||()

yc_bool_node_ptr yask::operator|| ( yc_bool_node_ptr  lhs,
yc_bool_node_ptr  rhs 
)

Operator version of yc_node_factory::new_or_node().

For Python, use lhs.yc_or(rhs)

◆ operator&&()

yc_bool_node_ptr yask::operator&& ( yc_bool_node_ptr  lhs,
yc_bool_node_ptr  rhs 
)

Operator version of yc_node_factory::new_and_node().

For Python, use lhs.yc_and(rhs)