ILGPU  0.9.0
ILGPU.Runtime.Cuda.API.CudaAPI Class Referenceabstract

Wraps the Cuda-driver API. More...

Inheritance diagram for ILGPU.Runtime.Cuda.API.CudaAPI:
ILGPU.Runtime.Cuda.API.CudaAPIUnix ILGPU.Runtime.Cuda.API.CudaAPIWindows ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI

Public Member Functions

abstract CudaError GetDriverVersion (out CudaDriverVersion driverVersion)
 Resolves the current driver version. More...
 
string GetErrorString (CudaError error)
 Resolves the error string for the given error status. More...
 
abstract CudaError GetDevice (out int device, int ordinal)
 Resolves the device id for the given ordinal. More...
 
abstract CudaError GetDeviceCount (out int count)
 Resolves the number of available devices. More...
 
unsafe CudaError GetDeviceName (out string name, int device)
 Resolves the name of a device. More...
 
abstract CudaError GetTotalDeviceMemory (out IntPtr bytes, int device)
 Resolves total device memory. More...
 
CudaError GetTotalDeviceMemory (out long bytes, int device)
 Resolves total device memory. More...
 
abstract CudaError GetDeviceComputeCapability (out int major, out int minor, int device)
 Resolves the compute capability of the given device. More...
 
abstract CudaError CreateContext (out IntPtr context, CudaAcceleratorFlags flags, int device)
 Creates a new context. More...
 
abstract CudaError CreateContextD3D11 (out IntPtr context, out int device, CudaAcceleratorFlags flags, IntPtr d3dDevice)
 Creates a new context with D3D11 support More...
 
abstract CudaError DestroyContext (IntPtr context)
 Destroys the given context. More...
 
abstract CudaError SetCurrentContext (IntPtr context)
 Make the given context the current one. More...
 
abstract CudaError SynchronizeContext ()
 Synchronizes the current context. More...
 
abstract CudaError GetCacheConfig (out CudaCacheConfiguration config)
 Resolves the cache configuration. More...
 
abstract CudaError SetCacheConfig (CudaCacheConfiguration config)
 Updates the cache configuration. More...
 
abstract CudaError GetSharedMemoryConfig (out CudaSharedMemoryConfiguration config)
 Resolves the shared-memory configuration. More...
 
abstract CudaError SetSharedMemoryConfig (CudaSharedMemoryConfiguration config)
 Updates the shared-memory configuration. More...
 
abstract CudaError CanAccessPeer (out int canAccess, int device, int peerDevice)
 Resolves whether the given device can access the given peer device. More...
 
abstract CudaError EnablePeerAccess (IntPtr peerContext, int flags)
 Enables peer access to the given context. More...
 
abstract CudaError DisablePeerAccess (IntPtr peerContext)
 Disables peer access to the given context. More...
 
abstract CudaError GetMemoryInfo (out IntPtr free, out IntPtr total)
 Resolves memory information. More...
 
CudaError GetMemoryInfo (out long free, out long total)
 Resolves memory information. More...
 
abstract CudaError AllocateMemory (out IntPtr devicePtr, IntPtr bytesize)
 Allocates memory on the current device. More...
 
abstract CudaError FreeMemory (IntPtr devicePtr)
 Frees the given device pointer. More...
 
abstract CudaError AllocateHostMemory (out IntPtr hostPtr, IntPtr bytesize)
 Allocates memory on the host. More...
 
abstract CudaError FreeHostMemory (IntPtr hostPtr)
 Frees the given host pointer. More...
 
abstract CudaError Memcpy (IntPtr destination, IntPtr source, IntPtr length)
 Performs a memory-copy operation. More...
 
CudaError MemcpyHostToDevice (IntPtr destinationDevice, IntPtr sourceHost, IntPtr length, AcceleratorStream stream)
 Performs a memory-copy operation from host to device memory. More...
 
abstract CudaError MemcpyHostToDevice (IntPtr destinationDevice, IntPtr sourceHost, IntPtr length, IntPtr stream)
 Performs a memory-copy operation from host to device memory. More...
 
CudaError MemcpyDeviceToHost (IntPtr destinationHost, IntPtr sourceDevice, IntPtr length, AcceleratorStream stream)
 Performs a memory-copy operation from device to host memory. More...
 
abstract CudaError MemcpyDeviceToHost (IntPtr destinationHost, IntPtr sourceDevice, IntPtr length, IntPtr stream)
 Performs a memory-copy operation from device to host memory. More...
 
CudaError MemcpyDeviceToDevice (IntPtr destinationDevice, IntPtr sourceDevice, IntPtr length, AcceleratorStream stream)
 Performs a memory-copy operation from device to device memory. More...
 
abstract CudaError MemcpyDeviceToDevice (IntPtr destinationDevice, IntPtr sourceDevice, IntPtr length, IntPtr stream)
 Performs a memory-copy operation from device to device memory. More...
 
CudaError Memset (IntPtr destinationDevice, byte value, IntPtr length, AcceleratorStream stream)
 Performs a memory-set operation. More...
 
abstract CudaError Memset (IntPtr destinationDevice, byte value, IntPtr length, IntPtr stream)
 Performs a memory-set operation. More...
 
abstract CudaError DestroyStream (IntPtr stream)
 Destroys the given stream. More...
 
abstract CudaError SynchronizeStream (IntPtr stream)
 Synchronizes with the given stream. More...
 
abstract CudaError LoadModule (out IntPtr kernelModule, string moduleData)
 Loads the given kernel module into driver memory. More...
 
abstract CudaError LoadModule (out IntPtr kernelModule, string moduleData, int numOptions, IntPtr jitOptions, IntPtr jitOptionValues)
 Loads the given kernel module into driver memory. More...
 
unsafe CudaError LoadModule (out IntPtr kernelModule, string moduleData, out string errorLog)
 Loads the given kernel module into driver memory. More...
 
abstract CudaError DestroyModule (IntPtr kernelModule)
 Unloads the given module. More...
 
abstract CudaError GetModuleFunction (out IntPtr kernelFunction, IntPtr kernelModule, string functionName)
 Resolves the requested function handle in the scope of the given module. More...
 
abstract CudaError LaunchKernel (IntPtr kernelFunction, int gridDimX, int gridDimY, int gridDimZ, int blockDimX, int blockDimY, int blockDimZ, int sharedMemSizeInBytes, IntPtr stream, IntPtr args, IntPtr kernelArgs)
 Launches the given kernel function. More...
 
unsafe CudaError LaunchKernelWithStruct< T > (IntPtr kernelFunction, int gridDimX, int gridDimY, int gridDimZ, int blockDimX, int blockDimY, int blockDimZ, int sharedMemSizeInBytes, IntPtr stream, ref T argument, int argumentLength)
 Launches the given kernel function using a bulk structure. More...
 
abstract CudaError ComputeOccupancyMaxActiveBlocksPerMultiprocessor (out int numBlocks, IntPtr func, int blockSize, IntPtr dynamicSMemSize)
 Computes the maximum number of blocks for maximum occupancy. More...
 
abstract CudaError ComputeOccupancyMaxPotentialBlockSize (out int minGridSize, out int blockSize, IntPtr func, ComputeDynamicMemorySizeForBlockSize blockSizeToDynamicSMemSize, IntPtr dynamicSMemSize, int blockSizeLimit)
 Computes the maximum potential block size to for maximum occupancy. More...
 
CudaError ComputeOccupancyMaxPotentialBlockSize (out int minGridSize, out int blockSize, IntPtr func, ComputeManagedDynamicMemorySizeForBlockSize blockSizeToDynamicSMemSize, int dynamicSMemSize, int blockSizeLimit)
 Computes the maximum potential block size to for maximum occupancy. More...
 

Protected Member Functions

abstract CudaError InitAPI ()
 Initializes the driver API. More...
 
abstract CudaError GetDeviceName (byte[] bytes, int length, int device)
 Resolves the name of a device. More...
 

Properties

static CudaAPI Current [get]
 Returns the driver API for the current platform. More...
 

Detailed Description

Wraps the Cuda-driver API.

Since the current implementation of .Net Core does not support platform-dependent DLL imports with different entry point and libs, we have to wrap the direct low-level calls with (slow) virtual dispatchers. This will be removed as soon as .Net Core adds additional support.

Member Function Documentation

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.AllocateHostMemory ( out IntPtr  hostPtr,
IntPtr  bytesize 
)
pure virtual

Allocates memory on the host.

Parameters
hostPtrThe resulting host pointer.
bytesizeThe size of the allocation in bytes.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.AllocateMemory ( out IntPtr  devicePtr,
IntPtr  bytesize 
)
pure virtual

Allocates memory on the current device.

Parameters
devicePtrThe resulting device pointer.
bytesizeThe size of the allocation in bytes.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.CanAccessPeer ( out int  canAccess,
int  device,
int  peerDevice 
)
pure virtual

Resolves whether the given device can access the given peer device.

Parameters
canAccessTrue, if the device can access the peer device.
deviceThe device.
peerDeviceThe peer device.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.ComputeOccupancyMaxActiveBlocksPerMultiprocessor ( out int  numBlocks,
IntPtr  func,
int  blockSize,
IntPtr  dynamicSMemSize 
)
pure virtual

Computes the maximum number of blocks for maximum occupancy.

Parameters
numBlocksThe number of blocks.
funcThe function.
blockSizeThe desired block size.
dynamicSMemSizeThe size of the required shared memory.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.ComputeOccupancyMaxPotentialBlockSize ( out int  minGridSize,
out int  blockSize,
IntPtr  func,
ComputeDynamicMemorySizeForBlockSize  blockSizeToDynamicSMemSize,
IntPtr  dynamicSMemSize,
int  blockSizeLimit 
)
pure virtual

Computes the maximum potential block size to for maximum occupancy.

Parameters
minGridSizeThe minimum grid size for maximum occupancy.
blockSizeThe block size for maximum occupancy.
funcThe function.
blockSizeToDynamicSMemSizeComputes the amount of required shared-memory for the given block size.
dynamicSMemSizeThe size of the required shared memory (independent of the block size).
blockSizeLimitThe block-size limit.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

CudaError ILGPU.Runtime.Cuda.API.CudaAPI.ComputeOccupancyMaxPotentialBlockSize ( out int  minGridSize,
out int  blockSize,
IntPtr  func,
ComputeManagedDynamicMemorySizeForBlockSize  blockSizeToDynamicSMemSize,
int  dynamicSMemSize,
int  blockSizeLimit 
)

Computes the maximum potential block size to for maximum occupancy.

Parameters
minGridSizeThe minimum grid size for maximum occupancy.
blockSizeThe block size for maximum occupancy.
funcThe function.
blockSizeToDynamicSMemSizeComputes the amount of required shared-memory for the given block size.
dynamicSMemSizeThe size of the required shared memory (independent of the block size).
blockSizeLimitThe block-size limit.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.CreateContext ( out IntPtr  context,
CudaAcceleratorFlags  flags,
int  device 
)
pure virtual

Creates a new context.

Parameters
contextThe created context.
flagsThe flags to use.
deviceThe target device.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.CreateContextD3D11 ( out IntPtr  context,
out int  device,
CudaAcceleratorFlags  flags,
IntPtr  d3dDevice 
)
pure virtual

Creates a new context with D3D11 support

Parameters
contextThe created context.
flagsThe flags to use.
deviceThe target device.
d3dDeviceThe associated D3D11 device.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.DestroyContext ( IntPtr  context)
pure virtual

Destroys the given context.

Parameters
contextThe context to destroy.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.DestroyModule ( IntPtr  kernelModule)
pure virtual

Unloads the given module.

Parameters
kernelModuleThe module to unload.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.DestroyStream ( IntPtr  stream)
pure virtual

Destroys the given stream.

Parameters
streamThe stream to destroy.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.DisablePeerAccess ( IntPtr  peerContext)
pure virtual

Disables peer access to the given context.

Parameters
peerContextThe peer context.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.EnablePeerAccess ( IntPtr  peerContext,
int  flags 
)
pure virtual

Enables peer access to the given context.

Parameters
peerContextThe peer context.
flagsThe flags to use.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.FreeHostMemory ( IntPtr  hostPtr)
pure virtual

Frees the given host pointer.

Parameters
hostPtrThe host pointer.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.FreeMemory ( IntPtr  devicePtr)
pure virtual

Frees the given device pointer.

Parameters
devicePtrThe device pointer.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetCacheConfig ( out CudaCacheConfiguration  config)
pure virtual

Resolves the cache configuration.

Parameters
configThe resolved cache configuration.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetDevice ( out int  device,
int  ordinal 
)
pure virtual

Resolves the device id for the given ordinal.

Parameters
deviceThe device id.
ordinalThe device ordinal.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetDeviceComputeCapability ( out int  major,
out int  minor,
int  device 
)
pure virtual

Resolves the compute capability of the given device.

Parameters
majorThe major capability.
minorThe minor capability.
deviceThe device.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetDeviceCount ( out int  count)
pure virtual

Resolves the number of available devices.

Parameters
countThe number of devices
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetDeviceName ( byte[]  bytes,
int  length,
int  device 
)
protectedpure virtual

Resolves the name of a device.

Parameters
bytesThe memory buffer in bytes.
lengthThe maximum length to resolve.
deviceThe device.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

unsafe CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetDeviceName ( out string  name,
int  device 
)

Resolves the name of a device.

Parameters
nameThe resolved name.
deviceThe device.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetDriverVersion ( out CudaDriverVersion  driverVersion)
pure virtual

Resolves the current driver version.

Parameters
driverVersionThe resolved driver version.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

string ILGPU.Runtime.Cuda.API.CudaAPI.GetErrorString ( CudaError  error)

Resolves the error string for the given error status.

Parameters
errorThe error to resolve.
Returns
The resolved error string.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetMemoryInfo ( out IntPtr  free,
out IntPtr  total 
)
pure virtual

Resolves memory information.

Parameters
freeThe amount of free memory.
totalThe total amount of memory.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetMemoryInfo ( out long  free,
out long  total 
)

Resolves memory information.

Parameters
freeThe amount of free memory.
totalThe total amount of memory.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetModuleFunction ( out IntPtr  kernelFunction,
IntPtr  kernelModule,
string  functionName 
)
pure virtual

Resolves the requested function handle in the scope of the given module.

Parameters
kernelFunctionThe resolved function.
kernelModuleThe module.
functionNameThe name of the function.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetSharedMemoryConfig ( out CudaSharedMemoryConfiguration  config)
pure virtual

Resolves the shared-memory configuration.

Parameters
configThe resolved shared-memory configuration.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetTotalDeviceMemory ( out IntPtr  bytes,
int  device 
)
pure virtual

Resolves total device memory.

Parameters
bytesThe number of bytes.
deviceThe device.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

CudaError ILGPU.Runtime.Cuda.API.CudaAPI.GetTotalDeviceMemory ( out long  bytes,
int  device 
)

Resolves total device memory.

Parameters
bytesThe number of bytes.
deviceThe device.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.InitAPI ( )
protectedpure virtual
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.LaunchKernel ( IntPtr  kernelFunction,
int  gridDimX,
int  gridDimY,
int  gridDimZ,
int  blockDimX,
int  blockDimY,
int  blockDimZ,
int  sharedMemSizeInBytes,
IntPtr  stream,
IntPtr  args,
IntPtr  kernelArgs 
)
pure virtual

Launches the given kernel function.

Parameters
kernelFunctionThe function to launch.
gridDimXThe grid dimension in X dimension.
gridDimYThe grid dimension in Y dimension.
gridDimZThe grid dimension in Z dimension.
blockDimXThe block dimension in X dimension.
blockDimYThe block dimension in Y dimension.
blockDimZThe block dimension in Z dimension.
sharedMemSizeInBytesThe shared-memory size in bytes.
streamThe associated accelerator stream.
argsThe arguments.
kernelArgsThe kernel arguments.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

unsafe CudaError ILGPU.Runtime.Cuda.API.CudaAPI.LaunchKernelWithStruct< T > ( IntPtr  kernelFunction,
int  gridDimX,
int  gridDimY,
int  gridDimZ,
int  blockDimX,
int  blockDimY,
int  blockDimZ,
int  sharedMemSizeInBytes,
IntPtr  stream,
ref T  argument,
int  argumentLength 
)

Launches the given kernel function using a bulk structure.

Parameters
kernelFunctionThe function to launch.
gridDimXThe grid dimension in X dimension.
gridDimYThe grid dimension in Y dimension.
gridDimZThe grid dimension in Z dimension.
blockDimXThe block dimension in X dimension.
blockDimYThe block dimension in Y dimension.
blockDimZThe block dimension in Z dimension.
sharedMemSizeInBytesThe shared-memory size in bytes.
streamThe associated accelerator stream.
argumentThe argument structure.
argumentLengthThe length of the memory region in bytes.
Returns
The error status.
Type Constraints
T :unmanaged 
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.LoadModule ( out IntPtr  kernelModule,
string  moduleData 
)
pure virtual

Loads the given kernel module into driver memory.

Parameters
kernelModuleThe loaded module.
moduleDataThe module data to load.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.LoadModule ( out IntPtr  kernelModule,
string  moduleData,
int  numOptions,
IntPtr  jitOptions,
IntPtr  jitOptionValues 
)
pure virtual

Loads the given kernel module into driver memory.

Parameters
kernelModuleThe loaded module.
moduleDataThe module data to load.
numOptionsThe number of JIT options.
jitOptionsThe JIT options.
jitOptionValuesThe JIT values.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

unsafe CudaError ILGPU.Runtime.Cuda.API.CudaAPI.LoadModule ( out IntPtr  kernelModule,
string  moduleData,
out string  errorLog 
)

Loads the given kernel module into driver memory.

Parameters
kernelModuleThe loaded module.
moduleDataThe module data to load.
errorLogThe error log.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.Memcpy ( IntPtr  destination,
IntPtr  source,
IntPtr  length 
)
pure virtual

Performs a memory-copy operation.

Parameters
destinationThe destination.
sourceThe source.
lengthThe number of bytes to copy.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

CudaError ILGPU.Runtime.Cuda.API.CudaAPI.MemcpyDeviceToDevice ( IntPtr  destinationDevice,
IntPtr  sourceDevice,
IntPtr  length,
AcceleratorStream  stream 
)

Performs a memory-copy operation from device to device memory.

Parameters
destinationDeviceThe destination in device memory.
sourceDeviceThe source in device memory.
lengthThe number of bytes to copy.
streamThe accelerator stream for asynchronous processing.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.MemcpyDeviceToDevice ( IntPtr  destinationDevice,
IntPtr  sourceDevice,
IntPtr  length,
IntPtr  stream 
)
pure virtual

Performs a memory-copy operation from device to device memory.

Parameters
destinationDeviceThe destination in device memory.
sourceDeviceThe source in device memory.
lengthThe number of bytes to copy.
streamThe accelerator stream for asynchronous processing.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

CudaError ILGPU.Runtime.Cuda.API.CudaAPI.MemcpyDeviceToHost ( IntPtr  destinationHost,
IntPtr  sourceDevice,
IntPtr  length,
AcceleratorStream  stream 
)

Performs a memory-copy operation from device to host memory.

Parameters
destinationHostThe destination in host memory.
sourceDeviceThe source in device memory.
lengthThe number of bytes to copy.
streamThe accelerator stream for asynchronous processing.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.MemcpyDeviceToHost ( IntPtr  destinationHost,
IntPtr  sourceDevice,
IntPtr  length,
IntPtr  stream 
)
pure virtual

Performs a memory-copy operation from device to host memory.

Parameters
destinationHostThe destination in host memory.
sourceDeviceThe source in device memory.
lengthThe number of bytes to copy.
streamThe accelerator stream for asynchronous processing.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

CudaError ILGPU.Runtime.Cuda.API.CudaAPI.MemcpyHostToDevice ( IntPtr  destinationDevice,
IntPtr  sourceHost,
IntPtr  length,
AcceleratorStream  stream 
)

Performs a memory-copy operation from host to device memory.

Parameters
destinationDeviceThe destination in device memory.
sourceHostThe source in host memory.
lengthThe number of bytes to copy.
streamThe accelerator stream for asynchronous processing.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.MemcpyHostToDevice ( IntPtr  destinationDevice,
IntPtr  sourceHost,
IntPtr  length,
IntPtr  stream 
)
pure virtual

Performs a memory-copy operation from host to device memory.

Parameters
destinationDeviceThe destination in device memory.
sourceHostThe source in host memory.
lengthThe number of bytes to copy.
streamThe accelerator stream for asynchronous processing.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

CudaError ILGPU.Runtime.Cuda.API.CudaAPI.Memset ( IntPtr  destinationDevice,
byte  value,
IntPtr  length,
AcceleratorStream  stream 
)

Performs a memory-set operation.

Parameters
destinationDeviceThe destination in device memory.
valueThe value to set.
lengthThe length in bytes.
streamThe accelerator stream for asynchronous processing.
Returns
The error status.
abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.Memset ( IntPtr  destinationDevice,
byte  value,
IntPtr  length,
IntPtr  stream 
)
pure virtual

Performs a memory-set operation.

Parameters
destinationDeviceThe destination in device memory.
valueThe value to set.
lengthThe length in bytes.
streamThe accelerator stream for asynchronous processing.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.SetCacheConfig ( CudaCacheConfiguration  config)
pure virtual

Updates the cache configuration.

Parameters
configThe updated cache configuration.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.SetCurrentContext ( IntPtr  context)
pure virtual

Make the given context the current one.

Parameters
contextThe context.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.SetSharedMemoryConfig ( CudaSharedMemoryConfiguration  config)
pure virtual

Updates the shared-memory configuration.

Parameters
configThe updated shared-memory configuration.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.SynchronizeContext ( )
pure virtual

Synchronizes the current context.

Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

abstract CudaError ILGPU.Runtime.Cuda.API.CudaAPI.SynchronizeStream ( IntPtr  stream)
pure virtual

Synchronizes with the given stream.

Parameters
streamThe stream to synchronize with.
Returns
The error status.

Implemented in ILGPU.Runtime.Cuda.API.CudaAPIWindows, ILGPU.Runtime.Cuda.API.CudaAPIUnix, and ILGPU.Runtime.Cuda.API.NotSupportedCudaAPI.

Property Documentation

CudaAPI ILGPU.Runtime.Cuda.API.CudaAPI.Current
staticget

Returns the driver API for the current platform.


The documentation for this class was generated from the following file: