Module Ir.Compiler_options

val hiprtc : hip_include_options:string list -> rocwmma_include_options:string list -> uses_rocwmma:bool -> with_debug:bool -> string list

The hiprtc (HIP) option vector: includes, then the clang fast-math umbrella with its left-to-right overrides (-fno-associative-math, -fhonor-infinities), then debug.

val nvrtc_reassociation_opt_in : string

nvrtc's opt-IN for floating-point reassociation. It exists here only so nvrtc can be checked never to emit it: the CUDA half of the reduction-order policy is a MEMBERSHIP claim, not an ordering one.

val nvrtc : cuda_include_options:string list -> arch_options:string list -> with_device_debug:bool -> string list

The nvrtc (CUDA) option vector. What this guarantees is the absence of nvrtc_reassociation_opt_in: --use_fast_math is a fixed expansion of four switches, none of which concerns reassociation (measured for gh-ocannl-784; see the implementation).

type metal_math_api =
  1. | Modern_split
  2. | Legacy

Which Metal math-policy API the host macOS offers: the modern split properties (macOS 15+), or the deprecated fastMathEnabled fallback (macOS 14).

type metal_option =
  1. | Language_version_3_1
  2. | Language_version_3_2
  3. | Fast_math_enabled of bool
  4. | Math_mode_safe
  5. | Math_functions_fast
  6. | Enable_logging

Ordered property writes to apply to an MTLCompileOptions object; Metal_backend is only the interpreter that applies them, so the complete sequence is testable without linking Metal.

val equal_metal_option : metal_option -> metal_option -> bool
val metal : routine_logging:bool -> math_api:metal_math_api -> metal_option list
val render_metal : metal_option list -> string
val render : string list -> string

One line, for diagnostics that have to travel through a log or an exception message: a compile's effective option vector is the state a numeric mismatch is reproducible against, and reading it off a failure is what turns "schedule-dependent numeric mismatch" into "optimizer flag".