sig
type kernel
external relax_vector :
('a, 'b) Spoc.Vector.vector -> ('c, 'd) Spoc.Vector.vector = "%identity"
type ('a, 'b) kernelArgs =
VChar of ('a, 'b) Spoc.Vector.vector
| VFloat32 of ('a, 'b) Spoc.Vector.vector
| VFloat64 of ('a, 'b) Spoc.Vector.vector
| VComplex32 of ('a, 'b) Spoc.Vector.vector
| VInt32 of ('a, 'b) Spoc.Vector.vector
| VInt64 of ('a, 'b) Spoc.Vector.vector
| Int32 of int
| Int64 of int
| Float32 of float
| Float64 of float
| Vector of ('a, 'b) Spoc.Vector.vector
| VCustom of ('a, 'b) Spoc.Vector.vector
type block = {
mutable blockX : int;
mutable blockY : int;
mutable blockZ : int;
}
type grid = {
mutable gridX : int;
mutable gridY : int;
mutable gridZ : int;
}
exception ERROR_BLOCK_SIZE
exception ERROR_GRID_SIZE
module Cuda :
sig
type cuda_extra
external cuda_create_extra : int -> Kernel.Cuda.cuda_extra
= "spoc_cuda_create_extra"
external cuda_launch_grid :
int Pervasives.ref ->
Kernel.kernel ->
Kernel.grid ->
Kernel.block ->
Kernel.Cuda.cuda_extra -> Spoc.Devices.generalInfo -> int -> unit
= "spoc_cuda_launch_grid_b" "spoc_cuda_launch_grid_n"
val cuda_load_arg :
int Pervasives.ref ->
Kernel.Cuda.cuda_extra ->
Spoc.Devices.device -> 'c -> 'd -> ('a, 'b) Kernel.kernelArgs -> unit
end
module OpenCL :
sig
external opencl_launch_grid :
Kernel.kernel ->
Kernel.grid ->
Kernel.block -> Spoc.Devices.generalInfo -> int -> unit
= "spoc_opencl_launch_grid"
val opencl_load_arg :
int Pervasives.ref ->
Spoc.Devices.device ->
Kernel.kernel -> int -> ('a, 'b) Kernel.kernelArgs -> unit
end
val exec :
('a, 'b) Kernel.kernelArgs array ->
Kernel.block * Kernel.grid ->
int -> Spoc.Devices.device -> Kernel.kernel -> unit
val compile_and_run :
Spoc.Devices.device ->
Kernel.block * Kernel.grid ->
?cached:bool ->
?debug:bool ->
?queue_id:int ->
('a *
(Kernel.block * Kernel.grid ->
bool -> bool -> int -> Spoc.Devices.device -> 'b)) *
'c -> 'b
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
val binaries : (Spoc.Devices.device, Kernel.kernel) Hashtbl.t
val mutable cuda_sources : string list
val file_file : string
val kernel_name : string
val mutable opencl_sources : string list
method virtual args_to_list : 'a -> 'b
method compile : ?debug:bool -> Spoc.Devices.device -> unit
method compile_and_run :
'a ->
Kernel.block * Kernel.grid ->
?debug:bool -> int -> Spoc.Devices.device -> unit
method virtual exec :
'a ->
Kernel.block * Kernel.grid ->
int -> Spoc.Devices.device -> Kernel.kernel -> unit
method get_binaries :
unit -> (Spoc.Devices.device, Kernel.kernel) Hashtbl.t
method get_cuda_sources : unit -> string list
method get_opencl_sources : unit -> string list
method virtual list_to_args : 'b -> 'a
method reload_sources : unit -> unit
method reset_binaries : unit -> unit
method run :
'a ->
Kernel.block * Kernel.grid -> int -> Spoc.Devices.device -> unit
method set_cuda_sources : string -> unit
method set_opencl_sources : string -> unit
end
val run :
Spoc.Devices.device ->
Kernel.block * Kernel.grid -> ('a, 'b) Kernel.spoc_kernel -> 'a -> unit
val compile : Spoc.Devices.device -> ('a, 'b) Kernel.spoc_kernel -> unit
val set_arg :
('a, 'b) Kernel.kernelArgs array ->
int -> ('a, 'b) Spoc.Vector.vector -> unit
end