GPUOcelot
Classes | Public Types | Public Member Functions | Static Public Member Functions

ir::PTXKernel Class Reference

#include <PTXKernel.h>

Inheritance diagram for ir::PTXKernel:
Inheritance graph
[legend]
Collaboration diagram for ir::PTXKernel:
Collaboration graph
[legend]

List of all members.

Classes

class  Prototype
 Defines a prototype for each kernel and function. More...

Public Types

typedef std::vector< PTXStatementPTXStatementVector
 Vector of statements.
typedef std::unordered_map
< std::string,
PTXOperand::RegisterType
RegisterMap
 A map from strings to registers.
typedef
analysis::DataflowGraph::RegisterVector 
RegisterVector
 A set of registers.

Public Member Functions

void constructCFG (ControlFlowGraph &cfg, PTXStatementVector::const_iterator kernelStart, PTXStatementVector::const_iterator kernelEnd)
 PTXKernel (const std::string &name="", bool isFunction=false, const ir::Module *module=0)
 Constructs a blank new PTX kernel.
 PTXKernel (PTXStatementVector::const_iterator start, PTXStatementVector::const_iterator end, bool isFunction)
 PTXKernel (const PTXKernel &k)
 Copy constructor (deep)
const PTXKerneloperator= (const PTXKernel &k)
 Assignment operator (deep)
RegisterVector getReferencedRegisters () const
 Get the set of all referenced registers in the instruction set.
Prototype getPrototype () const
 returns a prototype for this kernel
analysis::ProgramStructureGraphgetProgramStructureGraph ()
virtual void canonicalBlockLabels (int kernelID=1)
 renames all the blocks with canonical names
virtual bool executable () const
virtual void write (std::ostream &stream) const
 Write this kernel to a parseable string.

Static Public Member Functions

static RegisterMap assignRegisters (ControlFlowGraph &cfg)
 Assigns register IDs to identifiers.

Detailed Description

A specialization of the kernel class for PTX


Member Typedef Documentation

Vector of statements.

typedef std::unordered_map<std::string, PTXOperand::RegisterType> ir::PTXKernel::RegisterMap

A map from strings to registers.

A set of registers.


Constructor & Destructor Documentation

ir::PTXKernel::PTXKernel ( const std::string &  name = "",
bool  isFunction = false,
const ir::Module module = 0 
)

Constructs a blank new PTX kernel.

Parameters:
nameThe name of the kernel
isFunctionIs this a kernel or a function?
ir::PTXKernel::PTXKernel ( PTXStatementVector::const_iterator  start,
PTXStatementVector::const_iterator  end,
bool  isFunction 
)

Constructs a kernel from an iterator into the PTXStatementVector

Parameters:
startiterator into start of kernel
enditerator into end of kernel
ir::PTXKernel::PTXKernel ( const PTXKernel k)

Copy constructor (deep)


Member Function Documentation

PTXKernel::RegisterMap ir::PTXKernel::assignRegisters ( ControlFlowGraph cfg) [static]

Assigns register IDs to identifiers.

void ir::PTXKernel::canonicalBlockLabels ( int  kernelID = 1) [virtual]

renames all the blocks with canonical names

void ir::PTXKernel::constructCFG ( ControlFlowGraph cfg,
PTXStatementVector::const_iterator  kernelStart,
PTXStatementVector::const_iterator  kernelEnd 
)

Constructs a control flow graph from iterators into the Module's PTXStatement vector

Parameters:
referenceto newly constructed CFG
kernelStartiterator to start of kernel [i.e. the entry statement]
kenelEnditerator to end of kernel [i.e. the EndEntry statement]
Returns:
true on successful creation
bool ir::PTXKernel::executable ( ) const [virtual]

Returns true if the kernel instance is derived from ExecutableKernel

Reimplemented from ir::IRKernel.

analysis::ProgramStructureGraph* ir::PTXKernel::getProgramStructureGraph ( )
ir::PTXKernel::Prototype ir::PTXKernel::getPrototype ( ) const

returns a prototype for this kernel

PTXKernel::RegisterVector ir::PTXKernel::getReferencedRegisters ( ) const

Get the set of all referenced registers in the instruction set.

const PTXKernel & ir::PTXKernel::operator= ( const PTXKernel k)

Assignment operator (deep)

void ir::PTXKernel::write ( std::ostream &  stream) const [virtual]

Write this kernel to a parseable string.

Reimplemented from ir::Kernel.


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