package spoc

  1. Overview
  2. Docs
type kernel

Manages Kernels

val relax_vector : ('a, 'b) Vector.vector -> ('c, 'd) Vector.vector
type ('a, 'b) kernelArgs =
  1. | VChar of ('a, 'b) Vector.vector
    (*

    unsigned char vector

    *)
  2. | VFloat32 of ('a, 'b) Vector.vector
    (*

    32-bit float vector

    *)
  3. | VFloat64 of ('a, 'b) Vector.vector
    (*

    64-bit float vector

    *)
  4. | VComplex32 of ('a, 'b) Vector.vector
    (*

    32-bit complex vector

    *)
  5. | VInt32 of ('a, 'b) Vector.vector
    (*

    32-bit int vector

    *)
  6. | VInt64 of ('a, 'b) Vector.vector
    (*

    64-bit int vector

    *)
  7. | Int32 of int
    (*

    32-bit int

    *)
  8. | Int64 of int
    (*

    64-bit int

    *)
  9. | Float32 of float
    (*

    32-bit float

    *)
  10. | Float64 of float
    (*

    64-bit float

    *)
  11. | Custom of ('a, 'b) Vector.custom
  12. | Vector of ('a, 'b) Vector.vector
    (*

    generic vector type

    *)
  13. | VCustom of ('a, 'b) Vector.vector
    (*

    custom data type vector, see examples

    *)

type of parameters usable with kernels

type block = {
  1. mutable blockX : int;
  2. mutable blockY : int;
  3. mutable blockZ : int;
}

A block is a 3 dimension group of threads

type grid = {
  1. mutable gridX : int;
  2. mutable gridY : int;
  3. mutable gridZ : int;
}

A grid is a 3 dimension group of blocks

exception ERROR_BLOCK_SIZE
exception ERROR_GRID_SIZE
module Cuda : sig ... end
module OpenCL : sig ... end
exception No_source_for_device of Spoc.Devices.device
exception Not_compiled_for_device of Spoc.Devices.device
class virtual ['a, 'b] spoc_kernel : string -> string -> object ... end

a Kernel is represented within Spoc a an OCaml object inheriting the spoc_kernel class

val run : Spoc.Devices.device -> (block * grid) -> ('a, 'b) spoc_kernel -> 'a -> unit
  • deprecated

    you should use kernel#run

val compile : Spoc.Devices.device -> ('a, 'b) spoc_kernel -> unit
  • deprecated

    you should use kernel#compile

val set_arg : ('a, 'b) kernelArgs array -> int -> ('a, 'b) Vector.vector -> unit