GPUOcelot
Public Types | Public Member Functions | Public Attributes | Protected Attributes

ir::Kernel Class Reference

#include <Kernel.h>

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

List of all members.

Public Types

typedef std::vector< ParameterParameterVector
 Vector of parameters.
typedef std::map< std::string,
Parameter
ParameterMap
 Map from names to parameters.
typedef std::map< std::string,
Local
LocalMap
 Map from names to local variables.

Public Member Functions

 Kernel (Instruction::Architecture isa=Instruction::Unknown, const std::string &name="", bool isFunction=false, const ir::Module *module=0)
virtual ~Kernel ()
 Kernel (const Kernel &k)
 Copy constructor (deep)
const Kerneloperator= (const Kernel &k)
 Assignment operator (deep)
virtual void write (std::ostream &stream) const
 Write this kernel to a parseable string.
ParametergetParameter (const std::string &name)
const ParametergetParameter (const std::string &name) const
void insertParameter (const ir::Parameter &param, bool asParameter=true)
bool function () const
 Is this kernel actually a function, not a kernel?

Public Attributes

std::string name
Instruction::Architecture ISA
ParameterVector arguments
ParameterMap parameters
LocalMap locals
 Local variables.
const Modulemodule

Protected Attributes

bool _function
 Is this kernel a function?

Detailed Description

Base class for kernels


Member Typedef Documentation

typedef std::map<std::string, Local> ir::Kernel::LocalMap

Map from names to local variables.

typedef std::map<std::string, Parameter> ir::Kernel::ParameterMap

Map from names to parameters.

typedef std::vector<Parameter> ir::Kernel::ParameterVector

Vector of parameters.


Constructor & Destructor Documentation

ir::Kernel::Kernel ( Instruction::Architecture  isa = Instruction::Unknown,
const std::string &  name = "",
bool  isFunction = false,
const ir::Module module = 0 
)

Constructs an empty kernel

ir::Kernel::~Kernel ( ) [virtual]

Destructs kernel

ir::Kernel::Kernel ( const Kernel k)

Copy constructor (deep)


Member Function Documentation

bool ir::Kernel::function ( ) const

Is this kernel actually a function, not a kernel?

const ir::Parameter * ir::Kernel::getParameter ( const std::string &  name) const

Returns a const pointer to a parameter identified by 'name'

ir::Parameter * ir::Kernel::getParameter ( const std::string &  name)

Returns a pointer to a parameter identified by 'name'

void ir::Kernel::insertParameter ( const ir::Parameter param,
bool  asParameter = true 
)

Inserts a parameter into the appropriate data structure

Parameters:
paramdefines parameter to insert
asParameterif true, assumes this is param declaration that is not a kernel argument
const ir::Kernel & ir::Kernel::operator= ( const Kernel k)

Assignment operator (deep)

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

Write this kernel to a parseable string.

Reimplemented in ir::PTXKernel.


Member Data Documentation

bool ir::Kernel::_function [protected]

Is this kernel a function?

Set of parameters in order specified in the kernel's definition

Instruction Set Architecture of the kernel

Local variables.

Pointer to the module this kernel belongs to

std::string ir::Kernel::name

[mangled] name of kernel within module

Set of parameters that are not kernel arguments


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