Cudajit.Context
All CUDA tasks are run under a context, usually under the current context. See: Context Management.
type flag =
| SCHED_AUTO
Automatic scheduling.
*)| SCHED_SPIN
Instruct CUDA to actively spin when waiting for results from the GPU.
*)| SCHED_YIELD
Instruct CUDA to yield its thread when waiting for results from the GPU.
*)| SCHED_BLOCKING_SYNC
Set blocking synchronization as default scheduling.
*)| SCHED_MASK
| MAP_HOST
Deprecated: it is always present regardless of passed config.
*)| LMEM_RESIZE_TO_MAX
Keep local memory allocation after launch.
*)| COREDUMP_ENABLE
Trigger coredumps from exceptions in this context.
*)| USER_COREDUMP_ENABLE
Enable user pipe to trigger coredumps in this context.
*)| SYNC_MEMOPS
Ensure synchronous memory operations on this context will synchronize.
*)See enum CUctx_flags.
val sexp_of_flag : flag -> Sexplib0.Sexp.t
val flag_of_sexp : Sexplib0.Sexp.t -> flag
type flags = flag list
val sexp_of_flags : flags -> Sexplib0.Sexp.t
val flags_of_sexp : Sexplib0.Sexp.t -> flags
See CUcontext.
val sexp_of_t : t -> Sexplib0.Sexp.t
NOTE: 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 -> flags
See 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.t
See cuCtxGetDevice.
val pop_current : unit -> t
See cuCtxPopCurrent.
val get_current : unit -> t
See cuCtxGetCurrent.
val push_current : t -> unit
Pushes a context on the current CPU thread. See cuCtxPushCurrent.
val set_current : t -> unit
If 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 -> unit
Disables peer access between the current context and the given context. See cuCtxDisablePeerAccess.
val enable_peer_access : ?flags:Unsigned.uint -> t -> unit
Flags are unused. See cuCtxEnablePeerAccess.
See enum CUlimit.
val sexp_of_limit : limit -> Sexplib0.Sexp.t
val limit_of_sexp : Sexplib0.Sexp.t -> limit
val set_limit : limit -> int -> unit
See cuCtxSetLimit.
val get_limit : limit -> int
See cuCtxGetLimit.