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

#include <deps.h>

Public Member Functions

FindDeps mode (FindDepsMode m)
 
FindDeps type (DepType t)
 
FindDeps direction (const std::vector< FindDepsDir > &d)
 
FindDeps filterEarlier (const FindDepsAccPtFilter &f)
 
FindDeps filterLater (const FindDepsAccPtFilter &f)
 
FindDeps filter (const FindDepsFilter &f)
 
FindDeps filterSubAST (const ID &subAST)
 
FindDeps ignoreReductionWAW (bool flag)
 
FindDeps eraseOutsideVarDef (bool flag)
 
FindDeps noProjectOutPrivateAxis (bool flag)
 
FindDeps scope2CoordCallback (std::function< void(const ID &, const std::unordered_map< ID, std::vector< IterAxis > > &)> callback)
 
void operator() (const Stmt &op, const std::function< void(const Dependence &)> &found)
 
void operator() (const Stmt &op, const FindDepsCallback &found)
 
bool exists (const Stmt &op)
 
FindDeps filterAccess (const std::function< bool(const AccessPointBase &)> &f)
 
FindDeps filterAccess (const FindDepsAccFilter &f)
 

Detailed Description

Find dependences in an AST satisfiying given conditions

Conditions can be set with member functions, and finally FindDeps can be run via operator(), e.g. FindDeps().direction(...).filter(...)(...)

Member Function Documentation

◆ direction()

FindDeps freetensor::FindDeps::direction ( const std::vector< FindDepsDir > &  d)
inline

Check only for given directions on loops or parallel scopes

The direction array is in reduce_or [ reduce_and [ axis, mode ]] format.

E.g. 1, {{{L1, Same}, {L2, Normal}}} means dependences should happen inside one iteration of L1, AND happen along L2.

E.g. 2, {{{L1, Same}}, {{L2, Normal}}} means dependences should happen inside one iteration of L1, OR happen along L2.

Defaults to no restriction

◆ eraseOutsideVarDef()

FindDeps freetensor::FindDeps::eraseOutsideVarDef ( bool  flag)
inline

Ignore all dependences outside the VarDef

Defaults to true

◆ exists()

bool freetensor::FindDeps::exists ( const Stmt op)

Helper function to run FindDeps

Only to check whether there is a dependence satisfying given conditions, but not cared about what dependence it is

Parameters
op: AST root

◆ filter()

FindDeps freetensor::FindDeps::filter ( const FindDepsFilter f)
inline

Configure an additional callback to select which dependences to check

Please use filterAccess, filterEarlier or filterLater if possbile, for better performance

Defaults to no filter

◆ filterAccess() [1/2]

FindDeps freetensor::FindDeps::filterAccess ( const FindDepsAccFilter f)
inline

◆ filterAccess() [2/2]

FindDeps freetensor::FindDeps::filterAccess ( const std::function< bool(const AccessPointBase &)> &  f)
inline

Configure an additional callback to select the accesses to check

filterAccess is preferred over filterEarlier, filterLater and filter for performance

Defaults to no filter

Pass a normal function to be called sequentially, or pass a SyncFunc object to deciede whether to be called in parallel

◆ filterEarlier()

FindDeps freetensor::FindDeps::filterEarlier ( const FindDepsAccPtFilter f)
inline

Configure an additional callback to select the dependent (earlier) access to check

filterEarlier is perferred over filter for performance

Defaults to no filter

◆ filterLater()

FindDeps freetensor::FindDeps::filterLater ( const FindDepsAccPtFilter f)
inline

Configure an additional callback to select the depending (later) access to check

filterLater is perferred over filter for performance

Defaults to no filter

◆ filterSubAST()

FindDeps freetensor::FindDeps::filterSubAST ( const ID subAST)
inline

Help function to analyze a sub-AST only

◆ ignoreReductionWAW()

FindDeps freetensor::FindDeps::ignoreReductionWAW ( bool  flag)
inline

Ignore WAW dependences between two ReduceTo nodes. This kind of dependences are false dependences if running serially

Defaults to true

◆ mode()

FindDeps freetensor::FindDeps::mode ( FindDepsMode  m)
inline

Configure whether one access should depending on / be dependent by ALL INSTANCES of another access

Possible values are:

  • Dep: No restriction
  • KillEarlier: Any instance of the earlier statement / expression is dependent by later
  • KillLater: Any instance of the later statement is depending on earlier
  • KillBoth: KillEarlier + KillLater

Defaults to no restriction

Note: killing test is insensitive to loop-invariant, which means there will be false nagative

◆ noProjectOutPrivateAxis()

FindDeps freetensor::FindDeps::noProjectOutPrivateAxis ( bool  flag)
inline

Disable the projectOutPrivateAxis optimization. If you want to further check Presburger maps or sets in the found callback, you must set it to true

Defaults to false

◆ operator()() [1/2]

void freetensor::FindDeps::operator() ( const Stmt op,
const FindDepsCallback found 
)

Run FindDeps, with specified synchronize/unsynchronize

Parameters
op: AST root
found: callback

◆ operator()() [2/2]

void freetensor::FindDeps::operator() ( const Stmt op,
const std::function< void(const Dependence &)> &  found 
)
inline

Run FindDeps, synchronized as default

Parameters
op: AST root
found: callback

◆ scope2CoordCallback()

FindDeps freetensor::FindDeps::scope2CoordCallback ( std::function< void(const ID &, const std::unordered_map< ID, std::vector< IterAxis > > &)>  callback)
inline

◆ type()

FindDeps freetensor::FindDeps::type ( DepType  t)
inline

Check only for WAW, RAW and / or RAW dependences

Defaults to no restriction


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