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

executive::ATIGPUDevice Class Reference

ATI GPU Device. More...

#include <ATIGPUDevice.h>

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

List of all members.

Classes

class  MemoryAllocation
 ATI memory allocation. More...
class  Module
 A class for holding the state associated with a module.

Public Member Functions

 ATIGPUDevice ()
 Constructor.
 ~ATIGPUDevice ()
 Destructor.
Device::MemoryAllocationgetMemoryAllocation (const void *address, AllocationType type) 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)
 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.
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 streamID)
 Unmap a mapped resource.
void load (const ir::Module *irModule)
 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 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 &path, const std::string &kernelName)
 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.

Static Public Member Functions

static DeviceVector createDevices (unsigned int flags, int computeCapability)
 Allocate a new device for each CAL capable GPU.
static unsigned int deviceCount (int computeCapability)
 Get the total number of CAL devices in the system.

Static Public Attributes

static const CALdeviceptr Uav0BaseAddr = 0x1000
 uav0 base address (to avoid 0x0 be a valid address)
static const size_t Uav0Size = 150000000
 uav0 size (150 MB)

Detailed Description

ATI GPU Device.


Constructor & Destructor Documentation

executive::ATIGPUDevice::ATIGPUDevice ( )

Constructor.

executive::ATIGPUDevice::~ATIGPUDevice ( )

Destructor.


Member Function Documentation

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

Allocate some new dynamic memory on this device.

Implements executive::Device.

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

Make this a host memory allocation.

Implements executive::Device.

void executive::ATIGPUDevice::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.

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

Wipe all memory allocations, but keep modules.

Implements executive::Device.

DeviceVector executive::ATIGPUDevice::createDevices ( unsigned int  flags,
int  computeCapability 
) [static]

Allocate a new device for each CAL capable GPU.

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

Create a new event.

Implements executive::Device.

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

Create a new stream.

Implements executive::Device.

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

Destroy an existing event.

Implements executive::Device.

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

Destroy an existing stream.

Implements executive::Device.

unsigned int executive::ATIGPUDevice::deviceCount ( int  computeCapability) [static]

Get the total number of CAL devices in the system.

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

Free an existing non-global allocation.

Implements executive::Device.

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

Get all allocations, host, global, and device.

Implements executive::Device.

cudaFuncAttributes executive::ATIGPUDevice::getAttributes ( const std::string &  path,
const std::string &  kernelName 
) [virtual]

Get the function attributes of a specific kernel.

Implements executive::Device.

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

Get the elapsed time in ms between two recorded events.

Implements executive::Device.

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

Get the address of a global by name.

Implements executive::Device.

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

Get a translated kernel from the device.

Implements executive::Device.

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

Get the last error from this device.

Implements executive::Device.

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

Get the allocation containing a pointer or 0.

Implements executive::Device.

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

Get nearby allocations to a pointer.

Implements executive::Device.

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

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

Implements executive::Device.

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

Get's a reference to an internal texture.

Implements executive::Device.

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

Registers an opengl buffer with a resource.

Implements executive::Device.

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

Registers an opengl image with a resource.

Implements executive::Device.

void executive::ATIGPUDevice::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::ATIGPUDevice::limitWorkerThreads ( unsigned int  threads) [virtual]

Limit the worker threads used by this device.

Implements executive::Device.

void executive::ATIGPUDevice::load ( const ir::Module irModule) [virtual]

Load a module, must have a unique name.

Implements executive::Device.

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

Map a graphics resource for use with this device.

Implements executive::Device.

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

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

Implements executive::Device.

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

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

Implements executive::Device.

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

Record something happening on an event.

Implements executive::Device.

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

Register a host memory allocation.

Implements executive::Device.

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

Change the flags of a mapped resource.

Implements executive::Device.

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

Set the optimization level for kernels in this device.

Implements executive::Device.

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

Sets the current stream.

Implements executive::Device.

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

Wait until all asynchronous operations have completed.

Implements executive::Device.

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

Synchronize on an event.

Implements executive::Device.

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

Synchronize a particular stream.

Implements executive::Device.

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

unbinds anything bound to a particular texture

Implements executive::Device.

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

Unload a module by name.

Implements executive::Device.

void executive::ATIGPUDevice::unmapGraphicsResource ( void **  resource,
int  count,
unsigned int  streamID 
) [virtual]

Unmap a mapped resource.

Implements executive::Device.

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

Unregister a resource.

Implements executive::Device.


Member Data Documentation

uav0 base address (to avoid 0x0 be a valid address)

const size_t executive::ATIGPUDevice::Uav0Size = 150000000 [static]

uav0 size (150 MB)


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