GPUOcelot
Public Member Functions

executive::PassThroughDevice Class Reference

#include <PassThroughDevice.h>

Inheritance diagram for executive::PassThroughDevice:
Inheritance graph
[legend]
Collaboration diagram for executive::PassThroughDevice:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool checkMemoryAccess (const void *pointer, size_t size) const
 Check a memory access against all allocations.
Device::MemoryAllocationgetMemoryAllocation (const void *address, AllocationType type=DeviceAllocation) const
 Get the allocation containing a pointer or 0.
Device::MemoryAllocationgetGlobalAllocation (const std::string &module, const std::string &name)
 Get the address of a global by name.
Device::MemoryAllocationallocate (size_t size)
 Allocate some new dynamic memory on this device.
Device::MemoryAllocationallocateHost (size_t size, unsigned int flags=0)
 Make this a host memory allocation.
Device::MemoryAllocationregisterHost (void *pointer, size_t size, unsigned int flags)
 Register a host memory allocation.
void free (void *pointer)
 Free an existing non-global allocation.
Device::MemoryAllocationVector getNearbyAllocations (void *pointer) const
 Get nearby allocations to a pointer.
Device::MemoryAllocationVector getAllAllocations () const
 Get all allocations, host, global, and device.
std::string nearbyAllocationsToString (void *pointer) const
 Get a string representation of nearby allocations.
void clearMemory ()
 Wipe all memory allocations, but keep modules.
void * glRegisterBuffer (unsigned int buffer, unsigned int flags)
 Registers an opengl buffer with a resource.
void * glRegisterImage (unsigned int image, unsigned int target, unsigned int flags)
 Registers an opengl image with a resource.
void unRegisterGraphicsResource (void *resource)
 Unregister a resource.
void mapGraphicsResource (void **resource, int count, unsigned int stream)
 Map a graphics resource for use with this device.
void * getPointerToMappedGraphicsResource (size_t &size, void *resource)
 Get a pointer to a mapped resource along with its size.
void setGraphicsResourceFlags (void *resource, unsigned int flags)
 Change the flags of a mapped resource.
void unmapGraphicsResource (void **resource, int count, unsigned int stream)
 Unmap a mapped resource.
void load (const ir::Module *module)
 Load a module, must have a unique name.
void unload (const std::string &name)
 Unload a module by name.
ExecutableKernelgetKernel (const std::string &module, const std::string &kernel)
 Get a translated kernel from the device.
unsigned int createEvent (int flags)
 Create a new event.
void destroyEvent (unsigned int event)
 Destroy an existing event.
bool queryEvent (unsigned int event)
 Query to see if an event has been recorded (yes/no)
void recordEvent (unsigned int event, unsigned int stream)
 Record something happening on an event.
void synchronizeEvent (unsigned int event)
 Synchronize on an event.
float getEventTime (unsigned int start, unsigned int end)
 Get the elapsed time in ms between two recorded events.
unsigned int createStream ()
 Create a new stream.
void destroyStream (unsigned int stream)
 Destroy an existing stream.
bool queryStream (unsigned int stream)
 Query the status of an existing stream (ready/not)
void synchronizeStream (unsigned int stream)
 Synchronize a particular stream.
void setStream (unsigned int stream)
 Sets the current stream.
void select ()
 Select this device as the current device. Only one device is allowed to be selected at any time.
bool selected ()
 is this device selected?
void unselect ()
 Deselect this device.
void bindTexture (void *pointer, const std::string &moduleName, const std::string &textureName, const textureReference &ref, const cudaChannelFormatDesc &desc, const ir::Dim3 &size)
 Binds a texture to a memory allocation at a pointer.
void unbindTexture (const std::string &moduleName, const std::string &textureName)
 unbinds anything bound to a particular texture
void * getTextureReference (const std::string &moduleName, const std::string &textureName)
 Get's a reference to an internal texture.
void launch (const std::string &module, const std::string &kernel, const ir::Dim3 &grid, const ir::Dim3 &block, size_t sharedMemory, const void *argumentBlock, size_t argumentBlockSize, const trace::TraceGeneratorVector &traceGenerators=trace::TraceGeneratorVector(), const ir::ExternalFunctionSet *externals=0)
 helper function for launching a kernel
cudaFuncAttributes getAttributes (const std::string &module, const std::string &kernel)
 Get the function attributes of a specific kernel.
unsigned int getLastError ()
 Get the last error from this device.
void synchronize ()
 Wait until all asynchronous operations have completed.
void limitWorkerThreads (unsigned int threads)
 Limit the worker threads used by this device.
void setOptimizationLevel (translator::Translator::OptimizationLevel level)
 Set the optimization level for kernels in this device.
 PassThroughDevice (Device *target, unsigned int flags=0)
 ~PassThroughDevice ()

Detailed Description

Interface for controlling an Ocelot device


Constructor & Destructor Documentation

executive::PassThroughDevice::PassThroughDevice ( executive::Device target,
unsigned int  flags = 0 
)
executive::PassThroughDevice::~PassThroughDevice ( )

Member Function Documentation

executive::Device::MemoryAllocation * executive::PassThroughDevice::allocate ( size_t  size) [virtual]

Allocate some new dynamic memory on this device.

Implements executive::Device.

executive::Device::MemoryAllocation * executive::PassThroughDevice::allocateHost ( size_t  size,
unsigned int  flags = 0 
) [virtual]

Make this a host memory allocation.

Implements executive::Device.

void executive::PassThroughDevice::bindTexture ( void *  pointer,
const std::string &  moduleName,
const std::string &  textureName,
const textureReference ref,
const cudaChannelFormatDesc desc,
const ir::Dim3 size 
) [virtual]

Binds a texture to a memory allocation at a pointer.

Implements executive::Device.

bool executive::PassThroughDevice::checkMemoryAccess ( const void *  pointer,
size_t  size 
) const [virtual]

Check a memory access against all allocations.

Reimplemented from executive::Device.

void executive::PassThroughDevice::clearMemory ( ) [virtual]

Wipe all memory allocations, but keep modules.

Implements executive::Device.

unsigned int executive::PassThroughDevice::createEvent ( int  flags) [virtual]

Create a new event.

Implements executive::Device.

unsigned int executive::PassThroughDevice::createStream ( ) [virtual]

Create a new stream.

Implements executive::Device.

void executive::PassThroughDevice::destroyEvent ( unsigned int  event) [virtual]

Destroy an existing event.

Implements executive::Device.

void executive::PassThroughDevice::destroyStream ( unsigned int  stream) [virtual]

Destroy an existing stream.

Implements executive::Device.

void executive::PassThroughDevice::free ( void *  pointer) [virtual]

Free an existing non-global allocation.

Implements executive::Device.

executive::Device::MemoryAllocationVector executive::PassThroughDevice::getAllAllocations ( ) const [virtual]

Get all allocations, host, global, and device.

Implements executive::Device.

cudaFuncAttributes executive::PassThroughDevice::getAttributes ( const std::string &  module,
const std::string &  kernel 
) [virtual]

Get the function attributes of a specific kernel.

Implements executive::Device.

float executive::PassThroughDevice::getEventTime ( unsigned int  start,
unsigned int  end 
) [virtual]

Get the elapsed time in ms between two recorded events.

Implements executive::Device.

executive::Device::MemoryAllocation * executive::PassThroughDevice::getGlobalAllocation ( const std::string &  module,
const std::string &  name 
) [virtual]

Get the address of a global by name.

Implements executive::Device.

executive::ExecutableKernel * executive::PassThroughDevice::getKernel ( const std::string &  module,
const std::string &  kernel 
) [virtual]

Get a translated kernel from the device.

Implements executive::Device.

unsigned int executive::PassThroughDevice::getLastError ( ) [virtual]

Get the last error from this device.

Implements executive::Device.

executive::Device::MemoryAllocation * executive::PassThroughDevice::getMemoryAllocation ( const void *  address,
AllocationType  type = DeviceAllocation 
) const [virtual]

Get the allocation containing a pointer or 0.

Implements executive::Device.

executive::Device::MemoryAllocationVector executive::PassThroughDevice::getNearbyAllocations ( void *  pointer) const [virtual]

Get nearby allocations to a pointer.

Implements executive::Device.

void * executive::PassThroughDevice::getPointerToMappedGraphicsResource ( size_t size,
void *  resource 
) [virtual]

Get a pointer to a mapped resource along with its size.

Implements executive::Device.

void * executive::PassThroughDevice::getTextureReference ( const std::string &  moduleName,
const std::string &  textureName 
) [virtual]

Get's a reference to an internal texture.

Implements executive::Device.

void * executive::PassThroughDevice::glRegisterBuffer ( unsigned int  buffer,
unsigned int  flags 
) [virtual]

Registers an opengl buffer with a resource.

Implements executive::Device.

void * executive::PassThroughDevice::glRegisterImage ( unsigned int  image,
unsigned int  target,
unsigned int  flags 
) [virtual]

Registers an opengl image with a resource.

Implements executive::Device.

void executive::PassThroughDevice::launch ( const std::string &  module,
const std::string &  kernel,
const ir::Dim3 grid,
const ir::Dim3 block,
size_t  sharedMemory,
const void *  argumentBlock,
size_t  argumentBlockSize,
const trace::TraceGeneratorVector traceGenerators = trace::TraceGeneratorVector(),
const ir::ExternalFunctionSet externals = 0 
) [virtual]

helper function for launching a kernel

Parameters:
modulemodule name
kernelkernel name
gridgrid dimensions
blockblock dimensions
sharedMemoryshared memory size
argumentBlockarray of bytes for argument memory
argumentBlockSizenumber of bytes in argument memory
traceGeneratorsvector of trace generators to add and remove from kernel

Implements executive::Device.

void executive::PassThroughDevice::limitWorkerThreads ( unsigned int  threads) [virtual]

Limit the worker threads used by this device.

Implements executive::Device.

void executive::PassThroughDevice::load ( const ir::Module module) [virtual]

Load a module, must have a unique name.

Implements executive::Device.

void executive::PassThroughDevice::mapGraphicsResource ( void **  resource,
int  count,
unsigned int  stream 
) [virtual]

Map a graphics resource for use with this device.

Implements executive::Device.

std::string executive::PassThroughDevice::nearbyAllocationsToString ( void *  pointer) const [virtual]

Get a string representation of nearby allocations.

Reimplemented from executive::Device.

bool executive::PassThroughDevice::queryEvent ( unsigned int  event) [virtual]

Query to see if an event has been recorded (yes/no)

Implements executive::Device.

bool executive::PassThroughDevice::queryStream ( unsigned int  stream) [virtual]

Query the status of an existing stream (ready/not)

Implements executive::Device.

void executive::PassThroughDevice::recordEvent ( unsigned int  event,
unsigned int  stream 
) [virtual]

Record something happening on an event.

Implements executive::Device.

executive::Device::MemoryAllocation * executive::PassThroughDevice::registerHost ( void *  pointer,
size_t  size,
unsigned int  flags 
) [virtual]

Register a host memory allocation.

Implements executive::Device.

void executive::PassThroughDevice::select ( ) [virtual]

Select this device as the current device. Only one device is allowed to be selected at any time.

Reimplemented from executive::Device.

bool executive::PassThroughDevice::selected ( ) [virtual]

is this device selected?

Reimplemented from executive::Device.

void executive::PassThroughDevice::setGraphicsResourceFlags ( void *  resource,
unsigned int  flags 
) [virtual]

Change the flags of a mapped resource.

Implements executive::Device.

void executive::PassThroughDevice::setOptimizationLevel ( translator::Translator::OptimizationLevel  level) [virtual]

Set the optimization level for kernels in this device.

Implements executive::Device.

void executive::PassThroughDevice::setStream ( unsigned int  stream) [virtual]

Sets the current stream.

Implements executive::Device.

void executive::PassThroughDevice::synchronize ( ) [virtual]

Wait until all asynchronous operations have completed.

Implements executive::Device.

void executive::PassThroughDevice::synchronizeEvent ( unsigned int  event) [virtual]

Synchronize on an event.

Implements executive::Device.

void executive::PassThroughDevice::synchronizeStream ( unsigned int  stream) [virtual]

Synchronize a particular stream.

Implements executive::Device.

void executive::PassThroughDevice::unbindTexture ( const std::string &  moduleName,
const std::string &  textureName 
) [virtual]

unbinds anything bound to a particular texture

Implements executive::Device.

void executive::PassThroughDevice::unload ( const std::string &  name) [virtual]

Unload a module by name.

Implements executive::Device.

void executive::PassThroughDevice::unmapGraphicsResource ( void **  resource,
int  count,
unsigned int  stream 
) [virtual]

Unmap a mapped resource.

Implements executive::Device.

void executive::PassThroughDevice::unRegisterGraphicsResource ( void *  resource) [virtual]

Unregister a resource.

Implements executive::Device.

void executive::PassThroughDevice::unselect ( ) [virtual]

Deselect this device.

Reimplemented from executive::Device.


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