Module frontend

Source
Expand description

Cube Frontend Types.

Re-exports§

pub use branch::range;
pub use branch::range;
pub use branch::range_stepped;
pub use branch::range_stepped;
pub use branch::RangeExpand;
pub use branch::SteppedRangeExpand;

Modules§

ABSOLUTE_POS
The position of the working unit in the whole cube kernel, without regards to cubes and axis.
ABSOLUTE_POS_X
The index of the working unit in the whole cube kernel along the X axis, without regards to cubes.
ABSOLUTE_POS_Y
The index of the working unit in the whole cube kernel along the Y axis, without regards to cubes.
ABSOLUTE_POS_Z
The index of the working unit in the whole cube kernel along the Z axis, without regards to cubes.
CUBE_COUNT
The number of cubes launched.
CUBE_COUNT_X
The number of cubes launched along the X axis.
CUBE_COUNT_Y
The number of cubes launched along the Y axis.
CUBE_COUNT_Z
The number of cubes launched along the Z axis.
CUBE_DIM
The total amount of working units in a cube.
CUBE_DIM_X
The dimension of the cube along the X axis.
CUBE_DIM_Y
The dimension of the cube along the Y axis.
CUBE_DIM_Z
The dimension of the cube along the Z axis.
CUBE_POS
The cube position, without regards to axis.
CUBE_POS_X
The cube position along the X axis.
CUBE_POS_Y
The cube position along the Y axis.
CUBE_POS_Z
The cube position along the Z axis.
PLANE_DIM
The total amount of working units in a plane.
UNIT_POS
The position of the working unit inside the cube, without regards to axis.
UNIT_POS_PLANE
The relative position of the working unit inside the plane, without regards to cube dimensions.
UNIT_POS_X
The position of the working unit inside the cube along the X axis.
UNIT_POS_Y
The position of the working unit inside the cube along the Y axis.
UNIT_POS_Z
The position of the working unit inside the cube along the Z axis.
add
add_assign
add_assign_array_op
add_assign_op
and
assign
bitand
bitand_assign_array_op
bitand_assign_op
bitor
bitor_assign_array_op
bitor_assign_op
bitxor
bitxor_assign_array_op
bitxor_assign_op
branch
cast
cmma
This module exposes cooperative matrix-multiply and accumulate operations.
copy_bulk
cube_comment
div
div_assign_array_op
div_assign_op
eq
ge
gt
index
index_assign
le
lt
mul
mul_assign_array_op
mul_assign_op
ne
neg
not
or
plane_all
Module containing the expand function for plane_all().
plane_any
Module containing the expand function for plane_any().
plane_broadcast
Module containing the expand function for plane_broadcast().
plane_elect
Module containing the expand function for plane_elect().
plane_max
Module containing the expand function for plane_max().
plane_min
Module containing the expand function for plane_min().
plane_prod
Module containing the expand function for plane_prod().
plane_sum
Module containing the expand function for plane_sum().
rem
rem_assign_array_op
rem_assign_op
select
select_many
shl
shl_assign_array_op
shl_assign_op
shr
shr_assign_array_op
shr_assign_op
sub
sub_assign_array_op
sub_assign_op
synchronization

Macros§

debug_print
Print a formatted message using the target’s debug print facilities. The format string is target specific, but Vulkan and CUDA both use the C++ conventions. WGSL isn’t currently supported.
debug_print_expand
Print a formatted message using the target’s debug print facilities. The format string is target specific, but Vulkan and CUDA both use the C++ conventions. WGSL isn’t currently supported.

Structs§

Array
A contiguous array of elements.
ArrayCompilationArg
ArrayHandleRef
Tensor representation with a reference to the server handle.
Atomic
An atomic numerical type wrapping a normal numeric primitive. Enables the use of atomic operations, while disabling normal operations. In WGSL, this is a separate type - on CUDA/SPIR-V it can theoretically be bitcast to a normal number, but this isn’t recommended.
CubeContext
ExpandElementTyped
Expand type associated with a type.
FloatExpand
Line
A contiguous list of elements that supports auto-vectorized operations.
Registry
It is similar to a map, but where the keys are stored at comptime, but the values can be runtime variables.
ScalarArg
Sequence
A sequence of cube types that is inlined during compilation.
SequenceArg
SequenceCompilationArg
SequenceExpand
Expand type of Sequence.
SharedMemory
Slice
A read-only contiguous list of elements
SliceMut
A read-write contiguous list of elements.
Tensor
The tensor type is similar to the array type, however it comes with more metadata such as stride and shape.
TensorCompilationArg
Compilation argument for a tensor.
TensorHandleRef
Tensor representation with a reference to the server handle, the strides and the shape.
flex32
A floating point type with relaxed precision, minimum f16, max [f32].
tf32
A 19-bit floating point type implementing the tfloat32 format.

Enums§

ArrayArg
AtomicOp
ExpandElement
Reference to a JIT variable
TensorArg
Argument to be used for tensors passed as arguments to kernels.

Constants§

ABSOLUTE_POS
The position of the working unit in the whole cube kernel, without regards to cubes and axis.
ABSOLUTE_POS_X
The index of the working unit in the whole cube kernel along the X axis, without regards to cubes.
ABSOLUTE_POS_Y
The index of the working unit in the whole cube kernel along the Y axis, without regards to cubes.
ABSOLUTE_POS_Z
The index of the working unit in the whole cube kernel along the Z axis, without regards to cubes.
CUBE_COUNT
The number of cubes launched.
CUBE_COUNT_X
The number of cubes launched along the X axis.
CUBE_COUNT_Y
The number of cubes launched along the Y axis.
CUBE_COUNT_Z
The number of cubes launched along the Z axis.
CUBE_DIM
The total amount of working units in a cube.
CUBE_DIM_X
The dimension of the cube along the X axis.
CUBE_DIM_Y
The dimension of the cube along the Y axis.
CUBE_DIM_Z
The dimension of the cube along the Z axis.
CUBE_POS
The cube position, without regards to axis.
CUBE_POS_X
The cube position along the X axis.
CUBE_POS_Y
The cube position along the Y axis.
CUBE_POS_Z
The cube position along the Z axis.
PLANE_DIM
The total amount of working units in a plane.
UNIT_POS
The position of the working unit inside the cube, without regards to axis.
UNIT_POS_PLANE
The relative position of the working unit inside the plane, without regards to cube dimensions.
UNIT_POS_X
The position of the working unit inside the cube along the X axis.
UNIT_POS_Y
The position of the working unit inside the cube along the Y axis.
UNIT_POS_Z
The position of the working unit inside the cube along the Z axis.

Traits§

Abs
ArgSettings
Defines the argument settings used to launch a kernel.
BitCast
Enables reinterpet-casting/bitcasting from any floating point value to any integer value and vice versa
BoolOps
Extension trait for bool.
Cast
Enable elegant casting from any to any CubeElem
Ceil
Clamp
CompilationArg
Argument used during the compilation of kernels.
Cos
CountOnes
CubeIndex
Fake indexation so we can rewrite indexes into scalars as calls to this fake function in the non-expanded function
CubeIndexMut
CubePrimitive
Form of CubeType that encapsulates all primitive types: Numeric, UInt, Bool
CubeType
Types used in a cube function must implement this trait
Dot
Erf
Exp
ExpandElementBaseInit
Float
Floating point numbers. Used as input in float kernels
Floor
Index
Init
Trait to be implemented by cube types implementations.
Int
Signed or unsigned integer. Used as input in int kernels
IntoRuntime
Trait useful for cube types that are also used with comptime.
LaunchArg
Defines a type that can be used as argument to a kernel.
LaunchArgExpand
Defines how a launch argument can be expanded.
Log
Log1p
Magnitude
Max
Min
Normalize
Not
Numeric
Type that encompasses both (unsigned or signed) integers and floats Used in kernels that should work for both.
OptionExt
Powf
Recip
RegistryQuery
To find an item from the registry, the query must be able to be translated to the actual key type.
Remainder
ReverseBits
Round
ScalarArgSettings
Similar to ArgSettings, however only for scalar types that don’t depend on the Runtime trait.
Sin
SizedContainer
SliceOperator
SliceOperatorExpand
Sqrt
Tanh

Functions§

array_assign_binary_op_expand
copy_bulk
Bulk copy length elements between two array-likes without intermediates.
debug_call_expand
Calls a function and inserts debug symbols if debug is enabled.
debug_source_expand
Adds source instruction if debug is enabled
fma
Fused multiply-add A*B+C.
fma_expand
Expand method of fma.
init_expand
plane_all
Perform a reduce all operation across all units in a plane.
plane_any
Perform a reduce any operation across all units in a plane.
plane_broadcast
Broadcasts the value from the specified plane unit at the given index to all active units within that plane.
plane_elect
Returns true if the cube unit has the lowest plane_unit_id among active unit in the plane
plane_max
Perform a reduce max operation across all units in a plane.
plane_min
Perform a reduce min operation across all units in a plane.
plane_prod
Perform a reduce prod operation across all units in a plane.
plane_sum
Perform a reduce sum operation across all units in a plane.
printf_expand
Prints a formatted message using the print debug layer in Vulkan, or printf in CUDA.
select
Executes both branches, then selects a value based on the condition. This should be branchless, but might depend on the compiler.
select_many
Same as [select] but with lines instead.
slice_expand
spanned_expand
Calls an intrinsic op and inserts debug symbols if debug is enabled.
unary_expand
unary_expand_fixed_output

Type Aliases§

IntExpand
NumericExpand