GPUOcelot
Defines | Typedefs | Functions

CudaDriverApi.cpp File Reference

implements CUDA Driver API functions which call through to the implementation of the appropriate CUDA Driver API front-end implementation More...

#include <string>
#include <ocelot/cuda/interface/cuda_internal.h>
#include <ocelot/cuda/interface/CudaDriverFrontend.h>
#include <hydrazine/implementation/debug.h>
Include dependency graph for CudaDriverApi.cpp:

Defines

#define CATCH_RUNTIME_EXCEPTIONS   0
#define CUDA_VERBOSE   1
#define REPORT_BASE   1
#define Ocelot_Exception(x)   { std::stringstream ss; ss << x; throw hydrazine::Exception(ss.str()) ); }
#define trace()
#define RETURN(x)   return x
#define Function(f)   f
#define FunctionV(f)   f ## _v2

Typedefs

typedef cuda::CudaDriverInterface CudaApi

Functions

CUresult Function() cuInit (unsigned int Flags)
 Initialize the CUDA driver API.
CUresult Function() cuDriverGetVersion (int *driverVersion)
 Returns the CUDA driver version.
CUresult Function() cuGetExportTable (const void **ppExportTable, const CUuuid *pExportTableId)
CUresult Function() cuDeviceGet (CUdevice *device, int ordinal)
 Returns a handle to a compute device.
CUresult Function() cuDeviceGetCount (int *count)
 Returns the number of compute-capable devices.
CUresult Function() cuDeviceGetName (char *name, int len, CUdevice dev)
 Returns an identifer string for the device.
CUresult Function() cuDeviceComputeCapability (int *major, int *minor, CUdevice dev)
 Returns the compute capability of the device.
CUresult Function() cuDeviceTotalMem (size_t *bytes, CUdevice dev)
 Returns the total amount of memory on the device.
CUresult Function() cuDeviceGetProperties (CUdevprop *prop, CUdevice dev)
 Returns properties for a selected device.
CUresult Function() cuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev)
 Returns information about the device.
CUresult Function() cuCtxCreate (CUcontext *pctx, unsigned int flags, CUdevice dev)
 Create a CUDA context.
CUresult Function() cuCtxDestroy (CUcontext ctx)
 Destroy the current context or a floating CUDA context.
CUresult Function() cuCtxAttach (CUcontext *pctx, unsigned int flags)
 Increment a context's usage-count.
CUresult Function() cuCtxDetach (CUcontext ctx)
 Decrement a context's usage-count.
CUresult Function() cuCtxPushCurrent (CUcontext ctx)
 Pushes a floating context on the current CPU thread.
CUresult Function() cuCtxPopCurrent (CUcontext *pctx)
 Pops the current CUDA context from the current CPU thread.
CUresult Function() cuCtxGetDevice (CUdevice *device)
 Returns the device ID for the current context.
CUresult Function() cuCtxSynchronize (void)
 Block for a context's tasks to complete.
CUresult Function() cuModuleLoad (CUmodule *module, const char *fname)
 Loads a compute module.
CUresult Function() cuModuleLoadData (CUmodule *module, const void *image)
 Load a module's data.
CUresult Function() cuModuleLoadDataEx (CUmodule *module, const void *image, unsigned int numOptions, CUjit_option *options, void **optionValues)
 Load a module's data with options.
CUresult Function() cuModuleLoadFatBinary (CUmodule *module, const void *fatCubin)
 Load a module's data.
CUresult Function() cuModuleUnload (CUmodule hmod)
 Unloads a module.
CUresult Function() cuModuleGetFunction (CUfunction *hfunc, CUmodule hmod, const char *name)
 Returns a function handle.
CUresult FunctionV() cuModuleGetGlobal (CUdeviceptr *dptr, size_t *bytes, CUmodule hmod, const char *name)
 Returns a global pointer from a module.
CUresult Function() cuModuleGetTexRef (CUtexref *pTexRef, CUmodule hmod, const char *name)
 Returns a handle to a texture reference.
CUresult FunctionV() cuMemGetInfo (size_t *free, size_t *total)
 Gets free and total memory.
CUresult FunctionV() cuMemAlloc (CUdeviceptr *dptr, unsigned int bytesize)
CUresult FunctionV() cuMemAllocPitch (CUdeviceptr *dptr, size_t *pPitch, unsigned int WidthInBytes, unsigned int Height, unsigned int ElementSizeBytes)
CUresult FunctionV() cuMemFree (CUdeviceptr dptr)
 Frees device memory.
CUresult FunctionV() cuMemGetAddressRange (CUdeviceptr *pbase, size_t *psize, CUdeviceptr dptr)
 Get information on memory allocations.
CUresult Function() cuMemAllocHost (void **pp, size_t bytesize)
 Allocates page-locked host memory.
CUresult Function() cuMemFreeHost (void *p)
 Frees page-locked host memory.
CUresult Function() cuMemHostAlloc (void **pp, size_t bytesize, unsigned int Flags)
 Allocates page-locked host memory.
CUresult FunctionV() cuMemHostGetDevicePointer (CUdeviceptr *pdptr, void *p, unsigned int Flags)
 Passes back device pointer of mapped pinned memory.
CUresult Function() cuMemHostGetFlags (unsigned int *pFlags, void *p)
 Passes back flags that were used for a pinned allocation.
CUresult FunctionV() cuMemcpyHtoD (CUdeviceptr dstDevice, const void *srcHost, unsigned int ByteCount)
CUresult FunctionV() cuMemcpyDtoH (void *dstHost, CUdeviceptr srcDevice, unsigned int ByteCount)
CUresult FunctionV() cuMemcpyDtoD (CUdeviceptr dstDevice, CUdeviceptr srcDevice, unsigned int ByteCount)
CUresult FunctionV() cuMemcpyHtoH (void *dstHost, const void *srcHost, unsigned int ByteCount)
CUresult FunctionV() cuMemcpyDtoA (CUarray dstArray, unsigned int dstIndex, CUdeviceptr srcDevice, unsigned int ByteCount)
CUresult FunctionV() cuMemcpyAtoD (CUdeviceptr dstDevice, CUarray hSrc, unsigned int SrcIndex, unsigned int ByteCount)
CUresult FunctionV() cuMemcpyHtoA (CUarray dstArray, unsigned int dstIndex, const void *pSrc, unsigned int ByteCount)
CUresult FunctionV() cuMemcpyAtoH (void *dstHost, CUarray srcArray, unsigned int srcIndex, unsigned int ByteCount)
CUresult FunctionV() cuMemcpyAtoA (CUarray dstArray, unsigned int dstIndex, CUarray srcArray, unsigned int srcIndex, unsigned int ByteCount)
CUresult FunctionV() cuMemcpy2D (const CUDA_MEMCPY2D *pCopy)
 Copies memory for 2D arrays.
CUresult FunctionV() cuMemcpy2DUnaligned (const CUDA_MEMCPY2D *pCopy)
 Copies memory for 2D arrays.
CUresult FunctionV() cuMemcpy3D (const CUDA_MEMCPY3D *pCopy)
 Copies memory for 3D arrays.
CUresult FunctionV() cuMemcpyHtoDAsync (CUdeviceptr dstDevice, const void *srcHost, unsigned int ByteCount, CUstream hStream)
CUresult FunctionV() cuMemcpyDtoHAsync (void *dstHost, CUdeviceptr srcDevice, unsigned int ByteCount, CUstream hStream)
CUresult FunctionV() cuMemcpyHtoAAsync (CUarray dstArray, unsigned int dstIndex, const void *pSrc, unsigned int ByteCount, CUstream hStream)
CUresult FunctionV() cuMemcpyAtoHAsync (void *dstHost, CUarray srcArray, unsigned int srcIndex, unsigned int ByteCount, CUstream hStream)
CUresult FunctionV() cuMemcpy2DAsync (const CUDA_MEMCPY2D *pCopy, CUstream hStream)
 Copies memory for 2D arrays.
CUresult FunctionV() cuMemcpy3DAsync (const CUDA_MEMCPY3D *pCopy, CUstream hStream)
 Copies memory for 3D arrays.
CUresult FunctionV() cuMemsetD8 (CUdeviceptr dstDevice, unsigned char uc, unsigned int N)
CUresult FunctionV() cuMemsetD16 (CUdeviceptr dstDevice, unsigned short us, unsigned int N)
CUresult FunctionV() cuMemsetD32 (CUdeviceptr dstDevice, unsigned int ui, unsigned int N)
CUresult FunctionV() cuMemsetD2D8 (CUdeviceptr dstDevice, unsigned int dstPitch, unsigned char uc, unsigned int Width, unsigned int Height)
CUresult FunctionV() cuMemsetD2D16 (CUdeviceptr dstDevice, unsigned int dstPitch, unsigned short us, unsigned int Width, unsigned int Height)
CUresult FunctionV() cuMemsetD2D32 (CUdeviceptr dstDevice, unsigned int dstPitch, unsigned int ui, unsigned int Width, unsigned int Height)
CUresult Function() cuFuncSetBlockShape (CUfunction hfunc, int x, int y, int z)
 Sets the block-dimensions for the function.
CUresult Function() cuFuncSetSharedSize (CUfunction hfunc, unsigned int bytes)
 Sets the dynamic shared-memory size for the function.
CUresult Function() cuFuncGetAttribute (int *pi, CUfunction_attribute attrib, CUfunction hfunc)
 Returns information about a function.
CUresult Function() cuFuncSetCacheConfig (CUfunction hfunc, CUfunc_cache config)
 Sets the preferred cache configuration for a device function.
CUresult FunctionV() cuArrayCreate (CUarray *pHandle, const CUDA_ARRAY_DESCRIPTOR *pAllocateArray)
 Creates a 1D or 2D CUDA array.
CUresult FunctionV() cuArrayGetDescriptor (CUDA_ARRAY_DESCRIPTOR *pArrayDescriptor, CUarray hArray)
 Get a 1D or 2D CUDA array descriptor.
CUresult Function() cuArrayDestroy (CUarray hArray)
 Destroys a CUDA array.
CUresult FunctionV() cuArray3DCreate (CUarray *pHandle, const CUDA_ARRAY3D_DESCRIPTOR *pAllocateArray)
 Creates a 3D CUDA array.
CUresult FunctionV() cuArray3DGetDescriptor (CUDA_ARRAY3D_DESCRIPTOR *pArrayDescriptor, CUarray hArray)
 Get a 3D CUDA array descriptor.
CUresult Function() cuTexRefCreate (CUtexref *pTexRef)
 Creates a texture reference.
CUresult Function() cuTexRefDestroy (CUtexref hTexRef)
 Destroys a texture reference.
CUresult Function() cuTexRefSetArray (CUtexref hTexRef, CUarray hArray, unsigned int Flags)
 Binds an array as a texture reference.
CUresult FunctionV() cuTexRefSetAddress (size_t *ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, unsigned int bytes)
CUresult FunctionV() cuTexRefSetAddress2D (CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR *desc, CUdeviceptr dptr, unsigned int Pitch)
CUresult Function() cuTexRefSetFormat (CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents)
 Sets the format for a texture reference.
CUresult Function() cuTexRefSetAddressMode (CUtexref hTexRef, int dim, CUaddress_mode am)
 Sets the addressing mode for a texture reference.
CUresult Function() cuTexRefSetFilterMode (CUtexref hTexRef, CUfilter_mode fm)
 Sets the filtering mode for a texture reference.
CUresult Function() cuTexRefSetFlags (CUtexref hTexRef, unsigned int Flags)
 Sets the flags for a texture reference.
CUresult FunctionV() cuTexRefGetAddress (CUdeviceptr *pdptr, CUtexref hTexRef)
 Gets the address associated with a texture reference.
CUresult Function() cuTexRefGetArray (CUarray *phArray, CUtexref hTexRef)
 Gets the array bound to a texture reference.
CUresult Function() cuTexRefGetAddressMode (CUaddress_mode *pam, CUtexref hTexRef, int dim)
 Gets the addressing mode used by a texture reference.
CUresult Function() cuTexRefGetFilterMode (CUfilter_mode *pfm, CUtexref hTexRef)
 Gets the filter-mode used by a texture reference.
CUresult Function() cuTexRefGetFormat (CUarray_format *pFormat, int *pNumChannels, CUtexref hTexRef)
 Gets the format used by a texture reference.
CUresult Function() cuTexRefGetFlags (unsigned int *pFlags, CUtexref hTexRef)
 Gets the flags used by a texture reference.
CUresult Function() cuParamSetSize (CUfunction hfunc, unsigned int numbytes)
 Sets the parameter size for the function.
CUresult Function() cuParamSeti (CUfunction hfunc, int offset, unsigned int value)
 Adds an integer parameter to the function's argument list.
CUresult Function() cuParamSetf (CUfunction hfunc, int offset, float value)
 Adds a floating-point parameter to the function's argument list.
CUresult Function() cuParamSetv (CUfunction hfunc, int offset, void *ptr, unsigned int numbytes)
 Adds arbitrary data to the function's argument list.
CUresult Function() cuParamSetTexRef (CUfunction hfunc, int texunit, CUtexref hTexRef)
 Adds a texture-reference to the function's argument list.
CUresult Function() cuLaunch (CUfunction f)
 Launches a CUDA function.
CUresult Function() cuLaunchGrid (CUfunction f, int grid_width, int grid_height)
 Launches a CUDA function.
CUresult Function() cuLaunchGridAsync (CUfunction f, int grid_width, int grid_height, CUstream hStream)
 Launches a CUDA function.
CUresult Function() cuEventCreate (CUevent *phEvent, unsigned int Flags)
 Creates an event.
CUresult Function() cuEventRecord (CUevent hEvent, CUstream hStream)
 Records an event.
CUresult Function() cuEventQuery (CUevent hEvent)
 Queries an event's status.
CUresult Function() cuEventSynchronize (CUevent hEvent)
 Waits for an event to complete.
CUresult Function() cuEventDestroy (CUevent hEvent)
 Destroys an event.
CUresult Function() cuEventElapsedTime (float *pMilliseconds, CUevent hStart, CUevent hEnd)
 Computes the elapsed time between two events.
CUresult Function() cuStreamCreate (CUstream *phStream, unsigned int Flags)
 Create a stream.
CUresult Function() cuStreamQuery (CUstream hStream)
 Determine status of a compute stream.
CUresult Function() cuStreamSynchronize (CUstream hStream)
 Wait until a stream's tasks are completed.
CUresult Function() cuStreamDestroy (CUstream hStream)
 Destroys a stream.
CUresult Function() cuGraphicsUnregisterResource (CUgraphicsResource resource)
 Unregisters a graphics resource for access by CUDA.
CUresult Function() cuGraphicsSubResourceGetMappedArray (CUarray *pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel)
 Get an array through which to access a subresource of a mapped graphics resource.
CUresult FunctionV() cuGraphicsResourceGetMappedPointer (CUdeviceptr *pDevPtr, size_t *pSize, CUgraphicsResource resource)
 Get a device pointer through which to access a mapped graphics resource.
CUresult Function() cuGraphicsResourceSetMapFlags (CUgraphicsResource resource, unsigned int flags)
 Set usage flags for mapping a graphics resource.
CUresult Function() cuGraphicsMapResources (unsigned int count, CUgraphicsResource *resources, CUstream hStream)
 Map graphics resources for access by CUDA.
CUresult Function() cuGraphicsUnmapResources (unsigned int count, CUgraphicsResource *resources, CUstream hStream)
 Unmap graphics resources.
CUresult Function() cuGLInit ()
CUresult Function() cuGLCtxCreate (CUcontext *pCtx, unsigned int Flags, CUdevice device)
CUresult Function() cuGLRegisterBufferObject (GLuint bufferobj)
CUresult Function() cuGraphicsGLRegisterBuffer (CUgraphicsResource *pCudaResource, unsigned int buffer, unsigned int Flags)
CUresult Function() cuGraphicsGLRegisterImage (CUgraphicsResource *pCudaResource, unsigned int image, int target, unsigned int Flags)
CUresult Function() cuGLSetBufferObjectMapFlags (GLuint buffer, unsigned int flags)

Detailed Description

implements CUDA Driver API functions which call through to the implementation of the appropriate CUDA Driver API front-end implementation

Author:
Andrew Kerr <arkerr@gatech.edu>
Date:
Sept 16 2010 somewhere over western Europe

Define Documentation

#define CATCH_RUNTIME_EXCEPTIONS   0
#define CUDA_VERBOSE   1
#define Function (   f)    f
#define FunctionV (   f)    f ## _v2
#define Ocelot_Exception (   x)    { std::stringstream ss; ss << x; throw hydrazine::Exception(ss.str()) ); }
#define REPORT_BASE   1
#define RETURN (   x)    return x
#define trace ( )

Typedef Documentation


Function Documentation

CUresult Function() cuGLCtxCreate ( CUcontext pCtx,
unsigned int  Flags,
CUdevice  device 
)
CUresult Function() cuGLInit ( )
CUresult Function() cuGLRegisterBufferObject ( GLuint  bufferobj)
CUresult Function() cuGLSetBufferObjectMapFlags ( GLuint  buffer,
unsigned int  flags 
)
CUresult Function() cuGraphicsGLRegisterBuffer ( CUgraphicsResource pCudaResource,
unsigned int  buffer,
unsigned int  Flags 
)
CUresult Function() cuGraphicsGLRegisterImage ( CUgraphicsResource pCudaResource,
unsigned int  image,
int  target,
unsigned int  Flags 
)
CUresult FunctionV() cuMemAlloc ( CUdeviceptr dptr,
unsigned int  bytesize 
)
CUresult FunctionV() cuMemAllocPitch ( CUdeviceptr dptr,
size_t pPitch,
unsigned int  WidthInBytes,
unsigned int  Height,
unsigned int  ElementSizeBytes 
)
CUresult FunctionV() cuMemcpyAtoA ( CUarray  dstArray,
unsigned int  dstIndex,
CUarray  srcArray,
unsigned int  srcIndex,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemcpyAtoD ( CUdeviceptr  dstDevice,
CUarray  hSrc,
unsigned int  SrcIndex,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemcpyAtoH ( void *  dstHost,
CUarray  srcArray,
unsigned int  srcIndex,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemcpyAtoHAsync ( void *  dstHost,
CUarray  srcArray,
unsigned int  srcIndex,
unsigned int  ByteCount,
CUstream  hStream 
)
CUresult FunctionV() cuMemcpyDtoA ( CUarray  dstArray,
unsigned int  dstIndex,
CUdeviceptr  srcDevice,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemcpyDtoD ( CUdeviceptr  dstDevice,
CUdeviceptr  srcDevice,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemcpyDtoH ( void *  dstHost,
CUdeviceptr  srcDevice,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemcpyDtoHAsync ( void *  dstHost,
CUdeviceptr  srcDevice,
unsigned int  ByteCount,
CUstream  hStream 
)
CUresult FunctionV() cuMemcpyHtoA ( CUarray  dstArray,
unsigned int  dstIndex,
const void *  pSrc,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemcpyHtoAAsync ( CUarray  dstArray,
unsigned int  dstIndex,
const void *  pSrc,
unsigned int  ByteCount,
CUstream  hStream 
)
CUresult FunctionV() cuMemcpyHtoD ( CUdeviceptr  dstDevice,
const void *  srcHost,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemcpyHtoDAsync ( CUdeviceptr  dstDevice,
const void *  srcHost,
unsigned int  ByteCount,
CUstream  hStream 
)
CUresult FunctionV() cuMemcpyHtoH ( void *  dstHost,
const void *  srcHost,
unsigned int  ByteCount 
)
CUresult FunctionV() cuMemsetD16 ( CUdeviceptr  dstDevice,
unsigned short  us,
unsigned int  N 
)
CUresult FunctionV() cuMemsetD2D16 ( CUdeviceptr  dstDevice,
unsigned int  dstPitch,
unsigned short  us,
unsigned int  Width,
unsigned int  Height 
)
CUresult FunctionV() cuMemsetD2D32 ( CUdeviceptr  dstDevice,
unsigned int  dstPitch,
unsigned int  ui,
unsigned int  Width,
unsigned int  Height 
)
CUresult FunctionV() cuMemsetD2D8 ( CUdeviceptr  dstDevice,
unsigned int  dstPitch,
unsigned char  uc,
unsigned int  Width,
unsigned int  Height 
)
CUresult FunctionV() cuMemsetD32 ( CUdeviceptr  dstDevice,
unsigned int  ui,
unsigned int  N 
)
CUresult FunctionV() cuMemsetD8 ( CUdeviceptr  dstDevice,
unsigned char  uc,
unsigned int  N 
)
CUresult FunctionV() cuTexRefSetAddress ( size_t ByteOffset,
CUtexref  hTexRef,
CUdeviceptr  dptr,
unsigned int  bytes 
)
CUresult FunctionV() cuTexRefSetAddress2D ( CUtexref  hTexRef,
const CUDA_ARRAY_DESCRIPTOR desc,
CUdeviceptr  dptr,
unsigned int  Pitch 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines