pub struct PtxModule {
pub version: String,
pub target: String,
pub address_size: u32,
pub kernels: Vec<PtxKernel>,
}Expand description
A complete PTX module containing version/target metadata and kernels.
Corresponds to a single .ptx file with a header and one or more
.entry kernel definitions.
Fields§
§version: StringPTX ISA version (e.g. "7.8").
target: StringTarget SM architecture (e.g. "sm_89").
address_size: u32Address size in bits (32 or 64).
kernels: Vec<PtxKernel>Kernel definitions in this module.
Implementations§
Source§impl PtxModule
impl PtxModule
Sourcepub fn new(target: &str) -> Self
pub fn new(target: &str) -> Self
Create a new module targeting the given SM architecture.
Defaults: PTX version 8.7 (CUDA 12.8), address size 64.
Sourcepub fn add_kernel(&mut self, kernel: PtxKernel)
pub fn add_kernel(&mut self, kernel: PtxKernel)
Add a kernel to this module.
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validate that this module’s target SM is high enough for every feature used by its kernels.
Walks all kernel bodies looking for features that carry a minimum
SM requirement — currently tensor-core operations and cp.async
variants (both Ampere+ / SM 8.0). Returns ValidationError::SmTooLow
on the first such mismatch with a human-readable description.
This is a narrow target-capability check, not a semantic or dataflow pass. The goal is to surface clean errors at emit-time instead of cryptic ptxas messages downstream.