Skip to main content

Module dsl

Module dsl 

Source

Re-exports§

pub use frontend::cmma;
pub use prelude::Assign;
pub use prelude::IntoRuntime;
pub use num_traits;
pub use codegen::*;

Modules§

arena
A circular, allocation-free arena for reusable memory blocks.
arguments
backtrace
Backtrace module to build error reports.
benchmark
Module for benchmark timings
bytes
Utilities module to manipulate bytes.
cache
Cache module for an efficient in-memory and persistent database.
client
Compute client module.
codegen
compiler
compute
config
Runtime configuration trait shared across crates.
device
Device module.
device_handle
Device handle module.
format
Format utilities.
frontend
Ruda Frontend Types.
future
Some future utilities that work across environments. Future utils with a compatible API for native, non-std and wasm environments.
hash
Hashing helper for stable, collision resistant hashes
io
Input Output utilities.
ir
Ruda Language Internal Representation.
kernel
launch
lowering
numeric
Custom float implementations
post_processing
prelude
profile
Module for profiling any executable part
quant
Quantization primitives required outside of ruda-kernel
rand
Rand module contains types for random number generation for non-std environments and for std environments.
reader
Useful when you need to read async data without having to decorate each function with async notation.
server
Compute server module.
stream_id
Stream id related utilities.
stub
Stub module contains types for stubs for non-std environments and for std environments.
tensor
Common ZSpace Utilities for Ruda
tune
Autotune module
zspace
Common ZSpace Utilities for Ruda

Macros§

comment
Insert a literal comment into the kernel source code.
comptime
Mark the contents of this macro as compile time values, turning off all expansion for this code and using it verbatim
comptime_type
Makes the function return a compile time value Useful in a ruda trait to have a part of the trait return comptime values
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.
define
define_scalar
Define a custom type to be used for a comptime scalar type. Useful for cases where generics can’t work.
define_size
Define a custom type to be used for a comptime size. Useful for cases where generics can’t work.
expand_assert
expand_error
intrinsic
Mark the contents of this macro as an intrinsic, turning off all expansion for this code and calling it with the scope
s
Slice argument constructor for tensor indexing.
shape
size
strides
terminate
Terminate the execution of the kernel for the current unit.
unexpanded

Structs§

MemoryUsage
Amount of memory in use by this allocator and statistics on how much memory is reserved and wasted in total.
RudaDim
The number of units across all 3 axis totalling to the number of working units in a ruda.
RudaTuneId
ID used to identify a Just-in-Time environment.
e2m1
A 4-bit floating point type with 2 exponent bits and 1 mantissa bit.
e2m3
A 6-bit floating point type with 2 exponent bits and 3 mantissa bits.
e2m1x2
A 4-bit floating point type with 2 exponent bits and 1 mantissa bit. Packed with two elements per value, to allow for conversion to/from bytes. Care must be taken to ensure the shape is adjusted appropriately.
e3m2
A 6-bit floating point type with 3 exponent bits and 2 mantissa bits.
e4m3
A 8-bit floating point type with 4 exponent bits and 3 mantissa bits.
e5m2
A 8-bit floating point type with 5 exponent bits and 2 mantissa bits.
flex32
A floating point type with relaxed precision, minimum f16, max f32.
tf32
A 19-bit floating point type implementing the tfloat32 format.
ue8m0
An 8-bit unsigned floating point type with 8 exponent bits and no mantissa bits. Used for scaling factors.

Enums§

CompilationError
JIT compilation error.
ExecutionMode
The kind of execution to be performed.
MemoryConfiguration
High level configuration of memory management.
RudaCount
Specifieds the number of rudas to be dispatched for a kernel.
VectorizationError

Traits§

Compiler
Compiles the representation into its own representation that can be formatted into tokens.
RudaElement
The base element trait for the jit backend.
RudaTask
Kernel trait with the ComputeShader that will be compiled and cached based on the provided id.
Runtime
Runtime for the Ruda.
ScalarArgType

Functions§

calculate_ruda_count_elemwise
Calculate the number of rudas required to execute an operation where one ruda unit is assigned to one element.
tensor_vector_size_parallel
Find the maximum vector size usable for parallel vectorization along the given axis from the supported vector sizes or return 1 if vectorization is impossible.
tensor_vector_size_perpendicular
Find the maximum vector size usable for perpendicular vectorization along the given axis from the supported vector sizes or return 1 if vectorization is impossible.
tensor_vectorization
tensor_vectorization_factor
try_tensor_vector_size_parallel
Like try_tensor_vector_size_parallel but does not assume 1 is supported
try_tensor_vector_sizes_perpendicular
Like tensor_vector_sizes_perpendicular but does not assume 1 is supported

Type Aliases§

ExpandType
RuntimeArg
Runtime arguments to launch a kernel.

Attribute Macros§

derive_expand
Attribute macro to derive ruda traits for existing structs, without redefining that struct.
derive_ruda_comptime
Attribute macro to define a type that can be used as a kernel comptime argument This derive Debug, Hash, PartialEq, Eq, Clone, Copy
ruda
Mark a ruda function, trait or implementation for expansion.

Derive Macros§

AutotuneKey
Implements display and initialization for autotune keys.
IntoRuntime
Implements IntoRuntime for a RudaType
RudaLaunch
Derive macro to define a ruda type that is launched with a kernel
RudaType
Derive macro to define a ruda type that is not launched
RudaTypeMut
Implements mutability for a RudaType