Skip to content

Commit

Permalink
feat(docs): Update docs for Rust crate. (#19)
Browse files Browse the repository at this point in the history
* Update docs.

* Update docs.
  • Loading branch information
KuangjuX authored Sep 19, 2024
1 parent 746ae52 commit 39f95e0
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 8 deletions.
5 changes: 5 additions & 0 deletions thriller-bindings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! Python bindings for the thriller-flow crate.
#![deny(warnings)]
#![deny(missing_docs)]

use access::PyAccessMap;
use pyo3::prelude::*;

Expand Down
3 changes: 2 additions & 1 deletion thriller-core/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ pub enum BufType {
RegVec,
}

/// A Buffer data structure.
/// [`Buffer`] represents an addressable instance declared in user mode, which contains
/// [`Shape`], [`Layout`] and [`BufType`].
#[allow(dead_code)]
#[derive(Clone, Debug)]
pub struct Buffer {
Expand Down
4 changes: 2 additions & 2 deletions thriller-core/src/dataflow/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ impl AttachedEdge {
}
}

/// `ThrillerEdge` repersent load/store in dataflow graph.
#[allow(dead_code)]
/// [`ThrillerEdge`] represents the edge connecting two [`ThrillerNode`]s in a directed
/// acyclic graph.
pub struct ThrillerEdge {
src: Rc<RefCell<ThrillerNode>>,
dst: Rc<RefCell<ThrillerNode>>,
Expand Down
4 changes: 2 additions & 2 deletions thriller-core/src/dataflow/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub enum ThrillerNodeInner {
Block(Rc<ThrillerBlock>),
}

/// A Thriller Dataflow Node that represents either a block of subgraph or an operation.
#[allow(dead_code)]
/// [`ThrillerNode`] represents an abstract node element that can represent a Buffer Node,
/// Operator Node and Block Node.
pub struct ThrillerNode {
inner: Box<ThrillerNodeInner>,
in_edges: Vec<Rc<ThrillerEdge>>,
Expand Down
1 change: 1 addition & 0 deletions thriller-core/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::cell::OnceCell;

pub static mut ID_COUNTER: OnceCell<IdCounter> = OnceCell::new();

/// [`IdCounter`] is a counter that generates unique IDs.
pub struct IdCounter {
id: usize,
}
Expand Down
7 changes: 7 additions & 0 deletions thriller-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
//! - [`AttachedEdge`] is an edge that connects a source and destination buffer
//! with additional access pattern information [`AccessMap`].
//! - [`AccessMap`] represents a multi-dimensional access pattern.
//! - [`ThrillerGraph`] represents a d-dimensional dataflow task graph within nested loops.
//! - [`ThrillerNode`] represents an abstract node element that can represent a Buffer Node,
//! Operator Node and Block Node.
//! - [`ThrillerEdge`] represents the edge connecting two [`ThrillerNode`]s in a directed
//! acyclic graph.
//! - [`Buffer`] represents an addressable instance declared in user mode, which contains
//! [`Shape`], [`Layout`] and [`BufType`].
#![deny(warnings)]
#![deny(missing_docs)]
Expand Down
2 changes: 1 addition & 1 deletion thriller-core/src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ where

/// Dimension description.
///
/// `Dim` describes the number of axes and the length of each axis
/// [`Dim`] describes the number of axes and the length of each axis
/// in an array. It is also used as an index type.
#[derive(Clone, Debug)]
pub struct Dim {
Expand Down
3 changes: 2 additions & 1 deletion thriller-core/src/task/compute/gemm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use std::rc::Rc;

use crate::{next_id, AccessMap, Task, ThrillerError, ThrillerNode, ThrillerResult, Var};

/// Gemm is a task that performs matrix multiplication.
/// [`Gemm`] is a task that computes the General Matrix-Matrix Multiplication
/// operation in register level.
pub struct Gemm {
prevs: Vec<Rc<RefCell<ThrillerNode>>>,
next: Rc<RefCell<ThrillerNode>>,
Expand Down
3 changes: 2 additions & 1 deletion thriller-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Thriller utilities.
//! This crate provides some helper data structures and methods to
//! help useres make easy to build programs with ThrillerFlow.
#![deny(missing_docs)]
#![deny(warnings)]
Expand Down

0 comments on commit 39f95e0

Please sign in to comment.