Skip to main content

Module context_config

Module context_config 

Source
Expand description

Context configuration: limits, cache config, and shared memory config.

These functions allow tuning per-context resource limits (stack size, heap size, etc.) and cache / shared memory policies.

§Example

let stack = context_config::get_limit(CUlimit::StackSize)?;
println!("GPU thread stack size: {stack} bytes");

context_config::set_cache_config(context_config::CacheConfig::PreferL1)?;

Enums§

CacheConfig
Preferred cache configuration for a CUDA context or function.
SharedMemConfig
Shared memory bank configuration.

Functions§

get_cache_config
Returns the current cache configuration for the active context.
get_limit
Returns the value of a context limit.
get_shared_mem_config
Returns the current shared memory configuration for the active context.
set_cache_config
Sets the cache configuration for the active context.
set_limit
Sets the value of a context limit.
set_shared_mem_config
Sets the shared memory configuration for the active context.