Module Metal.Device

Represents the GPU device capable of executing Metal commands. See MTLDevice.

type t
val sexp_of_t : t -> Sexplib0.Sexp.t
val create_system_default : unit -> t

Returns the default Metal device for the system. See MTLCreateSystemDefaultDevice.

val copy_all_devices : unit -> t array

Returns an array of all the Metal device instances in the system. See MTLCopyAllDevices.

module GPUFamily : sig ... end

Represents a Metal GPU family, categorizing devices by feature set and capability. See MTLGPUFamily.

val supports_family : t -> GPUFamily.t -> bool

Checks if the device supports the specified GPU family. See supportsFamiliy:.

module ArgumentBuffersTier : sig ... end

Describes the level of support for argument buffers. See MTLArgumentBuffersTier.

type attributes = {
  1. name : string;
  2. registry_id : Unsigned.ULLong.t;
  3. max_threads_per_threadgroup : Size.t;
  4. max_buffer_length : Unsigned.ULong.t;
  5. max_threadgroup_memory_length : Unsigned.ULong.t;
  6. argument_buffers_support : ArgumentBuffersTier.t;
  7. recommended_max_working_set_size : Unsigned.ULLong.t;
  8. is_low_power : bool;
  9. is_removable : bool;
  10. is_headless : bool;
  11. has_unified_memory : bool;
  12. peer_count : Unsigned.ULong.t;
  13. peer_group_id : Unsigned.ULLong.t;
  14. supported_gpu_families : GPUFamily.t list;
}

Metal device attributes relevant for compute tasks.

val sexp_of_attributes : attributes -> Sexplib0.Sexp.t
val get_attributes : t -> attributes

Fetches the static compute-relevant attributes of the device.