Library/ManagedCuda/CudaKernel.cs
/// <summary>
/// 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.
/// </summary>
/// <param name="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.</param>
/// <param name="blockSizeLimit">If blockSizeLimit is 0, the configurator will use the maximum
/// block size permitted by the device / function instead.</param>
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.
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 .
public Occupancy GetOccupancyMaxPotentialBlockSize(del_CUoccupancyB2DSize blockSizeToDynamicSMemSize, int blockSizeLimit)
		{
			CUResult res;
			Occupancy occupancy = new Occupancy();
			res = DriverAPINativeMethods.Occupancy.cuOccupancyMaxPotentialBlockSize(ref occupancy.minGridSize, ref occupancy.blockSize, _function, blockSizeToDynamicSMemSize, 0, blockSizeLimit);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuOccupancyMaxPotentialBlockSize", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
			return occupancy;
		}
public Occupancy GetOccupancyMaxPotentialBlockSize ( del_CUoccupancyB2DSize blockSizeToDynamicSMemSize , int blockSizeLimit ) { CUResult res ; Occupancy occupancy = new Occupancy ( ) ; res = DriverAPINativeMethods . Occupancy . cuOccupancyMaxPotentialBlockSize ( ref occupancy . minGridSize , ref occupancy . blockSize , _function , blockSizeToDynamicSMemSize , 0 , blockSizeLimit ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; return occupancy ; }
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.
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 .
blockSizeToDynamicSMemSize
del_CUoccupancyB2DSize
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.
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 .
blockSizeLimit
int
If blockSizeLimit is 0, the configurator will use the maximum
block size permitted by the device / function instead.
If blockSizeLimit is 0 the configurator will use the maximum block size permitted by the device / function instead .