Module Ops.Axis_type
Axis types.
The role of a loop variable (Op.t.Range) in a kernel.
type t = - #
| Global(*Across the workgroups of a launch.
*) - #
| Local(*Across the threads of a workgroup.
*) - #
| Warp(*Across the threads of a warp.
*) - #
| Weak(*A loop not yet assigned to hardware, whose builder promises that its trips are independent: of two points of the kernel whose values of the range differ, the other ranges free, where one writes a cell of global or workgroup memory, the other neither reads nor writes that cell, even to write the same value. Its trips may then run at once and in any order, as threads, lanes or blocks of the host's threads.
Trips meet only in the
Op.t.Reducethat closes the range, as a reduction's range does, or in code the builder makes atomic. A trip reads a register cell only after writing it in that trip, or one no trip writes: a value carried from trip to trip, as an accumulator or a counter, needs aLoop, as does workgroup memory used again from trip to trip. A weak range whose bound reads memory or another range, or that has none (loop), runs its trips in turn.A store that names fewer cells of global or workgroup memory than it has points along its weak ranges, each alone or all together, where neither its validity nor its gate reads them, breaks the promise visibly: its kernel is refused when it is optimised (
*)Postrange.apply_opts). Any other broken promise gives unspecified results. - #
| Loop(*A serial loop: each trip runs after the one before it, and reads what it wrote.
*) - #
| Upcast(*Unrolled into vector lanes of a thread.
*) - #
| Placeholder(*Stands for an axis while it is built.
*)
The type for axis types, in the order ranges nest: a kernel's ranges sort by axis type, then identity.
A thread range a builder writes (Global, Local, Warp) runs its points at once: workgroups are independent, and the threads of one meet through the barriers the builder orders them by. A store to global memory whose index does not read such a range runs in the thread where that range is 0.
letter a is the letter that names a in kernel names: "g", "l", "w", "L" for Weak and Loop, and "u".
Raises Invalid_argument on Placeholder.
val color : t -> Helpers.colorcolor a is the colour a's letter is printed in.
Raises Invalid_argument on Placeholder.
of_string s is the axis type named s in upper case, without its AxisType. prefix: WEAK. The error names s.