FasTensor  1.0.0
Transform Supercomputing for AI
Public Member Functions | List of all members
Stencil< T > Class Template Reference

#include <src/ft_stencil.h>

Public Member Functions

 Stencil ()
 
 Stencil (int dims_input, T *chunk)
 
 Stencil (T value_p)
 Construct a new Stencil object contains the value Mostly, it is used as output. More...
 
 Stencil (T value_p, std::vector< size_t > shape_p)
 Construct a new Stencil object contains the value and the value has the shape for n-dimensional array Mostly, it is used as output. More...
 
 Stencil (unsigned long long my_offset, T *chunk, std::vector< unsigned long long > &my_coordinate, std::vector< unsigned long long > &chunk_size, std::vector< unsigned long long > &global_data_size_p)
 
 ~Stencil ()
 
template<typename... Is>
operator() (Is... offsets) const
 
ReadPoint (std::vector< int > &ov) const
 
template<class TO >
void operator= (TO &others)
 
bool has_output_value ()
 
void ReadHoodBorder (std::vector< T > &rv, std::vector< int > &start_offset, std::vector< int > &end_offset) const
 
int ReadNeighbors (std::vector< int > &start_offset, std::vector< int > &end_offset, std::vector< T > &rv) const
 read neighborhood More...
 
std::vector< T > ReadNeighbors (std::vector< int > &start_offset, std::vector< int > &end_offset) const
 read neighborhood More...
 
int WriteNeighbors (std::vector< int > &start_offset, std::vector< int > &end_offset, std::vector< T > &data) const
 WriteHood. More...
 
get_value ()
 Get the value object. More...
 
void set_value (const T value_p)
 Set the value object. More...
 
GetValue ()
 Get the Value object. More...
 
int GetValue (T &value_p)
 
int SetValue (const T value_p)
 Set the value object. More...
 
unsigned long long get_local_neighbors_count_at_left () const
 
get_prev_value ()
 
void SetLocation (unsigned long long my_offset, std::vector< unsigned long long > &my_coordinate, std::vector< unsigned long long > &my_location_no_ol_p, std::vector< unsigned long long > &chunk_dim_size_no_ol_p, std::vector< long long > ol_origin_offset_p, std::vector< unsigned long long > current_chunk_ol_size)
 
void SetLocation (unsigned long long &my_offset, std::vector< unsigned long long > &my_coordinate, std::vector< unsigned long long > &my_location_no_ol_p, std::vector< unsigned long long > &chunk_dim_size_no_ol_p, std::vector< long long > &ol_origin_offset_p, std::vector< unsigned long long > &current_chunk_ol_size, std::vector< unsigned long long > &global_coordinate_p, unsigned long long &global_coordinate_lineared_p)
 Set the Location object. More...
 
std::vector< unsigned long long > GetCoordinate () const
 return the global coodinate of the current Stencil More...
 
std::vector< unsigned long long > GetGlobalCoordinate () const
 
int GetGlobalIndex (std::vector< unsigned long long > &index_p) const
 
int GetLocalIndex (std::vector< unsigned long long > &index_p) const
 
int GetTrailRunResult (std::vector< int > &overlap_size_p)
 
void set_my_g_location_rm (unsigned long long lrm)
 
unsigned long long get_my_g_location_rm () const
 
unsigned long long get_id () const
 
void SetOutputVectorFlag (const bool is_output_vector_flag_p)
 Set the Output Vector Flag object. More...
 
bool GetOutputVectorFlag ()
 Get the Output Vector Flag object. More...
 
void SetOutputVectorFlatDirection (OutputVectorFlatDirection output_vector_flat_direction_p)
 
OutputVectorFlatDirection GetOutputVectorFlatDirection ()
 
void SetPadding (T padding_value_p)
 Set the Padding object. More...
 
GetPadding ()
 Get the Padding object. More...
 
int SetShape (const std::vector< size_t > &shape_p)
 Set the Shape of the Stencil object. More...
 
int GetShape (std::vector< size_t > &shape_p)
 Get the Output Vector Shape object. More...
 
int GetOffsetUpper (std::vector< int > &max_offset) const
 Get the Max Offset Upper. More...
 
int GetOffsetLower (std::vector< int > &max_offset) const
 Get the Max Offset lower. More...
 
unsigned long long GetChunkID () const
 
int GetChunkID (unsigned long long &chunk_id_p) const
 
void SetChunkID (unsigned long long chunk_id_p)
 
int SetTagMap (std::map< std::string, std::string > &stencil_tag_map_p)
 
int GetTagMap (std::map< std::string, std::string > &stencil_tag_map_p) const
 
bool HasTagMap () const
 
int GetCurrentChunkSize (std::vector< unsigned long long > &chunk_size) const
 Get the size of the current chunk which base cell is located This may be different from one run to another. More...
 
int GetArraySize (std::vector< unsigned long long > &array_size) const
 
int SetArraySize (std::vector< unsigned long long > &array_size) const
 

Detailed Description

template<class T>
class Stencil< T >

Examples
ft_example_1f1p.cpp, ft_example_base.cpp, ft_example_cache.cpp, ft_example_cmpd.cpp, ft_example_filter.cpp, ft_example_kf1p.cpp, ft_example_padding.cpp, ft_example_reduce.cpp, ft_example_reduce2D_1f1p.cpp, ft_example_simple.cpp, ft_example_stack.cpp, ft_example_tag.cpp, ft_example_vds.cpp, ft_example_vector.cpp, and ft_example_vector_2d.cpp.

Constructor & Destructor Documentation

◆ Stencil() [1/5]

template<class T >
Stencil< T >::Stencil ( )
inline

◆ Stencil() [2/5]

template<class T >
Stencil< T >::Stencil ( int  dims_input,
T *  chunk 
)
inline

◆ Stencil() [3/5]

template<class T >
Stencil< T >::Stencil ( value_p)
inline

Construct a new Stencil object contains the value Mostly, it is used as output.

Parameters
value,valueto be contained

◆ Stencil() [4/5]

template<class T >
Stencil< T >::Stencil ( value_p,
std::vector< size_t >  shape_p 
)
inline

Construct a new Stencil object contains the value and the value has the shape for n-dimensional array Mostly, it is used as output.

Parameters
value,thevalue to be contained in Stencil object
shape,theshape fo the output data

◆ Stencil() [5/5]

template<class T >
Stencil< T >::Stencil ( unsigned long long  my_offset,
T *  chunk,
std::vector< unsigned long long > &  my_coordinate,
std::vector< unsigned long long > &  chunk_size,
std::vector< unsigned long long > &  global_data_size_p 
)
inline

◆ ~Stencil()

template<class T >
Stencil< T >::~Stencil ( )
inline

Member Function Documentation

◆ get_id()

template<class T >
unsigned long long Stencil< T >::get_id ( ) const
inline

◆ get_local_neighbors_count_at_left()

template<class T >
unsigned long long Stencil< T >::get_local_neighbors_count_at_left ( ) const
inline

◆ get_my_g_location_rm()

template<class T >
unsigned long long Stencil< T >::get_my_g_location_rm ( ) const
inline

◆ get_prev_value()

template<class T >
T Stencil< T >::get_prev_value ( )
inline

◆ get_value()

template<class T >
T Stencil< T >::get_value ( )
inline

Get the value object.

Returns
T

◆ GetArraySize()

template<class T >
int Stencil< T >::GetArraySize ( std::vector< unsigned long long > &  array_size) const
inline

◆ GetChunkID() [1/2]

template<class T >
unsigned long long Stencil< T >::GetChunkID ( ) const
inline

◆ GetChunkID() [2/2]

template<class T >
int Stencil< T >::GetChunkID ( unsigned long long &  chunk_id_p) const
inline

◆ GetCoordinate()

template<class T >
std::vector<unsigned long long> Stencil< T >::GetCoordinate ( ) const
inline

return the global coodinate of the current Stencil

Returns
std::vector<unsigned long long>
Examples
ft_example_reduce2D_1f1p.cpp, and ft_example_stack.cpp.

◆ GetCurrentChunkSize()

template<class T >
int Stencil< T >::GetCurrentChunkSize ( std::vector< unsigned long long > &  chunk_size) const
inline

Get the size of the current chunk which base cell is located This may be different from one run to another.

Parameters
chunk_size,thesize of the current chunk
Returns
int

◆ GetGlobalCoordinate()

template<class T >
std::vector<unsigned long long> Stencil< T >::GetGlobalCoordinate ( ) const
inline

◆ GetGlobalIndex()

template<class T >
int Stencil< T >::GetGlobalIndex ( std::vector< unsigned long long > &  index_p) const
inline

◆ GetLocalIndex()

template<class T >
int Stencil< T >::GetLocalIndex ( std::vector< unsigned long long > &  index_p) const
inline

◆ GetOffsetLower()

template<class T >
int Stencil< T >::GetOffsetLower ( std::vector< int > &  max_offset) const
inline

Get the Max Offset lower.

Returns
std::vector<int> , the maximum offset at lower side (including)

◆ GetOffsetUpper()

template<class T >
int Stencil< T >::GetOffsetUpper ( std::vector< int > &  max_offset) const
inline

Get the Max Offset Upper.

Returns
std::vector<int> , the maximum offset at upper side (including)

◆ GetOutputVectorFlag()

template<class T >
bool Stencil< T >::GetOutputVectorFlag ( )
inline

Get the Output Vector Flag object.

Returns
true
false

◆ GetOutputVectorFlatDirection()

template<class T >
OutputVectorFlatDirection Stencil< T >::GetOutputVectorFlatDirection ( )
inline

◆ GetPadding()

template<class T >
T Stencil< T >::GetPadding ( )
inline

Get the Padding object.

Returns
T

◆ GetShape()

template<class T >
int Stencil< T >::GetShape ( std::vector< size_t > &  shape_p)
inline

Get the Output Vector Shape object.

Returns
std::vector<size_t>

◆ GetTagMap()

template<class T >
int Stencil< T >::GetTagMap ( std::map< std::string, std::string > &  stencil_tag_map_p) const
inline

◆ GetTrailRunResult()

template<class T >
int Stencil< T >::GetTrailRunResult ( std::vector< int > &  overlap_size_p)
inline

◆ GetValue() [1/2]

template<class T >
T Stencil< T >::GetValue ( )
inline

Get the Value object.

Returns
T

◆ GetValue() [2/2]

template<class T >
int Stencil< T >::GetValue ( T &  value_p)
inline

◆ has_output_value()

template<class T >
bool Stencil< T >::has_output_value ( )
inline

◆ HasTagMap()

template<class T >
bool Stencil< T >::HasTagMap ( ) const
inline

◆ operator()()

template<class T >
template<typename... Is>
T Stencil< T >::operator() ( Is...  offsets) const
inline

◆ operator=()

template<class T >
template<class TO >
void Stencil< T >::operator= ( TO &  others)
inline

◆ ReadHoodBorder()

template<class T >
void Stencil< T >::ReadHoodBorder ( std::vector< T > &  rv,
std::vector< int > &  start_offset,
std::vector< int > &  end_offset 
) const
inline

◆ ReadNeighbors() [1/2]

template<class T >
std::vector<T> Stencil< T >::ReadNeighbors ( std::vector< int > &  start_offset,
std::vector< int > &  end_offset 
) const
inline

read neighborhood

Parameters
start_offset
end_offset
Returns
std::vector<T>

◆ ReadNeighbors() [2/2]

template<class T >
int Stencil< T >::ReadNeighbors ( std::vector< int > &  start_offset,
std::vector< int > &  end_offset,
std::vector< T > &  rv 
) const
inline

read neighborhood

Parameters
start_offset
end_offset
Returns
std::vector<T>

◆ ReadPoint()

template<class T >
T Stencil< T >::ReadPoint ( std::vector< int > &  ov) const
inline

◆ set_my_g_location_rm()

template<class T >
void Stencil< T >::set_my_g_location_rm ( unsigned long long  lrm)
inline

◆ set_value()

template<class T >
void Stencil< T >::set_value ( const T  value_p)
inline

Set the value object.

Parameters
value_p

◆ SetArraySize()

template<class T >
int Stencil< T >::SetArraySize ( std::vector< unsigned long long > &  array_size) const
inline

◆ SetChunkID()

template<class T >
void Stencil< T >::SetChunkID ( unsigned long long  chunk_id_p)
inline

◆ SetLocation() [1/2]

template<class T >
void Stencil< T >::SetLocation ( unsigned long long &  my_offset,
std::vector< unsigned long long > &  my_coordinate,
std::vector< unsigned long long > &  my_location_no_ol_p,
std::vector< unsigned long long > &  chunk_dim_size_no_ol_p,
std::vector< long long > &  ol_origin_offset_p,
std::vector< unsigned long long > &  current_chunk_ol_size,
std::vector< unsigned long long > &  global_coordinate_p,
unsigned long long &  global_coordinate_lineared_p 
)
inline

Set the Location object.

Parameters
my_offsetwithin the local chunk
my_coordinatewithin the local chunk
my_location_no_ol_p
chunk_dim_size_no_ol_pchunk size withiout considering overlap
ol_origin_offset_pchunk offset from the global (0, 0)
current_chunk_ol_sizeoverlap size
global_coordinatecurrent cell's global coodinate
global_coordinate_lmlinearized global_coordinate

◆ SetLocation() [2/2]

template<class T >
void Stencil< T >::SetLocation ( unsigned long long  my_offset,
std::vector< unsigned long long > &  my_coordinate,
std::vector< unsigned long long > &  my_location_no_ol_p,
std::vector< unsigned long long > &  chunk_dim_size_no_ol_p,
std::vector< long long >  ol_origin_offset_p,
std::vector< unsigned long long >  current_chunk_ol_size 
)
inline

◆ SetOutputVectorFlag()

template<class T >
void Stencil< T >::SetOutputVectorFlag ( const bool  is_output_vector_flag_p)
inline

Set the Output Vector Flag object.

Parameters
is_output_vector_flag_p: true or false

◆ SetOutputVectorFlatDirection()

template<class T >
void Stencil< T >::SetOutputVectorFlatDirection ( OutputVectorFlatDirection  output_vector_flat_direction_p)
inline

◆ SetPadding()

template<class T >
void Stencil< T >::SetPadding ( padding_value_p)
inline

Set the Padding object.

Parameters
padding_value_p

◆ SetShape()

template<class T >
int Stencil< T >::SetShape ( const std::vector< size_t > &  shape_p)
inline

Set the Shape of the Stencil object.

Parameters
shape_pshape vector
Examples
ft_example_vector.cpp, and ft_example_vector_2d.cpp.

◆ SetTagMap()

template<class T >
int Stencil< T >::SetTagMap ( std::map< std::string, std::string > &  stencil_tag_map_p)
inline

◆ SetValue()

template<class T >
int Stencil< T >::SetValue ( const T  value_p)
inline

Set the value object.

Parameters
value_p

◆ WriteNeighbors()

template<class T >
int Stencil< T >::WriteNeighbors ( std::vector< int > &  start_offset,
std::vector< int > &  end_offset,
std::vector< T > &  data 
) const
inline

WriteHood.

Parameters
start_offset
end_offset
data
Returns
int

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