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

translator::Translator Class Reference

An interface for a translator from one ISA to another. More...

#include <Translator.h>

Inheritance diagram for translator::Translator:
Inheritance graph
[legend]
Collaboration diagram for translator::Translator:
Collaboration graph
[legend]

List of all members.

Classes

class  Exception
 An exception for distinguishing between exceptions. More...

Public Types

enum  OptimizationLevel {
  NoOptimization = 0x0, ReportOptimization, DebugOptimization, InstrumentOptimization,
  MemoryCheckOptimization, BasicOptimization, AggressiveOptimization, SpaceOptimization,
  FullOptimization
}
 

All possible optimization levels.

More...

Public Member Functions

 Translator (ir::Instruction::Architecture s, ir::Instruction::Architecture t, OptimizationLevel l=NoOptimization, int r=Analysis::NoAnalysis, const std::string &name="")
 The constructor.
virtual ~Translator ()
 The destructor is needed for virtual methods.
virtual ir::Kerneltranslate (const ir::Kernel *i)=0
 Translate a kernel from the source ISA to the destination ISA.
void initialize (const ir::Module &m)
 Initialize the pass using a specific module.
void runOnKernel (const ir::IRKernel &k)
 Run the pass on a specific kernel in the module.
void finalize ()
 Finalize the pass.

Static Public Member Functions

static std::string toString (OptimizationLevel level)

Protected Attributes

OptimizationLevel optimizationLevel
 The optimization level for all translations.
ir::Instruction::Architecture sourceArchitecture
 The source architecture to be translated from.
ir::Instruction::Architecture targetArchitecture
 The target architecture to translate to.

Detailed Description

An interface for a translator from one ISA to another.


Member Enumeration Documentation

All possible optimization levels.

Enumerator:
NoOptimization 
ReportOptimization 
DebugOptimization 
InstrumentOptimization 
MemoryCheckOptimization 
BasicOptimization 
AggressiveOptimization 
SpaceOptimization 
FullOptimization 

Constructor & Destructor Documentation

translator::Translator::Translator ( ir::Instruction::Architecture  s,
ir::Instruction::Architecture  t,
OptimizationLevel  l = NoOptimization,
int  r = Analysis::NoAnalysis,
const std::string &  name = "" 
)

The constructor.

translator::Translator::~Translator ( ) [virtual]

The destructor is needed for virtual methods.


Member Function Documentation

void translator::Translator::finalize ( ) [virtual]

Finalize the pass.

Implements transforms::ImmutableKernelPass.

void translator::Translator::initialize ( const ir::Module m) [virtual]

Initialize the pass using a specific module.

Implements transforms::ImmutableKernelPass.

void translator::Translator::runOnKernel ( const ir::IRKernel k) [virtual]

Run the pass on a specific kernel in the module.

Implements transforms::ImmutableKernelPass.

std::string translator::Translator::toString ( OptimizationLevel  level) [static]
virtual ir::Kernel* translator::Translator::translate ( const ir::Kernel i) [pure virtual]

Translate a kernel from the source ISA to the destination ISA.

Parameters:
iThe input kernel. Must be in the source ISA.
Returns:
A newly allocated kernel that is functionally equivalent to i in the target ISA.

Note that this will allocate a new kernel and return it to the caller. It is the caller's resposibility to free it.

Implemented in translator::PTXToILTranslator, and translator::PTXToLLVMTranslator.


Member Data Documentation

The optimization level for all translations.

The source architecture to be translated from.

The target architecture to translate to.


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