YASK
Yet Another Stencil Kit: a software framework for creating HPC stencil code. Copyright 2014-2023 Intel Corporation.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
yask::yc_var Class Referenceabstract

A compile-time data variable. More...

#include <yask_compiler_api.hpp>

Public Member Functions

virtual const std::string & get_name () const =0
 Get the name of the var.
 
virtual int get_num_dims () const =0
 Get the number of dimensions.
 
virtual string_vec get_dim_names () const =0
 Get all the dimensions in this var.
 
virtual yc_var_point_node_ptr new_var_point (const std::vector< yc_number_node_ptr > &index_exprs)=0
 Create a reference to a point in this var.
 
virtual yc_var_point_node_ptr new_var_point (const std::initializer_list< yc_number_node_ptr > &index_exprs)=0
 Create a reference to a point in this var.
 
virtual bool is_dynamic_step_alloc () const =0
 [Advanced] Get whether the allocation of the step dimension of this var can be modified at run-time.
 
virtual void set_dynamic_step_alloc (bool is_dynamic)=0
 [Advanced] Set whether the allocation of the step dimension of this var can be modified at run-time.
 
virtual idx_t get_step_alloc_size () const =0
 [Advanced] Get the current allocation in the step dimension of this var.
 
virtual void set_step_alloc_size (idx_t size)=0
 [Advanced] Set the current allocation in the step dimension of this var.
 
virtual YASK_DEPRECATED yc_var_point_node_ptr new_relative_var_point (const std::vector< int > &dim_offsets)=0
 [Deprecated] Use new_var_point().
 
virtual YASK_DEPRECATED yc_var_point_node_ptr new_relative_var_point (const std::initializer_list< int > &dim_offsets)=0
 [Deprecated] Use new_var_point().
 
YASK_DEPRECATED yc_var_point_node_ptr new_grid_point (const std::vector< yc_number_node_ptr > &index_exprs)
 [Deprecated] Use new_var_point().
 
YASK_DEPRECATED yc_var_point_node_ptr new_grid_point (const std::initializer_list< yc_number_node_ptr > &index_exprs)
 [Deprecated] Use new_var_point().
 
virtual YASK_DEPRECATED yc_var_point_node_ptr new_relative_grid_point (const std::vector< int > &dim_offsets)=0
 [Deprecated] Use new_var_point().
 
virtual YASK_DEPRECATED yc_var_point_node_ptr new_relative_grid_point (const std::initializer_list< int > &dim_offsets)=0
 [Deprecated] Use new_var_point().
 

Detailed Description

A compile-time data variable.

"Var" is a generic term for any n-dimensional variable. A 0-dim var is a scalar, a 1-dim var is an array, etc. A compile-time variable is used for constructing stencil equations. It does not contain any data. Data is only stored during run-time, using a yk_var.

Created via yc_solution::new_var() or yc_solution::new_scratch_var() or implicitly via the yc_var_proxy constructor.

Member Function Documentation

◆ get_name()

virtual const std::string & yask::yc_var::get_name ( ) const
pure virtual

Get the name of the var.

Returns
String containing name provided via yc_solution::new_var() or yc_solution::new_scratch_var().

◆ get_num_dims()

virtual int yask::yc_var::get_num_dims ( ) const
pure virtual

Get the number of dimensions.

Returns
Number of dimensions created via yc_solution::new_var() or yc_solution::new_scratch_var().

◆ get_dim_names()

virtual string_vec yask::yc_var::get_dim_names ( ) const
pure virtual

Get all the dimensions in this var.

This is not necessarily a list of all the dimensions used in the yc_solution.

Returns
List of names of all the dimensions used in this var.

◆ new_var_point() [1/2]

virtual yc_var_point_node_ptr yask::yc_var::new_var_point ( const std::vector< yc_number_node_ptr > &  index_exprs)
pure virtual

Create a reference to a point in this var.

Each expression in index_exprs describes how to access an element in the corresponding dimension of the var.

Returns
Pointer to AST node used to read from or write to point in var.
Parameters
[in]index_exprsIndex expressions. These must appear in the same order as when the var was created.

◆ new_var_point() [2/2]

virtual yc_var_point_node_ptr yask::yc_var::new_var_point ( const std::initializer_list< yc_number_node_ptr > &  index_exprs)
pure virtual

Create a reference to a point in this var.

C++ initializer-list version with same semantics as the vector version of new_var_point().

See example code shown in yc_solution::new_var().

Note
Not available in the Python API. Use the vector version.
Returns
Pointer to AST node used to read or write from point in var.

◆ is_dynamic_step_alloc()

virtual bool yask::yc_var::is_dynamic_step_alloc ( ) const
pure virtual

[Advanced] Get whether the allocation of the step dimension of this var can be modified at run-time.

See yk_var::set_alloc_size().

◆ set_dynamic_step_alloc()

virtual void yask::yc_var::set_dynamic_step_alloc ( bool  is_dynamic)
pure virtual

[Advanced] Set whether the allocation of the step dimension of this var can be modified at run-time.

See yk_var::set_alloc_size().

Parameters
[in]is_dynamictrue to enable or false to disable.

◆ get_step_alloc_size()

virtual idx_t yask::yc_var::get_step_alloc_size ( ) const
pure virtual

[Advanced] Get the current allocation in the step dimension of this var.

If set_step_alloc_size() has been called, that setting will be returned. If set_step_alloc_size() has not been called, the default setting determined by the YASK compiler will be returned.

Returns
Allocation in the step dimension.

◆ set_step_alloc_size()

virtual void yask::yc_var::set_step_alloc_size ( idx_t  size)
pure virtual

[Advanced] Set the current allocation in the step dimension of this var.

Override the default setting determined by the YASK compiler for allocation in the step dimension.

Parameters
[in]sizeNumber of elements to allocate in the step dimension.

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