1pub mod dim;
2pub use dim::*;
3
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
8pub struct Device(pub u64);
9
10#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
12pub struct Context(pub u64);
13
14#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
16pub struct Function(pub u64);
17
18#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
20pub struct Stream(pub u64);
21
22#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
24pub enum FunctionAttribute {
25 MaxThreadsPerBlock,
26 SharedSizeBytes,
27 ConstSizeBytes,
28 LocalSizeBytes,
29 NumRegs,
30 PTXVersion,
31 BinaryVersion,
32 CacheModeCA,
33 MaxDynamicSharedSizeBytes,
34 PreferredSharedMemoryCarveout,
35 Max,
36}
37
38#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
40pub enum RegisterModifier {
41 None = 0,
42 X1 = 1,
43 X4 = 2,
44 X8 = 3,
45 X16 = 4,
46 U32 = 5,
47 U64 = 6,
48}
49
50#[derive(Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
52pub enum OperandKind {
53 ImmutableUint64 {
54 value: u64,
55 },
56 ImmutableDouble {
57 value: f64,
58 },
59 Register {
60 num: i32,
61 prop: String,
62 },
63 Predicate {
64 num: i32,
65 },
66 CBank {
69 id: i32,
70 has_imm_offset: bool,
71 imm_offset: i32,
72 has_reg_offset: bool,
73 reg_offset: i32,
74 },
75 MemRef {
76 has_ra: bool,
77 ra_num: i32,
78 ra_mod: RegisterModifier,
79 has_ur: bool,
80 ur_num: i32,
81 ur_mod: RegisterModifier,
82 has_imm: bool,
83 imm: i32,
84 },
85 Generic {
86 array: String,
87 },
88}
89
90#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
92pub enum MemorySpace {
93 None = 0,
94 Local = 1,
95 Generic = 2,
96 Global = 3,
97 Shared = 4,
98 Constant = 5,
99 GlobalToShared = 6,
100 Surface = 7,
101 Texture = 8,
102}
103
104#[derive(
106 Debug, Default, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize,
107)]
108pub struct Predicate {
109 pub num: std::ffi::c_int,
111 pub is_neg: bool,
113 pub is_uniform: bool,
115}
116
117#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
119pub enum InsertionPoint {
120 Before,
121 After,
122}
123
124#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
126pub enum CudaErrorKind {
127 Success,
128 InvalidValue,
129 OutOfMemory,
130 NotInitialized,
131 Deinitialized,
132 ProfilerDisabled,
133 ProfilerNotInitialized,
134 ProfilerAlreadyStarted,
135 ProfilerAlreadyStopped,
136 NoDevice,
137 InvalidDevice,
138 InvalidImage,
139 InvalidContext,
140 ContextAlreadyCurrent,
141 MapFailed,
142 UnmapFailed,
143 ArrayIsMapped,
144 AlreadyMapped,
145 NoBinaryForGpu,
146 AlreadyAcquired,
147 NotMapped,
148 NotMappedAsArray,
149 NotMappedAsPointer,
150 EccUncorrectable,
151 UnsupportedLimit,
152 ContextAlreadyInUse,
153 PeerAccessUnsupported,
154 InvalidPtx,
155 InvalidGraphicsContext,
156 NvlinkUncorrectable,
157 InvalidSouce,
158 FileNotFound,
159 SharedObjectSymbolNotFound,
160 SharedObjectInitFailed,
161 OperatingSystemError,
162 InvalidHandle,
163 NotFound,
164 NotReady,
165 IllegalAddress,
166 LaunchOutOfResources,
167 LaunchTimeout,
168 LaunchIncompatibleTexturing,
169 PeerAccessAlreadyEnabled,
170 PeerAccessNotEnabled,
171 PrimaryContextActive,
172 ContextIsDestroyed,
173 AssertError,
174 TooManyPeers,
175 HostMemoryAlreadyRegistered,
176 HostMemoryNotRegistered,
177 HardwareStackError,
178 IllegalInstruction,
179 MisalignedAddress,
180 InvalidAddressSpace,
181 InvalidProgramCounter,
182 LaunchFailed,
183 NotPermitted,
184 NotSupported,
185 Unknown,
186}