pub struct PtxModule {
pub version: String,
pub target: String,
pub address_size: u32,
pub functions: Vec<PtxFunction>,
}Expand description
A complete PTX module (.version, .target, functions).
This is the top-level container for PTX code generation. A module
corresponds to a single .ptx file and contains the metadata directives
required by ptxas as well as one or more kernel/device functions.
§Examples
use oxicuda_ptx::ir::PtxModule;
let module = PtxModule {
version: "8.5".to_string(),
target: "sm_90a".to_string(),
address_size: 64,
functions: Vec::new(),
};
assert_eq!(module.target, "sm_90a");Fields§
§version: StringPTX ISA version (e.g., "8.5").
target: StringTarget architecture (e.g., "sm_90a", "sm_100a").
address_size: u32Address size in bits (32 or 64; virtually always 64).
functions: Vec<PtxFunction>The functions defined in this module.
Implementations§
Source§impl PtxModule
impl PtxModule
Sourcepub fn new(target: impl Into<String>) -> Self
pub fn new(target: impl Into<String>) -> Self
Creates a new module targeting the given architecture with PTX 8.5 and 64-bit addressing.
Sourcepub fn add_function(&mut self, func: PtxFunction)
pub fn add_function(&mut self, func: PtxFunction)
Adds a function to this module.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PtxModule
impl RefUnwindSafe for PtxModule
impl Send for PtxModule
impl Sync for PtxModule
impl Unpin for PtxModule
impl UnsafeUnpin for PtxModule
impl UnwindSafe for PtxModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more