Cuda.ModuleA CUDA module type represents CUDA code that's ready to execute, i.e. is loaded. See: Module Management.
Compute device classes. See enum CUjit_target.
val sexp_of_jit_target : jit_target -> Sexplib0.Sexp.tCubin matching fallback strategies. See CUjit_fallback.
val sexp_of_jit_fallback : jit_fallback -> Sexplib0.Sexp.tCaching modes for dlcm. See CUjit_cacheMode.
val sexp_of_jit_cache_mode : jit_cache_mode -> Sexplib0.Sexp.ttype jit_option = | MAX_REGISTERS of intMax number of registers that a thread may use.
*)| THREADS_PER_BLOCK of intSpecifies minimum number of threads per block to target compilation for or returns the number of threads the compiler actually targeted. Cannot be combined with TARGET.
| WALL_TIME of {}| INFO_LOG_BUFFER of bigstring| ERROR_LOG_BUFFER of bigstring| OPTIMIZATION_LEVEL of int0 to 4, with 4 being the default and highest level of optimizations.
*)| TARGET_FROM_CUCONTEXT| TARGET of jit_target| FALLBACK_STRATEGY of jit_fallback| GENERATE_DEBUG_INFO of boolHelpful for cuda-gdb.
*)| LOG_VERBOSE of bool| GENERATE_LINE_INFO of boolHelpful for cuda-gdb.
*)| CACHE_MODE of jit_cache_mode| POSITION_INDEPENDENT_CODE of boolSee CUjit_option.
val sexp_of_jit_option : jit_option -> Sexplib0.Sexp.tSee CUfunction.
See CUmodule.
val load_data_ex : Nvrtc.compile_to_ptx_result -> jit_option list -> tCurrently, the image passed via this call is the PTX source. See cuModuleLoadDataEx.
The module is finalized using cuModuleUnload. The finalizer captures the context when load_data_ex is called to temporarily push it on the stack for unloading.
The returned function retains the module, so the module is not finalized (unloaded) while the function is still in use. See cuModuleGetFunction.
val get_global : t -> name:string -> Deviceptr.t * Unsigned.size_tSee cuModuleGetGlobal.
type occupancy_flag = | DISABLE_CACHING_OVERRIDEOn platforms where global caching affects occupancy, the calculator's default behavior is to fall back to computing as if caching were disabled when caching is on but the per-block resource usage would leave zero occupancy. This flag suppresses that fallback, so such a configuration reports 0.
*)How the occupancy calculator handles special cases; the empty flag list is CU_OCCUPANCY_DEFAULT. See CUoccupancy_flags.
val sexp_of_occupancy_flag : occupancy_flag -> Sexplib0.Sexp.tval max_active_blocks_per_multiprocessor :
?dynamic_smem_bytes:int ->
?flags:occupancy_flag list ->
func ->
block_size:int ->
intThe maximum number of blocks of block_size threads that can be simultaneously resident on one multiprocessor, given the kernel's register and shared memory usage. dynamic_smem_bytes (default 0) is the per-block dynamic shared memory the launch would request, i.e. the shared_mem_bytes of Stream.launch_kernel. The result is 0 for a configuration that cannot be launched at all -- one asking for more shared memory or more threads per block than the device provides -- rather than an error.
The theoretical occupancy of such a launch -- the fraction of a multiprocessor's warp slots that are filled -- is float (result * warps_per_block) /. float max_warps, where warps_per_block = (block_size + device_props.warp_size - 1) / device_props.warp_size and max_warps = device_props.max_threads_per_multiprocessor / device_props.warp_size. The hardware allocates whole warps, so a block of 33 threads takes two warp slots rather than 33 thread slots; the two formulations coincide when block_size is a multiple of the warp size. result * device_props.multiprocessor_count blocks are enough to fill the whole device. See cuOccupancyMaxActiveBlocksPerMultiprocessor, and with a non-empty flags (default []) cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.
type suggested_launch_config = {min_grid_size : int;Grid size, in blocks, that achieves the maximum occupancy.
*)block_size : int;Block size, in threads, that achieves the maximum occupancy.
*)}The launch configuration suggested by suggested_launch_config.
val sexp_of_suggested_launch_config :
suggested_launch_config ->
Sexplib0.Sexp.tval suggested_launch_config :
?dynamic_smem_bytes:int ->
?block_size_limit:int ->
?flags:occupancy_flag list ->
func ->
suggested_launch_configA block size that achieves the kernel's maximum occupancy -- more precisely, the maximum number of active warps with the fewest blocks per multiprocessor -- together with the minimum grid size that achieves that occupancy. Where max_active_blocks_per_multiprocessor scores a block size you picked, this picks one for you; the two agree in that max_active_blocks_per_multiprocessor func ~block_size at the suggested block_size times device_props.multiprocessor_count is the returned min_grid_size.
dynamic_smem_bytes (default 0) is a per-block dynamic shared memory request that does not vary with the block size -- the driver also accepts a block-size-to-shared-memory callback, which this binding does not expose. block_size_limit (default 0, meaning the maximum the device and the kernel permit) caps the block size considered, for a kernel that is only correct up to some number of threads. Always calls cuOccupancyMaxPotentialBlockSizeWithFlags, of which cuOccupancyMaxPotentialBlockSize is the empty-flags case.