1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! PTX module representation.
//!
//! A [`PtxModule`] represents a complete PTX compilation unit, including the
//! PTX version directive, target architecture, address size, and all function
//! definitions. It is the top-level IR node from which PTX text is emitted.
use PtxFunction;
/// 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");
/// ```