FreeTensor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
freetensor::ReduceToNode Class Reference

#include <stmt.h>

Inheritance diagram for freetensor::ReduceToNode:
Inheritance graph
[legend]
Collaboration diagram for freetensor::ReduceToNode:
Collaboration graph
[legend]

Public Member Functions

void compHash () override
 
- Public Member Functions inherited from freetensor::StmtNode
void setId (const ID &id=ID::make())
 
ID id () const
 
const Metadatametadata () const
 
Metadatametadata ()
 
bool isStmt () const override
 
virtual bool isCtrlFlow () const
 
virtual std::vector< Ref< StmtNode > > children () const
 
Ref< StmtNodeprevLeafStmtInDFSOrder () const
 
Ref< StmtNodenextLeafStmtInDFSOrder () const
 
Ref< StmtNodeprevStmtInDFSPostOrder () const
 
Ref< StmtNodenextStmtInDFSPreOrder () const
 
Ref< StmtNodeancestorById (const ID &lookup) const
 
bool isAncestorOf (const Stmt &other) const
 
bool isBefore (const Stmt &other) const
 
 DEFINE_NODE_ACCESS (Stmt)
 
Ref< StmtNodeparentStmt () const
 
Ref< StmtNodeparentStmtByFilter (const std::function< bool(const Stmt &)> &filter) const
 
Ref< StmtNodeprevStmt () const
 
Ref< StmtNodenextStmt () const
 
Ref< StmtNodeparentCtrlFlow () const
 
Ref< StmtNodeprevInCtrlFlow () const
 
Ref< StmtNodenextInCtrlFlow () const
 
- Public Member Functions inherited from freetensor::ASTNode
virtual ~ASTNode ()
 
virtual ASTNodeType nodeType () const =0
 
bool isAST () const override
 
virtual bool isFunc () const
 
virtual bool isStmt () const
 
virtual bool isExpr () const
 
Ref< ASTNodeparentAST () const
 
std::source_location debugBlame () const
 
void setDebugBlame (std::source_location loc)
 
 DEFINE_NODE_ACCESS (AST)
 
- Public Member Functions inherited from freetensor::ASTPart
virtual ~ASTPart ()
 
 ASTPart (ASTPart &&other)
 
 ASTPart (const ASTPart &other)
 
ASTPartoperator= (ASTPart &&)
 
ASTPartoperator= (const ASTPart &)
 
bool trySetParent (const Ref< ASTPart > &parent)
 
void resetParent ()
 
Ref< ASTPartparent () const
 
bool isSubTree () const
 
int depth () const
 
virtual void modifiedHook ()
 
size_t hash ()
 
virtual bool isAST () const
 
- Public Member Functions inherited from freetensor::EnableSelf< ASTPart >
Ref< ASTPartself () const
 

Public Attributes

std::string var_
 
SubTreeList< ExprNodeindices_ = ChildOf{this}
 
ReduceOp op_
 
SubTree< ExprNodeexpr_ = ChildOf{this}
 
bool sync_
 

Additional Inherited Members

- Public Types inherited from freetensor::EnableSelf< ASTPart >
typedef ASTPart Self
 
- Protected Member Functions inherited from freetensor::ASTPart
void lock ()
 
void unlock ()
 
virtual void compHash ()=0
 
void resetHash ()
 
- Protected Attributes inherited from freetensor::ASTPart
size_t hash_ = ~0ull
 
std::atomic_flag lock_ = ATOMIC_FLAG_INIT
 

Detailed Description

A variant of Store for +=, -=, *=, etc

Example: var_[indices_] += expr_

These operations follow commutative law. Making them the special ReduceTo nodes helps analyzing dependences more accurately

Member Function Documentation

◆ compHash()

void freetensor::ReduceToNode::compHash ( )
overridevirtual

Implements freetensor::ASTPart.

Member Data Documentation

◆ expr_

SubTree<ExprNode> freetensor::ReduceToNode::expr_ = ChildOf{this}

◆ indices_

SubTreeList<ExprNode> freetensor::ReduceToNode::indices_ = ChildOf{this}

◆ op_

ReduceOp freetensor::ReduceToNode::op_

◆ sync_

bool freetensor::ReduceToNode::sync_

If true, can safely reduce from multiple threads to one location. Prefer atomic over other synchronizations

NOTE: Synchronizations only have to be done among ReduceTo nodes. No need to synchronize between a ReduceTo and a Load, or a ReduceTo and a Store, since our schedules prohibits simultaneous ReduceTo and Load, or ReduceTo and Store.

◆ var_

std::string freetensor::ReduceToNode::var_

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