Skip to main content
This page covers the scalar and vector operations available inside @enigma.kernel bodies. All operations work on IRValue objects and are lowered to their Metal Shading Language equivalents.

Arithmetic

Standard Python operators work on IRValue objects and produce new IRValue nodes:
Integer literals are auto-promoted to u32. Float literals become f32.

Float math intrinsics

Unary

Binary

Ternary

Integer math

Integer bit operations

Predicates

Comparisons

All comparisons return an IRValue of type b1 (boolean):

Selection

enigma.where

Ternary select — returns true_val when condition is true, false_val otherwise:
Example — clamp-free maximum:

Vector operations

Constructors

Component access

Geometry

Simdgroup matrix operations

For 8×8 matrix multiply-accumulate on Apple Silicon:
Requires caps.supports_simdgroup_matrix to be True. See Device Capabilities.