Skip to main content

sass_assembler/program/
mod.rs

1use crate::instructions::SassInstruction;
2use serde::{Deserialize, Serialize};
3
4/// SASS 程序 (Cubin 包装)
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct SassProgram {
7    pub name: String,
8    pub kernels: Vec<SassKernel>,
9}
10
11impl SassProgram {
12    pub fn new(name: String) -> Self {
13        Self { name, kernels: Vec::new() }
14    }
15}
16
17/// SASS Kernel 定义
18#[derive(Debug, Clone, Serialize, Deserialize)]
19pub struct SassKernel {
20    pub name: String,
21    pub instructions: Vec<SassInstruction>,
22}