Skip to main content

morok_codegen/
lib.rs

1//! Code generation for morok tensor operations.
2//!
3//! This crate provides backend-agnostic code generation infrastructure
4//! for converting optimized UOp graphs into executable code.
5//!
6//! # Architecture
7//!
8//! - **Traits**: Backend-agnostic interfaces (`Renderer`)
9//! - **LLVM**: LLVM IR code generation for CPU execution
10//! - **Future**: CUDA, Metal, OpenCL renderers
11//!
12//! # Usage
13//!
14//! ```ignore
15//! use morok_codegen::llvm;
16//!
17//! let kernel = llvm::text::render(&optimized_uop_graph, Some("kernel"))?;
18//! ```
19
20pub mod c;
21pub mod common;
22pub mod error;
23pub mod llvm;
24#[cfg(feature = "mlir")]
25pub mod mlir;
26pub mod traits;
27pub mod types;
28
29#[cfg(test)]
30pub mod test;
31
32pub use common::collect_buffers_and_vars;
33pub use error::*;
34pub use traits::*;
35pub use types::*;