Library/ManagedCuda/CudaKernel.cs
/// <summary>
/// Sets the shared memory configuration for a device function.<para/>
/// 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.<para/>
/// Any per-function setting of shared memory bank size set via
/// <see cref="DriverAPINativeMethods.FunctionManagement.cuFuncSetSharedMemConfig"/>  will override the context wide setting set with
/// <see cref="DriverAPINativeMethods.ContextManagement.cuCtxSetSharedMemConfig"/>.<para/>
/// 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.<para/>
/// This function will do nothing on devices with fixed shared memory bank size.<para/>
/// The supported bank configurations are<para/> 
/// - <see cref="CUsharedconfig.DefaultBankSize"/>: set bank width to the default initial
///   setting (currently, four bytes).
/// - <see cref="CUsharedconfig.FourByteBankSize"/>: set shared memory bank width to
///   be natively four bytes.
/// - <see cref="CUsharedconfig.EightByteBankSize"/>: set shared memory bank width to
///   be natively eight bytes.
/// </summary>
/// <param name="config">requested shared memory configuration</param>
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
will override the context wide setting set with
.
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
: set bank width to the default initial
setting (currently, four bytes).
: set shared memory bank width to
be natively four bytes.
: set shared memory bank width to
be natively eight bytes.
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 will override the context wide setting set with . 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 : set bank width to the default initial setting ( currently four bytes ) . : set shared memory bank width to be natively four bytes . : set shared memory bank width to be natively eight bytes .
public void SetSharedMemConfig(CUsharedconfig config)
		{
			CUResult res;
			res = DriverAPINativeMethods.FunctionManagement.cuFuncSetSharedMemConfig(_function, config);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuFuncSetSharedMemConfig", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
		}
public void SetSharedMemConfig ( CUsharedconfig config ) { CUResult res ; res = DriverAPINativeMethods . FunctionManagement . cuFuncSetSharedMemConfig ( _function , config ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Sets the shared memory configuration for a device function.
Sets the shared memory configuration for a device function .
config
CUsharedconfig
requested shared memory configuration
requested shared memory configuration