Cuda.ContextAll CUDA tasks are run under a context, usually under the current context. See: Context Management.
type flag = | SCHED_AUTOAutomatic scheduling.
*)| SCHED_SPINInstruct CUDA to actively spin when waiting for results from the GPU.
*)| SCHED_YIELDInstruct CUDA to yield its thread when waiting for results from the GPU.
*)| SCHED_BLOCKING_SYNCSet blocking synchronization as default scheduling.
*)| SCHED_MASK| MAP_HOSTDeprecated: it is always present regardless of passed config.
*)| LMEM_RESIZE_TO_MAXKeep local memory allocation after launch.
*)| COREDUMP_ENABLETrigger coredumps from exceptions in this context.
*)| USER_COREDUMP_ENABLEEnable user pipe to trigger coredumps in this context.
*)| SYNC_MEMOPSEnsure synchronous memory operations on this context will synchronize.
*)See enum CUctx_flags.
val sexp_of_flag : flag -> Sexplib0.Sexp.ttype flags = flag listval sexp_of_flags : flags -> Sexplib0.Sexp.tSee CUcontext.
val sexp_of_t : t -> Sexplib0.Sexp.tNOTE: In most cases it is recommended to use get_primary instead! The context is pushed to the CPU-thread-local stack. See cuCtxCreate
The context value is finalized using ctxDestroy.
val get_flags : unit -> flagsSee cuCtxGetFlags.
The context is not pushed to the stack. See cuDevicePrimaryCtxRetain.
The context is finalized using cuDevicePrimaryCtxRelease. The underlying CUDA context will be reset once the last reference to it is released.
val get_device : unit -> Device.tSee cuCtxGetDevice.
val pop_current : unit -> tSee cuCtxPopCurrent.
val get_current : unit -> tSee cuCtxGetCurrent.
val push_current : t -> unitPushes a context on the current CPU thread. See cuCtxPushCurrent.
val set_current : t -> unitIf there exists a CUDA context stack on the calling CPU thread, this will replace the top of that stack with ctx. See cuCtxSetCurrent.
Blocks for the current context's tasks to complete. See cuCtxSynchronize.
val disable_peer_access : t -> unitDisables peer access between the current context and the given context. See cuCtxDisablePeerAccess.
val enable_peer_access : ?flags:Unsigned.uint -> t -> unitFlags are unused. See cuCtxEnablePeerAccess.
See enum CUlimit.
val sexp_of_limit : limit -> Sexplib0.Sexp.tval set_limit : limit -> int -> unitSee cuCtxSetLimit.
val get_limit : limit -> intSee cuCtxGetLimit.