Class CudaKernel
A CUDA function or CUDA kernel
Inheritance
Inherited Members
Namespace: ManagedCuda
Assembly: ManagedCuda.dll
Syntax
public class CudaKernel
Constructors
| Improve this Doc View SourceCudaKernel(String, CUmodule, CudaContext)
Loads the given CUDA kernel from the CUmodule. Block and Grid dimensions must be set before running the kernel. Shared memory size is set to 0.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
CudaKernel(String, CUmodule, CudaContext, dim3)
Loads the given CUDA kernel from the CUmodule. Block dimensions are set directly, grid dimensions must be set before running the kernel. Shared memory size is set to 0.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, dim3 blockDim)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| dim3 | blockDim | Dimension of block of threads |
CudaKernel(String, CUmodule, CudaContext, dim3, dim3)
Loads the given CUDA kernel from the CUmodule. Block and Grid dimensions are set directly. Shared memory size is set to 0.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, dim3 blockDim, dim3 gridDim)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| dim3 | blockDim | Dimension of block of threads |
| dim3 | gridDim | Dimension of grid of block of threads |
CudaKernel(String, CUmodule, CudaContext, dim3, dim3, UInt32)
Loads the given CUDA kernel from the CUmodule. Block and Grid dimensions and shared memory size are set directly.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, dim3 blockDim, dim3 gridDim, uint sharedMemory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| dim3 | blockDim | Dimension of block of threads (2D - z-component is discarded) |
| dim3 | gridDim | Dimension of grid of block of threads (3D) |
| System.UInt32 | sharedMemory | Dynamic shared memory size in Bytes |
CudaKernel(String, CUmodule, CudaContext, dim3, UInt32)
Loads the given CUDA kernel from the CUmodule. Block dimensions and shared memors size are set directly, grid dimensions must be set before running the kernel.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, dim3 blockDim, uint sharedMemory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| dim3 | blockDim | Dimension of block of threads |
| System.UInt32 | sharedMemory | Dynamic shared memory size in Bytes |
CudaKernel(String, CUmodule, CudaContext, UInt32)
Loads the given CUDA kernel from the CUmodule. Block and Grid dimensions must be set before running the kernel. Shared memory size is set directly.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, uint sharedMemory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| System.UInt32 | sharedMemory | Dynamic shared memory size in Bytes |
CudaKernel(String, CUmodule, CudaContext, UInt32, UInt32, UInt32)
Loads the given CUDA kernel from the CUmodule. Block dimensions are set directly, grid dimensions must be set before running the kernel. Shared memory size is set to 0.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, uint blockDimX, uint blockDimY, uint blockDimZ)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| System.UInt32 | blockDimX | Dimension of block of threads X |
| System.UInt32 | blockDimY | Dimension of block of threads Y |
| System.UInt32 | blockDimZ | Dimension of block of threads Z |
CudaKernel(String, CUmodule, CudaContext, UInt32, UInt32, UInt32, UInt32, UInt32)
Loads the given CUDA kernel from the CUmodule. Block and Grid dimensions are set directly. Shared memory size is set to 0.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, uint blockDimX, uint blockDimY, uint blockDimZ, uint gridDimX, uint gridDimY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| System.UInt32 | blockDimX | Dimension of block of threads X |
| System.UInt32 | blockDimY | Dimension of block of threads Y |
| System.UInt32 | blockDimZ | Dimension of block of threads Z |
| System.UInt32 | gridDimX | Dimension of grid of block of threads X |
| System.UInt32 | gridDimY | Dimension of grid of block of threads Y |
CudaKernel(String, CUmodule, CudaContext, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32)
Loads the given CUDA kernel from the CUmodule. Block and Grid dimensions are set directly. Shared memory size is set to 0.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, uint blockDimX, uint blockDimY, uint blockDimZ, uint gridDimX, uint gridDimY, uint gridDimZ)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| System.UInt32 | blockDimX | Dimension of block of threads X |
| System.UInt32 | blockDimY | Dimension of block of threads Y |
| System.UInt32 | blockDimZ | Dimension of block of threads Z |
| System.UInt32 | gridDimX | Dimension of grid of block of threads X |
| System.UInt32 | gridDimY | Dimension of grid of block of threads Y |
| System.UInt32 | gridDimZ | Dimension of grid of block of threads Z |
CudaKernel(String, CUmodule, CudaContext, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32)
Loads the given CUDA kernel from the CUmodule. Block dimensions and shared memors size are set directly, grid dimensions must be set before running the kernel.
Declaration
public CudaKernel(string kernelName, CUmodule module, CudaContext cuda, uint blockDimX, uint blockDimY, uint blockDimZ, uint gridDimX, uint gridDimY, uint gridDimZ, uint sharedMemory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | kernelName | The kernel name as defined in the *.cu file |
| CUmodule | module | The CUmodule which contains the kernel |
| CudaContext | cuda | CUDA abstraction layer object (= CUDA context) for this Kernel |
| System.UInt32 | blockDimX | Dimension of block of threads X |
| System.UInt32 | blockDimY | Dimension of block of threads Y |
| System.UInt32 | blockDimZ | Dimension of block of threads Z |
| System.UInt32 | gridDimX | Dimension of grid of block of threads X |
| System.UInt32 | gridDimY | Dimension of grid of block of threads Y |
| System.UInt32 | gridDimZ | Dimension of grid of block of threads Z |
| System.UInt32 | sharedMemory | Dynamic shared memory size in Bytes |
Fields
| Improve this Doc View Source_binaryVersion
Declaration
protected Version _binaryVersion
Field Value
| Type | Description |
|---|---|
| System.Version |
_blockDim
Declaration
protected dim3 _blockDim
Field Value
| Type | Description |
|---|---|
| dim3 |
_cacheModeCA
Declaration
protected bool _cacheModeCA
Field Value
| Type | Description |
|---|---|
| System.Boolean |
_constSizeBytes
Declaration
protected int _constSizeBytes
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_cuda
Declaration
protected CudaContext _cuda
Field Value
| Type | Description |
|---|---|
| CudaContext |
_function
Declaration
protected CUfunction _function
Field Value
| Type | Description |
|---|---|
| CUfunction |
_gridDim
Declaration
protected dim3 _gridDim
Field Value
| Type | Description |
|---|---|
| dim3 |
_kernelName
Declaration
protected string _kernelName
Field Value
| Type | Description |
|---|---|
| System.String |
_localSizeBytes
Declaration
protected int _localSizeBytes
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_maxThreadsPerBlock
Declaration
protected int _maxThreadsPerBlock
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_module
Declaration
protected CUmodule _module
Field Value
| Type | Description |
|---|---|
| CUmodule |
_numRegs
Declaration
protected int _numRegs
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_ptxVersion
Declaration
protected Version _ptxVersion
Field Value
| Type | Description |
|---|---|
| System.Version |
_sharedMemSize
Declaration
protected uint _sharedMemSize
Field Value
| Type | Description |
|---|---|
| System.UInt32 |
_sharedSizeBytes
Declaration
protected int _sharedSizeBytes
Field Value
| Type | Description |
|---|---|
| System.Int32 |
res
Declaration
protected CUResult res
Field Value
| Type | Description |
|---|---|
| CUResult |
Properties
| Improve this Doc View SourceBinaryVersion
The binary version for which the function was compiled. This value is the major binary version * 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version.
Declaration
public Version BinaryVersion { get; }
Property Value
| Type | Description |
|---|---|
| System.Version |
BlockDimensions
Get or set the thread block dimensions. Block dimenions must be set before the first kernel launch.
Declaration
public dim3 BlockDimensions { get; set; }
Property Value
| Type | Description |
|---|---|
| dim3 |
CacheModeCA
The attribute to indicate whether the function has been compiled with user specified option "-Xptxas --dlcm=ca" set.
Declaration
public bool CacheModeCA { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ConstMemory
The size in bytes of statically-allocated shared memory required by this function.
This does not include dynamically-allocated shared memory requested by the user at runtime.
Declaration
public int ConstMemory { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
CUFunction
CUFunction
Declaration
public CUfunction CUFunction { get; }
Property Value
| Type | Description |
|---|---|
| CUfunction |
CUModule
CUModule
Declaration
public CUmodule CUModule { get; }
Property Value
| Type | Description |
|---|---|
| CUmodule |
DynamicSharedMemory
Dynamic shared memory size in Bytes. Must be set before the first kernel launch.
Declaration
public uint DynamicSharedMemory { get; set; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
GridDimensions
Get or set the thread grid dimensions. Grid dimenions must be set before the first kernel launch.
Declaration
public dim3 GridDimensions { get; set; }
Property Value
| Type | Description |
|---|---|
| dim3 |
KernelName
Kernel name as defined in the kernel source code.
Declaration
public string KernelName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
LocalMemory
The size in bytes of thread local memory used by this function.
Declaration
public int LocalMemory { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
MaxDynamicSharedSizeBytes
This maximum size in bytes of dynamically-allocated shared memory.The value should contain the requested maximum size of dynamically-allocated shared memory.The sum of this value and the function attribute::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES cannot exceed the device attribute ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN. The maximal size of requestable dynamic shared memory may differ by GPU architecture.
Declaration
public int MaxDynamicSharedSizeBytes { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
MaxThreadsPerBlock
The number of threads beyond which a launch of the function would fail.
This number depends on both the function and the device on which the function is currently loaded.
Declaration
public int MaxThreadsPerBlock { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
PreferredSharedMemoryCarveout
On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total resources.This is only a hint, and the driver can choose a different ratio if required to execute the function.
Declaration
public CUshared_carveout PreferredSharedMemoryCarveout { get; set; }
Property Value
| Type | Description |
|---|---|
| CUshared_carveout |
PtxVersion
The PTX virtual architecture version for which the function was compiled. This value is the major PTX version * 10 + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0.
Declaration
public Version PtxVersion { get; }
Property Value
| Type | Description |
|---|---|
| System.Version |
Registers
The number of registers used by each thread of this function.
Declaration
public int Registers { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
SharedMemory
The size in bytes of statically-allocated shared memory required by this function.
This does not include dynamically-allocated shared memory requested by the user at runtime.
Declaration
public int SharedMemory { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceGetOccupancyMaxActiveBlocksPerMultiprocessor()
Returns the number of the maximum active blocks per streaming multiprocessor.
Declaration
public int GetOccupancyMaxActiveBlocksPerMultiprocessor()
Returns
| Type | Description |
|---|---|
| System.Int32 | number of the maximum active blocks per streaming multiprocessor. |
GetOccupancyMaxActiveBlocksPerMultiprocessor(CUoccupancy_flags)
Returns the number of the maximum active blocks per streaming multiprocessor.
Declaration
public int GetOccupancyMaxActiveBlocksPerMultiprocessor(CUoccupancy_flags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| CUoccupancy_flags | flags | Flags |
Returns
| Type | Description |
|---|---|
| System.Int32 | number of the maximum active blocks per streaming multiprocessor. |
GetOccupancyMaxActiveBlocksPerMultiprocessor(Int32, SizeT)
Returns the number of the maximum active blocks per streaming multiprocessor (Ignores current kernel settings).
Declaration
public int GetOccupancyMaxActiveBlocksPerMultiprocessor(int blockSize, SizeT dynamicSMemSize)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | blockSize | Block size the kernel is intended to be launched with |
| SizeT | dynamicSMemSize | Per-block dynamic shared memory usage intended, in bytes |
Returns
| Type | Description |
|---|---|
| System.Int32 | number of the maximum active blocks per streaming multiprocessor. |
GetOccupancyMaxActiveBlocksPerMultiprocessor(Int32, SizeT, CUoccupancy_flags)
Returns the number of the maximum active blocks per streaming multiprocessor (Ignores current kernel settings).
Declaration
public int GetOccupancyMaxActiveBlocksPerMultiprocessor(int blockSize, SizeT dynamicSMemSize, CUoccupancy_flags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | blockSize | Block size the kernel is intended to be launched with |
| SizeT | dynamicSMemSize | Per-block dynamic shared memory usage intended, in bytes |
| CUoccupancy_flags | flags | Flags |
Returns
| Type | Description |
|---|---|
| System.Int32 | number of the maximum active blocks per streaming multiprocessor. |
GetOccupancyMaxPotentialBlockSize()
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize()
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(CUoccupancy_flags)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(CUoccupancy_flags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| CUoccupancy_flags | flags | Flags |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize blockSizeToDynamicSMemSize)
Parameters
| Type | Name | Description |
|---|---|---|
| del_CUoccupancyB2DSize | blockSizeToDynamicSMemSize | if the per-block dynamic shared memory size varies with different block sizes, the user needs to provide a unary function through blockSizeToDynamicSMemSize that computes the dynamic shared memory needed by func for any given block size. |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize, CUoccupancy_flags)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize blockSizeToDynamicSMemSize, CUoccupancy_flags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| del_CUoccupancyB2DSize | blockSizeToDynamicSMemSize | if the per-block dynamic shared memory size varies with different block sizes, the user needs to provide a unary function through blockSizeToDynamicSMemSize that computes the dynamic shared memory needed by func for any given block size. |
| CUoccupancy_flags | flags | Flags |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize, Int32)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize blockSizeToDynamicSMemSize, int blockSizeLimit)
Parameters
| Type | Name | Description |
|---|---|---|
| del_CUoccupancyB2DSize | blockSizeToDynamicSMemSize | if the per-block dynamic shared memory size varies with different block sizes, the user needs to provide a unary function through blockSizeToDynamicSMemSize that computes the dynamic shared memory needed by func for any given block size. |
| System.Int32 | blockSizeLimit | If blockSizeLimit is 0, the configurator will use the maximum block size permitted by the device / function instead. |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize, Int32, CUoccupancy_flags)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize blockSizeToDynamicSMemSize, int blockSizeLimit, CUoccupancy_flags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| del_CUoccupancyB2DSize | blockSizeToDynamicSMemSize | if the per-block dynamic shared memory size varies with different block sizes, the user needs to provide a unary function through blockSizeToDynamicSMemSize that computes the dynamic shared memory needed by func for any given block size. |
| System.Int32 | blockSizeLimit | If blockSizeLimit is 0, the configurator will use the maximum block size permitted by the device / function instead. |
| CUoccupancy_flags | flags | Flags |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(SizeT)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(SizeT dynamicSMemSize)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeT | dynamicSMemSize | If per-block dynamic shared memory allocation is needed, then if the dynamic shared memory size is constant regardless of block size, the size should be passed through dynamicSMemSize |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(SizeT, CUoccupancy_flags)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(SizeT dynamicSMemSize, CUoccupancy_flags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeT | dynamicSMemSize | If per-block dynamic shared memory allocation is needed, then if the dynamic shared memory size is constant regardless of block size, the size should be passed through dynamicSMemSize |
| CUoccupancy_flags | flags | Flags |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(SizeT, Int32)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(SizeT dynamicSMemSize, int blockSizeLimit)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeT | dynamicSMemSize | If per-block dynamic shared memory allocation is needed, then if the dynamic shared memory size is constant regardless of block size, the size should be passed through dynamicSMemSize |
| System.Int32 | blockSizeLimit | If blockSizeLimit is 0, the configurator will use the maximum block size permitted by the device / function instead. |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(SizeT, Int32, CUoccupancy_flags)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(SizeT dynamicSMemSize, int blockSizeLimit, CUoccupancy_flags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeT | dynamicSMemSize | If per-block dynamic shared memory allocation is needed, then if the dynamic shared memory size is constant regardless of block size, the size should be passed through dynamicSMemSize |
| System.Int32 | blockSizeLimit | If blockSizeLimit is 0, the configurator will use the maximum block size permitted by the device / function instead. |
| CUoccupancy_flags | flags | Flags |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(Int32)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(int blockSizeLimit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | blockSizeLimit | If blockSizeLimit is 0, the configurator will use the maximum block size permitted by the device / function instead. |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
GetOccupancyMaxPotentialBlockSize(Int32, CUoccupancy_flags)
Returns in blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in minGridSize the minimum grid size to achieve the maximum occupancy. Ignoring dynamic shared memory.
Declaration
public CudaKernel.Occupancy GetOccupancyMaxPotentialBlockSize(int blockSizeLimit, CUoccupancy_flags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | blockSizeLimit | If blockSizeLimit is 0, the configurator will use the maximum block size permitted by the device / function instead. |
| CUoccupancy_flags | flags | Flags |
Returns
| Type | Description |
|---|---|
| CudaKernel.Occupancy |
Run(Object[])
Executes the kernel on the device
Declaration
public virtual float Run(params object[] parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object[] | parameters | Parameters as given by the kernel |
Returns
| Type | Description |
|---|---|
| System.Single | Time of execution in milliseconds (using GPU counter) |
RunAsync(CUstream, Object[])
Executes the kernel on the device asynchronously
Declaration
public virtual void RunAsync(CUstream stream, params object[] parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| CUstream | stream | Stream |
| System.Object[] | parameters | Parameters as given by the kernel |
RunCooperative(CUstream, Object[])
Launches a CUDA function where thread blocks can cooperate and synchronize as they execute
Invokes the kernel \p f on a \p gridDimX x \p gridDimY x \p gridDimZ grid of blocks.Each block contains \p blockDimX x \p blockDimY x \p blockDimZ threads.
\p sharedMemBytes sets the amount of dynamic shared memory that will be available to each thread block.
The device on which this kernel is invoked must have a non-zero value for the device attribute::CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH.
The total number of blocks launched cannot exceed the maximum number of blocks per multiprocessor as returned by ::cuOccupancyMaxActiveBlocksPerMultiprocessor (or ::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) times the number of multiprocessors as specified by the device attribute ::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT.
The kernel cannot make use of CUDA dynamic parallelism.
Kernel parameters must be specified via \p kernelParams. If \p f has N parameters, then \p kernelParams needs to be an array of N pointers. Each of \p kernelParams [0] through \p kernelParams [N-1] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image.
Calling ::cuLaunchCooperativeKernel() sets persistent function state that is the same as function state set through ::cuLaunchKernel API
When the kernel \p f is launched via ::cuLaunchCooperativeKernel(), the previous block shape, shared size and parameter info associated with \p f is overwritten.
Note that to use ::cuLaunchCooperativeKernel(), the kernel \p f must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information, or have no kernel parameters. If either of these conditions is not met, then ::cuLaunchCooperativeKernel() will return ::CUDA_ERROR_INVALID_IMAGE.
Declaration
public virtual void RunCooperative(CUstream stream, params object[] parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| CUstream | stream | |
| System.Object[] | parameters |
RunCooperativeKernelMultiDevie(CudaLaunchParams[], CudaCooperativeLaunchMultiDeviceFlags)
Launches CUDA functions on multiple devices where thread blocks can cooperate and synchronize as they execute
Invokes kernels as specified in the \p launchParamsList array where each element of the array specifies all the parameters required to perform a single kernel launch. These kernels can cooperate and synchronize as they execute. The size of the array is specified by \p numDevices.
No two kernels can be launched on the same device. All the devices targeted by this multi-device launch must be identical. All devices must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH.
All kernels launched must be identical with respect to the compiled code. Note that any __device__, __constant__ or __managed__ variables present in the module that owns the kernel launched on each device, are independently instantiated on every device. It is the application's responsiblity to ensure these variables are initialized and used appropriately.
The size of the grids as specified in blocks, the size of the blocks themselves and the amount of shared memory used by each thread block must also match across all launched kernels.
The streams used to launch these kernels must have been created via either ::cuStreamCreate or ::cuStreamCreateWithPriority. The NULL stream or ::CU_STREAM_LEGACY or ::CU_STREAM_PER_THREAD cannot be used.
The total number of blocks launched per kernel cannot exceed the maximum number of blocks per multiprocessor as returned by ::cuOccupancyMaxActiveBlocksPerMultiprocessor (or ::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) times the number of multiprocessors as specified by the device attribute ::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT. Since the total number of blocks launched per device has to match across all devices, the maximum number of blocks that can be launched per device will be limited by the device with the least number of multiprocessors.
The kernels cannot make use of CUDA dynamic parallelism.
By default, the kernel won't begin execution on any GPU until all prior work in all the specified streams has completed. This behavior can be overridden by specifying the flag ::CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC. When this flag is specified, each kernel will only wait for prior work in the stream corresponding to that GPU to complete before it begins execution.
Similarly, by default, any subsequent work pushed in any of the specified streams will not begin execution until the kernels on all GPUs have completed. This behavior can be overridden by specifying the flag ::CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC. When this flag is specified, any subsequent work pushed in any of the specified streams will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution.
Calling ::cuLaunchCooperativeKernelMultiDevice() sets persistent function state that is the same as function state set through ::cuLaunchKernel API when called individually for each element in \p launchParamsList.
When kernels are launched via ::cuLaunchCooperativeKernelMultiDevice(), the previous block shape, shared size and parameter info associated with each ::CUDA_LAUNCH_PARAMS::function in \p launchParamsList is overwritten.
Note that to use ::cuLaunchCooperativeKernelMultiDevice(), the kernels must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information, or have no kernel parameters. If either of these conditions is not met, then ::cuLaunchCooperativeKernelMultiDevice() will return ::CUDA_ERROR_INVALID_IMAGE.
Declaration
public static void RunCooperativeKernelMultiDevie(CudaLaunchParams[] launchParameterList, CudaCooperativeLaunchMultiDeviceFlags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaLaunchParams[] | launchParameterList | List of launch parameters, one per device |
| CudaCooperativeLaunchMultiDeviceFlags | flags | Flags to control launch behavior |
SetCacheConfig(CUFuncCache)
On devices where the L1 cache and shared memory use the same hardware resources, this sets through config
the preferred cache configuration for the device function hfunc. This is only a preference. The driver will use the
requested configuration if possible, but it is free to choose a different configuration if required to execute hfunc.
This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
Switching between configuration modes may insert a device-side synchronization point for streamed kernel launches.
The supported cache modes are defined in CUFuncCache
Declaration
public void SetCacheConfig(CUFuncCache config)
Parameters
| Type | Name | Description |
|---|---|---|
| CUFuncCache | config | Requested cache configuration |
SetComputeSize(dim3)
Sets the grid dimensions according to block dimensions, so that each dimension has at least computeSize threads
Declaration
public void SetComputeSize(dim3 computeSize)
Parameters
| Type | Name | Description |
|---|---|---|
| dim3 | computeSize | Minimum number of threads in X, Y and Z dimension |
SetComputeSize(UInt32)
Sets the grid dimensions according to block dimensions, so that each dimension has at least computeSize threads
Declaration
public void SetComputeSize(uint computeSizeX)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | computeSizeX | Minimum number of threads in X dimension |
SetComputeSize(UInt32, UInt32)
Sets the grid dimensions according to block dimensions, so that each dimension has at least computeSize threads
Declaration
public void SetComputeSize(uint computeSizeX, uint computeSizeY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | computeSizeX | Minimum number of threads in X dimension |
| System.UInt32 | computeSizeY | Minimum number of threads in Y dimension |
SetComputeSize(UInt32, UInt32, UInt32)
Sets the grid dimensions according to block dimensions, so that each dimension has at least computeSize threads
Declaration
public void SetComputeSize(uint computeSizeX, uint computeSizeY, uint computeSizeZ)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | computeSizeX | Minimum number of threads in X dimension |
| System.UInt32 | computeSizeY | Minimum number of threads in Y dimension |
| System.UInt32 | computeSizeZ | Minimum number of threads in Z dimension |
SetConstantVariable(String, char1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, char1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| char1 | value | value |
SetConstantVariable(String, char1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, char1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| char1[] | value | value |
SetConstantVariable(String, char2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, char2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| char2 | value | value |
SetConstantVariable(String, char2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, char2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| char2[] | value | value |
SetConstantVariable(String, char3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, char3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| char3 | value | value |
SetConstantVariable(String, char3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, char3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| char3[] | value | value |
SetConstantVariable(String, char4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, char4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| char4 | value | value |
SetConstantVariable(String, char4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, char4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| char4[] | value | value |
SetConstantVariable(String, cuDoubleComplex)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, cuDoubleComplex value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| cuDoubleComplex | value | value |
SetConstantVariable(String, cuDoubleComplex[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, cuDoubleComplex[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| cuDoubleComplex[] | value | value |
SetConstantVariable(String, cuDoubleReal)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, cuDoubleReal value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| cuDoubleReal | value | value |
SetConstantVariable(String, cuDoubleReal[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, cuDoubleReal[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| cuDoubleReal[] | value | value |
SetConstantVariable(String, cuFloatComplex)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, cuFloatComplex value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| cuFloatComplex | value | value |
SetConstantVariable(String, cuFloatComplex[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, cuFloatComplex[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| cuFloatComplex[] | value | value |
SetConstantVariable(String, cuFloatReal)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, cuFloatReal value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| cuFloatReal | value | value |
SetConstantVariable(String, cuFloatReal[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, cuFloatReal[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| cuFloatReal[] | value | value |
SetConstantVariable(String, dim3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, dim3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| dim3 | value | value |
SetConstantVariable(String, dim3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, dim3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| dim3[] | value | value |
SetConstantVariable(String, double1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, double1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| double1 | value | value |
SetConstantVariable(String, double1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, double1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| double1[] | value | value |
SetConstantVariable(String, double2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, double2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| double2 | value | value |
SetConstantVariable(String, double2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, double2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| double2[] | value | value |
SetConstantVariable(String, float1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| float1 | value | value |
SetConstantVariable(String, float1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| float1[] | value | value |
SetConstantVariable(String, float2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| float2 | value | value |
SetConstantVariable(String, float2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| float2[] | value | value |
SetConstantVariable(String, float3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| float3 | value | value |
SetConstantVariable(String, float3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| float3[] | value | value |
SetConstantVariable(String, float4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| float4 | value | value |
SetConstantVariable(String, float4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| float4[] | value | value |
SetConstantVariable(String, int1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| int1 | value | value |
SetConstantVariable(String, int1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| int1[] | value | value |
SetConstantVariable(String, int2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| int2 | value | value |
SetConstantVariable(String, int2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| int2[] | value | value |
SetConstantVariable(String, int3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| int3 | value | value |
SetConstantVariable(String, int3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| int3[] | value | value |
SetConstantVariable(String, int4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| int4 | value | value |
SetConstantVariable(String, int4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| int4[] | value | value |
SetConstantVariable(String, long1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| long1 | value | value |
SetConstantVariable(String, long1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| long1[] | value | value |
SetConstantVariable(String, long2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| long2 | value | value |
SetConstantVariable(String, long2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| long2[] | value | value |
SetConstantVariable(String, long3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| long3 | value | value |
SetConstantVariable(String, long3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| long3[] | value | value |
SetConstantVariable(String, long4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| long4 | value | value |
SetConstantVariable(String, long4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| long4[] | value | value |
SetConstantVariable(String, short1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| short1 | value | value |
SetConstantVariable(String, short1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| short1[] | value | value |
SetConstantVariable(String, short2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| short2 | value | value |
SetConstantVariable(String, short2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| short2[] | value | value |
SetConstantVariable(String, short3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| short3 | value | value |
SetConstantVariable(String, short3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| short3[] | value | value |
SetConstantVariable(String, short4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| short4 | value | value |
SetConstantVariable(String, short4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| short4[] | value | value |
SetConstantVariable(String, uchar1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uchar1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uchar1 | value | value |
SetConstantVariable(String, uchar1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uchar1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uchar1[] | value | value |
SetConstantVariable(String, uchar2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uchar2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uchar2 | value | value |
SetConstantVariable(String, uchar2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uchar2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uchar2[] | value | value |
SetConstantVariable(String, uchar3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uchar3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uchar3 | value | value |
SetConstantVariable(String, uchar3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uchar3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uchar3[] | value | value |
SetConstantVariable(String, uchar4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uchar4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uchar4 | value | value |
SetConstantVariable(String, uchar4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uchar4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uchar4[] | value | value |
SetConstantVariable(String, uint1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uint1 | value | value |
SetConstantVariable(String, uint1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uint1[] | value | value |
SetConstantVariable(String, uint2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uint2 | value | value |
SetConstantVariable(String, uint2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uint2[] | value | value |
SetConstantVariable(String, uint3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uint3 | value | value |
SetConstantVariable(String, uint3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uint3[] | value | value |
SetConstantVariable(String, uint4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uint4 | value | value |
SetConstantVariable(String, uint4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| uint4[] | value | value |
SetConstantVariable(String, ulong1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ulong1 | value | value |
SetConstantVariable(String, ulong1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ulong1[] | value | value |
SetConstantVariable(String, ulong2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ulong2 | value | value |
SetConstantVariable(String, ulong2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ulong2[] | value | value |
SetConstantVariable(String, ulong3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ulong3 | value | value |
SetConstantVariable(String, ulong3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ulong3[] | value | value |
SetConstantVariable(String, ulong4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ulong4 | value | value |
SetConstantVariable(String, ulong4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ulong4[] | value | value |
SetConstantVariable(String, ushort1)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort1 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ushort1 | value | value |
SetConstantVariable(String, ushort1[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort1[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ushort1[] | value | value |
SetConstantVariable(String, ushort2)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ushort2 | value | value |
SetConstantVariable(String, ushort2[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort2[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ushort2[] | value | value |
SetConstantVariable(String, ushort3)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ushort3 | value | value |
SetConstantVariable(String, ushort3[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort3[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ushort3[] | value | value |
SetConstantVariable(String, ushort4)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ushort4 | value | value |
SetConstantVariable(String, ushort4[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort4[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| ushort4[] | value | value |
SetConstantVariable(String, Byte)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Byte | value | value |
SetConstantVariable(String, Byte[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, byte[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Byte[] | value | value |
SetConstantVariable(String, Double)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Double | value | value |
SetConstantVariable(String, Double[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, double[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Double[] | value | value |
SetConstantVariable(String, Int16)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Int16 | value | value |
SetConstantVariable(String, Int16[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, short[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Int16[] | value | value |
SetConstantVariable(String, Int32)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Int32 | value | value |
SetConstantVariable(String, Int32[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, int[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Int32[] | value | value |
SetConstantVariable(String, Int64)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Int64 | value | value |
SetConstantVariable(String, Int64[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, long[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Int64[] | value | value |
SetConstantVariable(String, SByte)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, sbyte value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.SByte | value | value |
SetConstantVariable(String, SByte[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, sbyte[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.SByte[] | value | value |
SetConstantVariable(String, Single)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Single | value | value |
SetConstantVariable(String, Single[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, float[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.Single[] | value | value |
SetConstantVariable(String, UInt16)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.UInt16 | value | value |
SetConstantVariable(String, UInt16[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ushort[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.UInt16[] | value | value |
SetConstantVariable(String, UInt32)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.UInt32 | value | value |
SetConstantVariable(String, UInt32[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, uint[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.UInt32[] | value | value |
SetConstantVariable(String, UInt64)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.UInt64 | value | value |
SetConstantVariable(String, UInt64[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable(string name, ulong[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| System.UInt64[] | value | value |
SetConstantVariable<T>(String, T)
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable<T>(string name, T value)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| T | value | value |
Type Parameters
| Name | Description |
|---|---|
| T |
SetConstantVariable<T>(String, T[])
Set the constant variable name to value value
The constant variable must be defined in the CUDA module.
Declaration
public void SetConstantVariable<T>(string name, T[] value)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | constant variable name |
| T[] | value | value |
Type Parameters
| Name | Description |
|---|---|
| T |
SetSharedMemConfig(CUsharedconfig)
Sets the shared memory configuration for a device function.
On devices with configurable shared memory banks, this function will force all subsequent launches of the specified device function to have the given shared memory bank size configuration. On any given launch of the function, the shared memory configuration of the device will be temporarily changed if needed to suit the function's preferred configuration. Changes in shared memory configuration between subsequent launches of functions, may introduce a device side synchronization point.
Any per-function setting of shared memory bank size set via cuFuncSetSharedMemConfig(CUfunction, CUsharedconfig) will override the context wide setting set with cuCtxSetSharedMemConfig(CUsharedconfig).
Changing the shared memory bank size will not increase shared memory usage or affect occupancy of kernels, but may have major effects on performance. Larger bank sizes will allow for greater potential bandwidth to shared memory, but will change what kinds of accesses to shared memory will result in bank conflicts.
This function will do nothing on devices with fixed shared memory bank size.
The supported bank configurations are
- DefaultBankSize: set bank width to the default initial setting (currently, four bytes).
- FourByteBankSize: set shared memory bank width to be natively four bytes.
- EightByteBankSize: set shared memory bank width to be natively eight bytes.
Declaration
public void SetSharedMemConfig(CUsharedconfig config)
Parameters
| Type | Name | Description |
|---|---|---|
| CUsharedconfig | config | requested shared memory configuration |