hawk.kernel([fn, kind, steps, time, ...])
|
Trace fn into a Kernel. |
hawk.Kernel
|
A traced kernel: its sink set, its canonical walk and its declarations. |
hawk.raw_device(text, *[, access, reads, ...])
|
Declare a raw device block (the escape hatch for code the vocabulary cannot spell): text spliced verbatim, with access= required (the walk can't see inside text), reads/writes naming the touched slots, returns the value type and language the language text is written in (a writer refuses one it cannot write). |
hawk.RawBlock
|
One spliceable block of author text plus its declared access. |
hawk.steps(kernel, K)
|
kernel stepping K times per launch, named <name>_x<K>.
|
hawk.chain(*kernels, name)
|
Run kernels in sequence as ONE kernel named name. |
hawk.scatter(sink[, policy])
|
hawk.scatter(sink)[key] += v adds v into sink at key, = v stores it there.
|
hawk.lane_position()
|
This lane's position t in the launch, as a value: base + flat. |
hawk.primitive([name, vjp, jvp])
|
Register a custom primitive, named name or after the function. |
hawk.resolve_dispatch(kernel, policies)
|
kernel with each "auto" dispatch group lowered as policies[group] ("switch", "segmented" or "predicated"): how a launching runtime applies the policy it chose.
|
hawk.samples_first(x)
|
Mark x as sample-major: its FIRST axis holds the samples, (N, w). |
hawk.samples_last(x)
|
Mark x as component-major (native): its LAST axis holds the samples, (w, N). |
hawk.Value
|
One traced IR value: every operator on it mints a node. |
hawk.Quantity
|
A compound quantity declaration (seam). |
hawk.Scalar(*args, **kwargs)
|
(shape, dtype, tag).
|
hawk.Index(*args, **kwargs)
|
(shape, dtype, tag).
|
hawk.Int32(*args, **kwargs)
|
(shape, dtype, tag).
|
hawk.UInt32(*args, **kwargs)
|
(shape, dtype, tag).
|
hawk.Quat(*args, **kwargs)
|
(shape, dtype, tag).
|
hawk.Vector
|
Vector[W] — a rank-1 payload of static width W.
|
hawk.Matrix
|
Matrix[R, C] — a rank-2 payload of static extents.
|
hawk.Param(*args, **kwargs)
|
Param — one value shared by every lane, whatever type it wraps.
|
hawk.Meta
|
Annotated[Vector[3], Meta(unit="km")] — opaque notes on a plane.
|
hawk.Mutable
|
Mutable[...] — the output plane a body assigns (the assign).
|
hawk.Table
|
Table[...] — a lookup plane read with at().
|
hawk.Grid
|
Grid["channel", "sample":8192] — the shape of the launch: one lane per point, the body is one lane's code.
|
hawk.Sorted
|
Sorted[Index] — a per-sample Index plane whose values never decrease along the flat lane (segment ids): a promise the compiler may build on.
|
hawk.Staged
|
Staged[Vector[W], count] — a buffer one launch PRODUCES and the next CONSUMES, declared as the producer wrote it.
|
hawk.Wide
|
Wide[W] — a per-sample WIDE plane of RUNTIME extent, stride W.
|
hawk.WideOut
|
WideOut[...] — the wide OUTPUT plane a body commits to, assigned buf = v for the own column or stored by key with hawk.scatter(buf)[k] = v, for the same reason Wide is here: a role an author cannot write is a hole in the language.
|
hawk.Terminated(*args, **kwargs)
|
its form plus the payload type it carries. |
hawk.HawkError
|
The one HAWK refusal type: every structural refusal named by the spec (a total-leaf-merge collision, a mixed sink set, an impossible quantity span, an undeclared reduce op) raises it. |