package spoc

  1. Overview
  2. Docs
type dim3 = {
  1. x : int;
  2. y : int;
  3. z : int;
}
type specificLibrary =
  1. | Cuda
  2. | OpenCL
  3. | Both
type context
type generalInfo = {
  1. name : string;
  2. totalGlobalMem : int;
  3. localMemSize : int;
  4. clockRate : int;
  5. totalConstMem : int;
  6. multiProcessorCount : int;
  7. eccEnabled : bool;
  8. id : int;
  9. ctx : context;
}
type cudaInfo = {
  1. major : int;
  2. minor : int;
  3. regsPerBlock : int;
  4. warpSize : int;
  5. memPitch : int;
  6. maxThreadsPerBlock : int;
  7. maxThreadsDim : dim3;
  8. maxGridSize : dim3;
  9. textureAlignment : int;
  10. deviceOverlap : bool;
  11. kernelExecTimeoutEnabled : bool;
  12. integrated : bool;
  13. canMapHostMemory : bool;
  14. computeMode : int;
  15. concurrentKernels : bool;
  16. pciBusID : int;
  17. pciDeviceID : int;
  18. driverVersion : int;
}
type platformInfo = {
  1. platform_profile : string;
  2. platform_version : string;
  3. platform_name : string;
  4. platform_vendor : string;
  5. platform_extensions : string;
  6. num_devices : int;
}
type deviceType =
  1. | CL_DEVICE_TYPE_CPU
  2. | CL_DEVICE_TYPE_GPU
  3. | CL_DEVICE_TYPE_ACCELERATOR
  4. | CL_DEVICE_TYPE_DEFAULT
type clDeviceFPConfig =
  1. | CL_FP_DENORM
  2. | CL_FP_INF_NAN
  3. | CL_FP_ROUND_TO_NEAREST
  4. | CL_FP_ROUND_TO_ZERO
  5. | CL_FP_ROUND_TO_INF
  6. | CL_FP_FMA
  7. | CL_FP_NONE
type clDeviceQueueProperties =
  1. | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
  2. | CL_QUEUE_PROFILING_ENABLE
type clDeviceGlobalMemCacheType =
  1. | CL_READ_WRITE_CACHE
  2. | CL_READ_ONLY_CACHE
  3. | CL_NONE
type clDeviceLocalMemType =
  1. | CL_LOCAL
  2. | CL_GLOBAL
type clDeviceExecutionCapabilities =
  1. | CL_EXEC_KERNEL
  2. | CL_EXEC_NATIVE_KERNEL
type clDeviceID
type openCLInfo = {
  1. platform_info : platformInfo;
  2. device_type : deviceType;
  3. profile : string;
  4. version : string;
  5. vendor : string;
  6. extensions : string;
  7. vendor_id : int;
  8. max_work_item_dimensions : int;
  9. address_bits : int;
  10. max_mem_alloc_size : int;
  11. image_support : bool;
  12. max_read_image_args : int;
  13. max_write_image_args : int;
  14. max_samplers : int;
  15. mem_base_addr_align : int;
  16. min_data_type_align_size : int;
  17. global_mem_cacheline_size : int;
  18. global_mem_cache_size : int;
  19. max_constant_args : int;
  20. endian_little : bool;
  21. available : bool;
  22. compiler_available : bool;
  23. single_fp_config : clDeviceFPConfig;
  24. global_mem_cache_type : clDeviceGlobalMemCacheType;
  25. queue_properties : clDeviceQueueProperties;
  26. local_mem_type : clDeviceLocalMemType;
  27. double_fp_config : clDeviceFPConfig;
  28. max_constant_buffer_size : int;
  29. execution_capabilities : clDeviceExecutionCapabilities;
  30. half_fp_config : clDeviceFPConfig;
  31. max_work_group_size : int;
  32. image2D_max_height : int;
  33. image2D_max_width : int;
  34. image3D_max_depth : int;
  35. image3D_max_height : int;
  36. image3D_max_width : int;
  37. max_parameter_size : int;
  38. max_work_item_size : dim3;
  39. prefered_vector_width_char : int;
  40. prefered_vector_width_short : int;
  41. prefered_vector_width_int : int;
  42. prefered_vector_width_long : int;
  43. prefered_vector_width_float : int;
  44. prefered_vector_width_double : int;
  45. profiling_timer_resolution : int;
  46. driver_version : string;
  47. device_id : clDeviceID;
}
type specificInfo =
  1. | CudaInfo of cudaInfo
  2. | OpenCLInfo of openCLInfo
type gcInfo
type events
type device = {
  1. general_info : generalInfo;
  2. specific_info : specificInfo;
  3. gc_info : gcInfo;
  4. events : events;
}
val get_cuda_compatible_devices : unit -> int
val get_opencl_compatible_devices : unit -> int
val init : ?only:specificLibrary -> unit -> device array
val cuda_devices : unit -> int
val opencl_devices : unit -> int
val gpgpu_devices : unit -> int
val flush : device -> ?queue_id:int -> unit -> unit
val hasCLExtension : device -> string -> bool
val allowDouble : device -> bool
OCaml

Innovation. Community. Security.