Module Sarek_launch_bounds

val directive : string
val max_allowed : int

Largest work-group size any supported backend accepts. A bound above it can never be met, so it is refused as a mistake rather than carried along.

type parsed =
  1. | Not_a_launch_bound
  2. | Bound of int
  3. | Malformed of string
val parse : string list -> parsed

Classify pragma options. Both ["sarek.max_threads N"] and ["sarek.max_threads"; "N"] spellings are accepted, like sarek.inline.

val peel : Sarek_typed_ast.texpr -> int option * Sarek_typed_ast.texpr

Strip the leading sarek.max_threads pragma(s) from a kernel body. Returns the bound (None when absent) and the remaining body. Two declarations on one kernel are refused.

val reject_misplaced : loc:Ppxlib.location -> string list -> unit

Refuse sarek.max_threads anywhere but around the whole kernel body: a bound that no backend would see must not be silently accepted.