GPUOcelot
|
#include <RemoteDevice.h>
Classes | |
class | ConnectionManager |
A singleton to manage communication. More... | |
class | MemoryAllocation |
An interface to a managed memory allocation. More... | |
Public Types | |
typedef std::map< void *, MemoryAllocation * > | AllocationMap |
A map of memory allocations. | |
Public Member Functions | |
RemoteDevice (unsigned int id, const PropertiesData &props, unsigned int flags=0) | |
Sets the device properties, connects to an ocelot server. | |
~RemoteDevice () | |
Clears all state. | |
Device::MemoryAllocation * | getMemoryAllocation (const void *address, AllocationType type) const |
Get the allocation containing a pointer or 0. | |
Device::MemoryAllocation * | getGlobalAllocation (const std::string &module, const std::string &name) |
Get the address of a global by stream. | |
Device::MemoryAllocation * | allocate (size_t size) |
Allocate some new dynamic memory on this device. | |
Device::MemoryAllocation * | allocateHost (size_t size, unsigned int flags) |
Make this a host memory allocation. | |
Device::MemoryAllocation * | registerHost (void *pointer, size_t size, unsigned int flags) |
Register a host memory allocation. | |
void | free (void *pointer) |
Free an existing non-global allocation. | |
MemoryAllocationVector | getNearbyAllocations (void *pointer) const |
Get nearby allocations to a pointer. | |
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 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. | |
ExecutableKernel * | getKernel (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 () const |
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. | |
Static Public Member Functions | |
static DeviceVector | createDevices (unsigned int flags, int computeCapability) |
Allocate a new device for each remote device. | |
static unsigned int | deviceCount (int computeCapability) |
Determine the number of CUDA GPUs in the system. | |
Static Public Attributes | |
static ConnectionManager | connectionManager |
Friends | |
class | RemoteDevice::MemoryAllocation |
class defining a remote Ocelot device
typedef std::map<void*, MemoryAllocation*> executive::RemoteDevice::AllocationMap |
A map of memory allocations.
executive::RemoteDevice::RemoteDevice | ( | unsigned int | id, |
const PropertiesData & | props, | ||
unsigned int | flags = 0 |
||
) |
Sets the device properties, connects to an ocelot server.
Sets the device properties, bind this to the cuda id.
executive::RemoteDevice::~RemoteDevice | ( | ) |
Clears all state.
executive::Device::MemoryAllocation * executive::RemoteDevice::allocate | ( | size_t | size | ) | [virtual] |
Allocate some new dynamic memory on this device.
Implements executive::Device.
executive::Device::MemoryAllocation * executive::RemoteDevice::allocateHost | ( | size_t | size, |
unsigned int | flags | ||
) | [virtual] |
Make this a host memory allocation.
Implements executive::Device.
void executive::RemoteDevice::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::RemoteDevice::clearMemory | ( | ) | [virtual] |
Wipe all memory allocations, but keep modules.
Implements executive::Device.
executive::Device::DeviceVector executive::RemoteDevice::createDevices | ( | unsigned int | flags, |
int | computeCapability | ||
) | [static] |
Allocate a new device for each remote device.
unsigned int executive::RemoteDevice::createEvent | ( | int | flags | ) | [virtual] |
Create a new event.
Implements executive::Device.
unsigned int executive::RemoteDevice::createStream | ( | ) | [virtual] |
Create a new stream.
Implements executive::Device.
void executive::RemoteDevice::destroyEvent | ( | unsigned int | event | ) | [virtual] |
Destroy an existing event.
Implements executive::Device.
void executive::RemoteDevice::destroyStream | ( | unsigned int | stream | ) | [virtual] |
Destroy an existing stream.
Implements executive::Device.
unsigned int executive::RemoteDevice::deviceCount | ( | int | computeCapability | ) | [static] |
Determine the number of CUDA GPUs in the system.
Determine the number of remote GPUs in the system.
void executive::RemoteDevice::free | ( | void * | pointer | ) | [virtual] |
Free an existing non-global allocation.
Implements executive::Device.
executive::Device::MemoryAllocationVector executive::RemoteDevice::getAllAllocations | ( | ) | const [virtual] |
Get all allocations, host, global, and device.
Implements executive::Device.
cudaFuncAttributes executive::RemoteDevice::getAttributes | ( | const std::string & | module, |
const std::string & | kernel | ||
) | [virtual] |
Get the function attributes of a specific kernel.
Implements executive::Device.
float executive::RemoteDevice::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::RemoteDevice::getGlobalAllocation | ( | const std::string & | module, |
const std::string & | name | ||
) | [virtual] |
Get the address of a global by stream.
Implements executive::Device.
executive::ExecutableKernel * executive::RemoteDevice::getKernel | ( | const std::string & | module, |
const std::string & | kernel | ||
) | [virtual] |
Get a translated kernel from the device.
Implements executive::Device.
unsigned int executive::RemoteDevice::getLastError | ( | ) | [virtual] |
Get the last error from this device.
Implements executive::Device.
executive::Device::MemoryAllocation * executive::RemoteDevice::getMemoryAllocation | ( | const void * | address, |
AllocationType | type | ||
) | const [virtual] |
Get the allocation containing a pointer or 0.
Implements executive::Device.
executive::Device::MemoryAllocationVector executive::RemoteDevice::getNearbyAllocations | ( | void * | pointer | ) | const [virtual] |
Get nearby allocations to a pointer.
Implements executive::Device.
void * executive::RemoteDevice::getPointerToMappedGraphicsResource | ( | size_t & | size, |
void * | resource | ||
) | [virtual] |
Get a pointer to a mapped resource along with its size.
Implements executive::Device.
void * executive::RemoteDevice::getTextureReference | ( | const std::string & | moduleName, |
const std::string & | textureName | ||
) | [virtual] |
Get's a reference to an internal texture.
Implements executive::Device.
void * executive::RemoteDevice::glRegisterBuffer | ( | unsigned int | buffer, |
unsigned int | flags | ||
) | [virtual] |
Registers an opengl buffer with a resource.
Implements executive::Device.
void * executive::RemoteDevice::glRegisterImage | ( | unsigned int | image, |
unsigned int | target, | ||
unsigned int | flags | ||
) | [virtual] |
Registers an opengl image with a resource.
Implements executive::Device.
void executive::RemoteDevice::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
module | module name |
kernel | kernel name |
grid | grid dimensions |
block | block dimensions |
sharedMemory | shared memory size |
argumentBlock | array of bytes for parameter memory |
argumentBlockSize | number of bytes in parameter memory |
traceGenerators | vector of trace generators to add and remove from kernel |
Implements executive::Device.
void executive::RemoteDevice::limitWorkerThreads | ( | unsigned int | threads | ) | [virtual] |
Limit the worker threads used by this device.
Implements executive::Device.
void executive::RemoteDevice::load | ( | const ir::Module * | module | ) | [virtual] |
Load a module, must have a unique name.
Implements executive::Device.
void executive::RemoteDevice::mapGraphicsResource | ( | void ** | resource, |
int | count, | ||
unsigned int | stream | ||
) | [virtual] |
Map a graphics resource for use with this device.
Implements executive::Device.
bool executive::RemoteDevice::queryEvent | ( | unsigned int | event | ) | [virtual] |
Query to see if an event has been recorded (yes/no)
Implements executive::Device.
bool executive::RemoteDevice::queryStream | ( | unsigned int | stream | ) | [virtual] |
Query the status of an existing stream (ready/not)
Implements executive::Device.
void executive::RemoteDevice::recordEvent | ( | unsigned int | event, |
unsigned int | stream | ||
) | [virtual] |
Record something happening on an event.
Implements executive::Device.
executive::Device::MemoryAllocation * executive::RemoteDevice::registerHost | ( | void * | pointer, |
size_t | size, | ||
unsigned int | flags | ||
) | [virtual] |
Register a host memory allocation.
Make this a host memory allocation.
Implements executive::Device.
void executive::RemoteDevice::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::RemoteDevice::selected | ( | ) | const |
is this device selected?
void executive::RemoteDevice::setGraphicsResourceFlags | ( | void * | resource, |
unsigned int | flags | ||
) | [virtual] |
Change the flags of a mapped resource.
Implements executive::Device.
void executive::RemoteDevice::setOptimizationLevel | ( | translator::Translator::OptimizationLevel | level | ) | [virtual] |
Set the optimization level for kernels in this device.
Implements executive::Device.
void executive::RemoteDevice::setStream | ( | unsigned int | stream | ) | [virtual] |
Sets the current stream.
Implements executive::Device.
void executive::RemoteDevice::synchronize | ( | ) | [virtual] |
Wait until all asynchronous operations have completed.
Implements executive::Device.
void executive::RemoteDevice::synchronizeEvent | ( | unsigned int | event | ) | [virtual] |
Synchronize on an event.
Implements executive::Device.
void executive::RemoteDevice::synchronizeStream | ( | unsigned int | stream | ) | [virtual] |
Synchronize a particular stream.
Implements executive::Device.
void executive::RemoteDevice::unbindTexture | ( | const std::string & | moduleName, |
const std::string & | textureName | ||
) | [virtual] |
unbinds anything bound to a particular texture
Implements executive::Device.
void executive::RemoteDevice::unload | ( | const std::string & | name | ) | [virtual] |
Unload a module by name.
Implements executive::Device.
void executive::RemoteDevice::unmapGraphicsResource | ( | void ** | resource, |
int | count, | ||
unsigned int | stream | ||
) | [virtual] |
Unmap a mapped resource.
Implements executive::Device.
void executive::RemoteDevice::unRegisterGraphicsResource | ( | void * | resource | ) | [virtual] |
Unregister a resource.
Implements executive::Device.
void executive::RemoteDevice::unselect | ( | ) | [virtual] |
Deselect this device.
Reimplemented from executive::Device.
friend class RemoteDevice::MemoryAllocation [friend] |