github ↗
docs menu

Module Helpers.Target

Compilation targets.

A target selects, for one device, the renderer that generates its code, the architecture to generate for, and the interface and device indices to open it with. Empty fields are unspecified.

#type t = {
  1. #device : string;
    (*

    The device, e.g. "AMD".

    *)
  2. #renderer : string;
    (*

    The renderer, e.g. "HIP".

    *)
  3. #arch : string;
    (*

    The architecture, e.g. "gfx1100".

    *)
  4. #interface : string;
    (*

    The interface opening the device.

    *)
  5. #indices : string;
    (*

    The indices of the devices to open.

    *)
}

The type for targets.

#val of_string : string -> (t, string) Stdlib.result

of_string s reads s, written [INTERFACE[:INDICES]+]DEVICE[:RENDERER[:ARCH]]. DEVICE and RENDERER are uppercased; the other fields are kept as written. It is an error if s has more than one +, naming s, or if the part after the + has more than two :, naming that part.

#val pp : Stdlib.Format.formatter -> t -> unit

pp formats a target as of_string reads it, without trailing separators.