Module Spoc_framework_registry.Fp_exactness

Backends whose generated kernels cannot be assumed to round every operation as written (docs/fp-contraction-policy.md, section 14).

A backend's plugin marks itself here when a guarantee its code generator relies on is lost at run time (Metal: the conformant compile options could not be built, so the device compiler runs in its fast-math mode). Features that are exact only under that guarantee, such as epilogue fusion on by default, consult is_exact and stay off for a marked backend. The mark is never cleared: a process that lost the guarantee once has built kernels without it.

val inexact : (string * string) list Stdlib.Atomic.t
val mark_inexact : backend:string -> reason:string -> unit

Record that backend lost its exactness guarantee, with the reason. The first reason for a backend is kept.

val inexact_reason : string -> string option

The reason backend was marked, if it was.

val is_exact : string -> bool

true unless backend was marked with mark_inexact.