GPUOcelot
Public Member Functions

analysis::DivergenceGraph Class Reference

#include <DivergenceGraph.h>

Inheritance diagram for analysis::DivergenceGraph:
Inheritance graph
[legend]
Collaboration diagram for analysis::DivergenceGraph:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void clear ()
 Clears the divergence graph.
 DivergenceGraph ()
 ~DivergenceGraph ()
void insertSpecialSource (const ir::PTXOperand *tid)
 Insert a special register source, possible source of divergence.
void eraseSpecialSource (const ir::PTXOperand *tid)
 Removes a special register source.
void setAsDiv (const node_type &node)
 Define a node as being divergent, not depending on it's predecessors.
void unsetAsDiv (const node_type &node)
 Unset a node as being divergent, not depending on it's predecessors.
bool eraseNode (const node_type &nodeId)
 Removes a node from the divergence graph.
bool eraseNode (const node_iterator &node)
 Removes a node from the divergence graph.
int insertEdge (const node_type &fromNode, const node_type &toNode, const bool createNewNodes=true)
 Inserts a edge[arrow] between two nodes of the graph / Can create nodes if they don't exist.
int insertEdge (const ir::PTXOperand *origin, const node_type &toNode, const bool createNewNodes=true)
 Inserts a edge[arrow] between two nodes of the graph / Can create nodes if they don't exist.
int eraseEdge (const node_type &fromNode, const node_type &toNode, const bool removeIsolatedNodes=false)
 Inserts a edge[arrow] between two nodes of the graph / Can remove nodes if they are isolated.
int eraseEdge (const ir::PTXOperand *origin, const node_type &toNode, const bool removeIsolatedNodes=false)
const node_set getDivNodes () const
 Gests a list[set] of the divergent nodes.
bool isDivNode (const node_type &node) const
 Tests if a node is divergent.
bool isDivSource (const node_type &node) const
 Tests if a node is a divergence source.
bool isDivSource (const ir::PTXOperand *srt) const
 Tests if a special register is source of divergence.
bool hasSpecial (const ir::PTXOperand *special) const
 Tests if a special register is present on the graph.
size_t divNodesCount () const
 Gives the number of divergent nodes.
node_iterator beginDivNodes () const
node_iterator endDivNodes () const
void computeDivergence ()
 Computes divergence spread 1) Clear preview divergent nodes list 2) Set all nodes that are directly dependent of a divergent source {tidX, tidY, tidZ and laneid } as new divergent nodes 3) Set all nodes that are explicitly defined as divergence sources as new divergent nodes 4) For each new divergent nodes 4.1) Set all non divergent nodes that depend directly on the divergent node as new divergent nodes 4.1.1) Go to step 4 after step 4.3 until there are new divergent nodes 4.2) Insert the node to the divergent nodes list 4.3) Remove the node from the new divergent list.
std::string getSpecialName (const ir::PTXOperand *in) const
 Gives a string as name for a special register.
std::ostream & print (std::ostream &out) const
 Prints the divergence graph in dot language.

Constructor & Destructor Documentation

analysis::DivergenceGraph::DivergenceGraph ( ) [inline]
analysis::DivergenceGraph::~DivergenceGraph ( ) [inline]

Member Function Documentation

node_iterator analysis::DivergenceGraph::beginDivNodes ( ) const [inline]
void analysis::DivergenceGraph::clear ( )

Clears the divergence graph.

Reimplemented from analysis::DirectionalGraph.

void analysis::DivergenceGraph::computeDivergence ( )

Computes divergence spread 1) Clear preview divergent nodes list 2) Set all nodes that are directly dependent of a divergent source {tidX, tidY, tidZ and laneid } as new divergent nodes 3) Set all nodes that are explicitly defined as divergence sources as new divergent nodes 4) For each new divergent nodes 4.1) Set all non divergent nodes that depend directly on the divergent node as new divergent nodes 4.1.1) Go to step 4 after step 4.3 until there are new divergent nodes 4.2) Insert the node to the divergent nodes list 4.3) Remove the node from the new divergent list.

size_t analysis::DivergenceGraph::divNodesCount ( ) const

Gives the number of divergent nodes.

node_iterator analysis::DivergenceGraph::endDivNodes ( ) const [inline]
int analysis::DivergenceGraph::eraseEdge ( const node_type fromNode,
const node_type toNode,
const bool  removeIsolatedNodes = false 
)

Inserts a edge[arrow] between two nodes of the graph / Can remove nodes if they are isolated.

Reimplemented from analysis::DirectionalGraph.

int analysis::DivergenceGraph::eraseEdge ( const ir::PTXOperand origin,
const node_type toNode,
const bool  removeIsolatedNodes = false 
)
bool analysis::DivergenceGraph::eraseNode ( const node_type nodeId)

Removes a node from the divergence graph.

Reimplemented from analysis::DirectionalGraph.

bool analysis::DivergenceGraph::eraseNode ( const node_iterator node)

Removes a node from the divergence graph.

Reimplemented from analysis::DirectionalGraph.

void analysis::DivergenceGraph::eraseSpecialSource ( const ir::PTXOperand tid)

Removes a special register source.

const DirectionalGraph::node_set analysis::DivergenceGraph::getDivNodes ( ) const

Gests a list[set] of the divergent nodes.

std::string analysis::DivergenceGraph::getSpecialName ( const ir::PTXOperand in) const

Gives a string as name for a special register.

bool analysis::DivergenceGraph::hasSpecial ( const ir::PTXOperand special) const

Tests if a special register is present on the graph.

int analysis::DivergenceGraph::insertEdge ( const ir::PTXOperand origin,
const node_type toNode,
const bool  createNewNodes = true 
)

Inserts a edge[arrow] between two nodes of the graph / Can create nodes if they don't exist.

int analysis::DivergenceGraph::insertEdge ( const node_type fromNode,
const node_type toNode,
const bool  createNewNodes = true 
)

Inserts a edge[arrow] between two nodes of the graph / Can create nodes if they don't exist.

Reimplemented from analysis::DirectionalGraph.

void analysis::DivergenceGraph::insertSpecialSource ( const ir::PTXOperand tid)

Insert a special register source, possible source of divergence.

bool analysis::DivergenceGraph::isDivNode ( const node_type node) const

Tests if a node is divergent.

bool analysis::DivergenceGraph::isDivSource ( const ir::PTXOperand srt) const

Tests if a special register is source of divergence.

bool analysis::DivergenceGraph::isDivSource ( const node_type node) const

Tests if a node is a divergence source.

std::ostream & analysis::DivergenceGraph::print ( std::ostream &  out) const

Prints the divergence graph in dot language.

Reimplemented from analysis::DirectionalGraph.

void analysis::DivergenceGraph::setAsDiv ( const node_type node)

Define a node as being divergent, not depending on it's predecessors.

void analysis::DivergenceGraph::unsetAsDiv ( const node_type node)

Unset a node as being divergent, not depending on it's predecessors.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines