#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![allow(
clippy::too_many_arguments,
clippy::needless_range_loop,
clippy::double_must_use,
clippy::items_after_test_module,
clippy::assertions_on_constants,
clippy::overly_complex_bool_expr,
clippy::filter_map_bool_then
)]
#![allow(clippy::module_inception)]
#[allow(dead_code)]
pub(crate) fn invalid_program(
op_id: &'static str,
message: impl Into<String>,
) -> vyre::ir::Program {
let message = message.into();
vyre::ir::Program::wrapped(
Vec::new(),
[1, 1, 1],
vec![region::wrap_anonymous(
op_id,
vec![vyre::ir::Node::trap(vyre::ir::Expr::u32(0), message)],
)],
)
}
pub mod region;
pub mod range_ordering;
pub mod tensor_ref;
pub use tensor_ref::{check_dtype, check_shape, check_unique_names, TensorRef, TensorRefError};
pub mod builder;
mod substrate_catalog;
pub use builder::{check_tensors, BuildOptions};
pub mod buffer_names;
pub mod descriptor;
pub use descriptor::{BufferDescriptor, ProgramDescriptor};
pub mod compat_aliases;
#[cfg(feature = "math-linalg")]
pub use math::{matmul_bias_tiled, matmul_tiled, MatmulBias, MatmulBiasTiled, MatmulTiled};
#[doc(hidden)]
pub mod harness;
#[cfg(any(
feature = "math-linalg",
feature = "math-scan",
feature = "math-broadcast"
))]
pub mod math;
#[cfg(feature = "logical")]
pub mod logical;
#[cfg(any(
feature = "nn-activation",
feature = "nn-linear",
feature = "nn-norm",
feature = "nn-attention"
))]
pub mod nn;
#[cfg(any(
feature = "matching-substring",
feature = "matching-dfa",
feature = "matching-nfa"
))]
pub mod scan;
#[cfg(any(
feature = "matching-substring",
feature = "matching-dfa",
feature = "matching-nfa"
))]
#[deprecated(
since = "0.4.1",
note = "use `vyre_libs::scan` instead - the `matching` name is kept as a transition alias only"
)]
pub mod matching;
#[cfg(feature = "decode")]
pub mod decode;
#[cfg(feature = "hash")]
pub mod hash;
pub mod text;
pub mod representation;
pub mod parsing;
pub mod borrowck;
pub mod graph;
#[cfg(feature = "c-parser")]
pub mod compiler;
#[cfg(feature = "c-parser")]
pub use compiler::{
cfg::c11_build_cfg_and_gotos, object_writer::opt_lower_elf,
regalloc::opt_x86_64_register_allocation, stack_layout::opt_stack_layout_generation,
types_layout::c11_compute_alignments,
};
#[cfg(feature = "security")]
pub mod security;
#[cfg(feature = "visual")]
pub mod visual;
pub mod dataflow;
mod primitive_catalog;
pub use dataflow::{Soundness, SoundnessTagged};
#[cfg(feature = "rule")]
pub mod rule;
#[cfg(feature = "intern")]
pub mod intern;
pub mod contracts;
pub mod signatures;
pub use signatures::{
BOOL_OUTPUTS, BYTES_TO_BYTES_INPUTS, BYTES_TO_BYTES_OUTPUTS, BYTES_TO_U32_OUTPUTS,
F32_F32_F32_INPUTS, F32_F32_INPUTS, F32_INPUTS, F32_OUTPUTS, I32_OUTPUTS, U32_INPUTS,
U32_OUTPUTS, U32_U32_INPUTS,
};
pub(crate) mod test_migration;
pub mod test_support;
pub mod observability {
pub use vyre_driver::observability::{BackendObservabilityProvider, DriverObservability};
}
pub mod prelude {
pub use vyre::ir::{BufferAccess, BufferDecl, DataType, Expr, Node, Program};
pub use vyre::{BackendError, DispatchConfig};
pub use vyre_foundation::ir::model::expr::GeneratorRef;
pub use crate::builder::{check_tensors, BuildOptions};
pub use crate::tensor_ref::{
check_dtype, check_shape, check_unique_names, TensorRef, TensorRefError,
};
pub use crate::region::{wrap, wrap_anonymous, wrap_child};
#[cfg(feature = "decode")]
pub use crate::decode::{base64_decode, hex_decode, inflate, ziftsieve_gpu};
#[cfg(feature = "crypto-blake3")]
pub use crate::hash::blake3_compress;
#[cfg(feature = "crypto-fnv")]
pub use crate::hash::fnv1a32;
#[cfg(feature = "logical")]
pub use crate::logical::{and, nand, nor, or, xor};
#[cfg(feature = "math-broadcast")]
pub use crate::math::broadcast;
#[cfg(feature = "math-scan")]
pub use crate::math::scan_prefix_sum;
#[cfg(feature = "math-algebra")]
pub use crate::math::{
bool_semiring_matmul, lattice_join, lattice_meet, semiring_min_plus_mul, sketch_mix,
try_bool_semiring_matmul, try_lattice_join, try_lattice_meet, try_semiring_min_plus_mul,
try_sketch_mix,
};
#[cfg(feature = "math-linalg")]
pub use crate::math::{dot, matmul, matmul_tiled, Matmul, MatmulTiled};
#[cfg(feature = "math-succinct")]
pub use crate::math::{rank1_query, rank1_superblocks, try_rank1_query, try_rank1_superblocks};
#[cfg(feature = "nn-linear")]
pub use crate::nn::linear;
#[cfg(feature = "nn-activation")]
pub use crate::nn::relu;
#[cfg(feature = "nn-attention")]
pub use crate::nn::{attention, softmax, Attention, Softmax};
#[cfg(feature = "nn-norm")]
pub use crate::nn::{layer_norm, LayerNorm};
#[cfg(feature = "matching-substring")]
pub use crate::scan::substring_search;
#[cfg(feature = "matching-dfa")]
pub use crate::scan::{aho_corasick, dfa_compile, CompiledDfa, DfaCompileError};
}
#[cfg(all(test, feature = "matching-substring"))]
mod compat_alias_tests {
use vyre::ir::Node;
#[test]
#[allow(deprecated)]
fn legacy_matching_public_path_preserves_old_id_and_registry_metadata() {
let program =
crate::matching::substring::substring_search("haystack", "needle", "matches", 8, 3);
let [Node::Region { generator, .. }] = program.entry() else {
panic!("expected legacy substring search to emit one region");
};
assert_eq!(
generator.as_str(),
crate::scan::substring::LEGACY_MATCHING_SUBSTRING_OP_ID
);
assert_eq!(
crate::compat_aliases::MATCHING_SUBSTRING_ALIAS.canonical_path,
"vyre_libs::scan::substring"
);
assert_eq!(
crate::compat_aliases::MATCHING_SUBSTRING_ALIAS.deprecated_path,
"vyre_libs::matching::substring"
);
}
}