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

executive::ExternalKernel Class Reference

defines a method in which kernel implementations may be overridden by externally specified kernels More...

#include <ExternalKernel.h>

Collaboration diagram for executive::ExternalKernel:
Collaboration graph
[legend]

List of all members.

Public Types

enum  LoadingType {
  LoadingType_invalid = 0, PTX_Source, LLVM_Source, Managed_Object,
  Unmanaged_Object
}
 

source for external kernel

More...
typedef int(* ManagedFunction )(LLVMContext *context)
typedef int(* UnmanagedFunction )(char *local, char *param)

Public Member Functions

 ExternalKernel (const std::string &name, LoadingType type, const std::string &path, ir::Module *module, const executive::Executive *c=0)
 ~ExternalKernel ()
virtual bool executable ()
 Determines whether kernel is executable.
virtual void launchGrid (int width, int height, int depth)
 Launch a kernel on a 2D grid.
virtual void setKernelShape (int x, int y, int z)
 Sets the shape of a kernel.
virtual void setExternSharedMemorySize (unsigned int)
 Changes the amount of external shared memory.
virtual void setDevice (const executive::Device *device, unsigned int limit)
 Describes the device used to execute the kernel.
virtual void updateParameterMemory ()
 Indicate that the kernels parameters have been updated.
virtual void updateMemory ()
 Indicate that other memory has been updated.
virtual
ir::ExecutableKernel::TextureVector 
textureReferences () const
 Get a vector of all textures references by the kernel.
void traceEvent (const trace::TraceEvent &event) const
virtual void addTraceGenerator (trace::TraceGenerator *generator)
virtual void removeTraceGenerator (trace::TraceGenerator *generator)

Static Public Member Functions

static LoadingType fromString (const std::string &str)

Public Attributes

LoadingType loadingType
 indicates data source for the kernel
std::string sourcePath
 identifies the source file or binary defining the external kernel

Protected Member Functions

bool loadAsPTXSource (const std::string &path)
 loads a PTX kernel and merges into module
bool loadAsLLVMSource (const std::string &path)
 loads an LLVm module and merges into module

Protected Attributes

executive::EmulatedKernelemulatedKernel
 pointer to emulated PTX kernel
executive::LLVMExecutableKernelllvmKernel
 pointer to LLVM executable kernel
void * objectHandle
 pointer to dynamically loaded object
ManagedFunction managedFunction
 pointer to callable symbol in dynamically loaded object
UnmanagedFunction unmanagedFunction
 pointer to callable symbol in dynamically loaded object

Detailed Description

defines a method in which kernel implementations may be overridden by externally specified kernels

These kernels may be PTX or LLVM source files that are executed as EmulatedKernel and LLVMKernels respectively or objects with or without hooks into the Ocelot CTA runtime


Member Typedef Documentation

typedef int(* executive::ExternalKernel::UnmanagedFunction)(char *local, char *param)

Member Enumeration Documentation

source for external kernel

Enumerator:
LoadingType_invalid 
PTX_Source 

kernel is not a valid loading type

LLVM_Source 

kernel is loaded from a PTX source file and executed as an EmulatedKernel

Managed_Object 

kernel is loaded from a source file in a directory known to Ocelot

Unmanaged_Object 

kernel is an object file with hooks into the Ocelot runtime

kernel is a regular C function


Constructor & Destructor Documentation

executive::ExternalKernel::ExternalKernel ( const std::string &  name,
LoadingType  type,
const std::string &  path,
ir::Module module,
const executive::Executive *  c = 0 
)
executive::ExternalKernel::~ExternalKernel ( )

Member Function Documentation

virtual void executive::ExternalKernel::addTraceGenerator ( trace::TraceGenerator generator) [virtual]

adds a trace generator to the EmulatedKernel

virtual bool executive::ExternalKernel::executable ( ) [virtual]

Determines whether kernel is executable.

static LoadingType executive::ExternalKernel::fromString ( const std::string &  str) [static]
virtual void executive::ExternalKernel::launchGrid ( int  width,
int  height,
int  depth 
) [virtual]

Launch a kernel on a 2D grid.

bool executive::ExternalKernel::loadAsLLVMSource ( const std::string &  path) [protected]

loads an LLVm module and merges into module

bool executive::ExternalKernel::loadAsPTXSource ( const std::string &  path) [protected]

loads a PTX kernel and merges into module

virtual void executive::ExternalKernel::removeTraceGenerator ( trace::TraceGenerator generator) [virtual]

removes a trace generator from an EmulatedKernel

virtual void executive::ExternalKernel::setDevice ( const executive::Device device,
unsigned int  limit 
) [virtual]

Describes the device used to execute the kernel.

virtual void executive::ExternalKernel::setExternSharedMemorySize ( unsigned  int) [virtual]

Changes the amount of external shared memory.

virtual void executive::ExternalKernel::setKernelShape ( int  x,
int  y,
int  z 
) [virtual]

Sets the shape of a kernel.

virtual ir::ExecutableKernel::TextureVector executive::ExternalKernel::textureReferences ( ) const [virtual]

Get a vector of all textures references by the kernel.

void executive::ExternalKernel::traceEvent ( const trace::TraceEvent event) const

Notifies all attached TraceGenerators of an event

virtual void executive::ExternalKernel::updateMemory ( ) [virtual]

Indicate that other memory has been updated.

virtual void executive::ExternalKernel::updateParameterMemory ( ) [virtual]

Indicate that the kernels parameters have been updated.


Member Data Documentation

pointer to emulated PTX kernel

pointer to LLVM executable kernel

indicates data source for the kernel

pointer to callable symbol in dynamically loaded object

pointer to dynamically loaded object

identifies the source file or binary defining the external kernel

pointer to callable symbol in dynamically loaded object


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