sass_assembler/program/mod.rs
1//! SASS program structure for NVIDIA GPUs.
2
3use crate::instructions::SassInstruction;
4use serde::{Deserialize, Serialize};
5
6/// SASS program (Cubin wrapper)
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct SassProgram {
9 /// Program name
10 pub name: String,
11 /// Kernels in the program
12 pub kernels: Vec<SassKernel>,
13}
14
15impl SassProgram {
16 /// Create a new SASS program.
17 ///
18 /// # Arguments
19 /// * `name` - Program name
20 pub fn new(name: String) -> Self {
21 Self { name, kernels: Vec::new() }
22 }
23}
24
25/// SASS kernel definition
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct SassKernel {
28 /// Kernel name
29 pub name: String,
30 /// Instructions in the kernel
31 pub instructions: Vec<SassInstruction>,
32}