Module Cudajit

Bindings to the NVIDIA `cuda` and `nvrtc` libraries.

module Nvrtc : sig ... end

NVRTC is a runtime compilation library for CUDA C++. See: The User guide for the NVRTC library.

type result
val sexp_of_result : result -> Sexplib0.Sexp.t
val result_of_sexp : Sexplib0.Sexp.t -> result
exception Cuda_error of {
  1. status : result;
  2. message : string;
}

Error codes returned by CUDA functions are converted to exceptions. The message stores a snake-case variant of the offending CUDA function name (see Cuda_ffi.Bindings.Functions for the direct funciton bindings).

val is_success : result -> bool
val cuda_call_hook : (message:string -> status:result -> unit) option Stdlib.ref

The function called after every Cuda_ffi.Bindings.Functions call. message is the snake-case variant of the corresponding CUDA function name.

val init : ?flags:int -> unit -> unit

Must be called before any other function. Currently flags is unused. See cuInit.

module Device : sig ... end

Managing a CUDA GPU device and its primary context. See: Device Management and Primary Context Management.

module Context : sig ... end

All CUDA tasks are run under a context, usually under the current context. See: Context Management.

type bigstring = (char, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t
module Deviceptr : sig ... end

This module introduces the type of pointers into on-device global memory, and stream-independent memory management functions. All functions from this module run synchronously. See: Memory Management.

module Module : sig ... end

A CUDA module type represents CUDA code that's ready to execute, i.e. is loaded. See: Module Management.

module Stream : sig ... end

CUDA streams are independent FIFO schedules for CUDA tasks, allowing them to potentially run in parallel. See: Stream Management.

module Event : sig ... end

CUDA events can be used for synchronization between streams without blocking the CPU, and to time the on-device execution. See: Event Management.

module Delimited_event : sig ... end

This module builds on top of functionality more directly exposed by Event. It optimizes resource management for use-cases where events are not reused: there's only one call to Event.record, and it's immediately after Event.create.