|
| 1 | +/* automatically generated by rust-bindgen 0.59.2 */ |
| 2 | + |
| 3 | +pub type __uint8_t = ::std::os::raw::c_uchar; |
| 4 | +pub type __int64_t = ::std::os::raw::c_long; |
| 5 | +pub type size_t = ::std::os::raw::c_ulong; |
| 6 | +#[repr(C)] |
| 7 | +#[derive(Debug, Copy, Clone)] |
| 8 | +pub struct LLVMOpaqueType { |
| 9 | + _unused: [u8; 0], |
| 10 | +} |
| 11 | +#[doc = " Each value in the LLVM IR has a type, an LLVMTypeRef."] |
| 12 | +#[doc = ""] |
| 13 | +#[doc = " @see llvm::Type"] |
| 14 | +pub type LLVMTypeRef = *mut LLVMOpaqueType; |
| 15 | +#[repr(C)] |
| 16 | +#[derive(Debug, Copy, Clone)] |
| 17 | +pub struct LLVMOpaqueValue { |
| 18 | + _unused: [u8; 0], |
| 19 | +} |
| 20 | +#[doc = " Represents an individual value in LLVM IR."] |
| 21 | +#[doc = ""] |
| 22 | +#[doc = " This models llvm::Value."] |
| 23 | +pub type LLVMValueRef = *mut LLVMOpaqueValue; |
| 24 | +#[repr(C)] |
| 25 | +#[derive(Debug, Copy, Clone)] |
| 26 | +pub struct EnzymeOpaqueTypeAnalysis { |
| 27 | + _unused: [u8; 0], |
| 28 | +} |
| 29 | +pub type EnzymeTypeAnalysisRef = *mut EnzymeOpaqueTypeAnalysis; |
| 30 | +#[repr(C)] |
| 31 | +#[derive(Debug, Copy, Clone)] |
| 32 | +pub struct EnzymeOpaqueLogic { |
| 33 | + _unused: [u8; 0], |
| 34 | +} |
| 35 | +pub type EnzymeLogicRef = *mut EnzymeOpaqueLogic; |
| 36 | +#[repr(C)] |
| 37 | +#[derive(Debug, Copy, Clone)] |
| 38 | +pub struct EnzymeOpaqueAugmentedReturn { |
| 39 | + _unused: [u8; 0], |
| 40 | +} |
| 41 | +pub type EnzymeAugmentedReturnPtr = *mut EnzymeOpaqueAugmentedReturn; |
| 42 | +#[repr(C)] |
| 43 | +#[derive(Debug, Copy, Clone)] |
| 44 | +pub struct IntList { |
| 45 | + pub data: *mut i64, |
| 46 | + pub size: size_t, |
| 47 | +} |
| 48 | +#[test] |
| 49 | +fn bindgen_test_layout_IntList() { |
| 50 | + assert_eq!( |
| 51 | + ::std::mem::size_of::<IntList>(), |
| 52 | + 16usize, |
| 53 | + concat!("Size of: ", stringify!(IntList)) |
| 54 | + ); |
| 55 | + assert_eq!( |
| 56 | + ::std::mem::align_of::<IntList>(), |
| 57 | + 8usize, |
| 58 | + concat!("Alignment of ", stringify!(IntList)) |
| 59 | + ); |
| 60 | + assert_eq!( |
| 61 | + unsafe { &(*(::std::ptr::null::<IntList>())).data as *const _ as usize }, |
| 62 | + 0usize, |
| 63 | + concat!("Offset of field: ", stringify!(IntList), "::", stringify!(data)) |
| 64 | + ); |
| 65 | + assert_eq!( |
| 66 | + unsafe { &(*(::std::ptr::null::<IntList>())).size as *const _ as usize }, |
| 67 | + 8usize, |
| 68 | + concat!("Offset of field: ", stringify!(IntList), "::", stringify!(size)) |
| 69 | + ); |
| 70 | +} |
| 71 | +#[repr(u32)] |
| 72 | +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] |
| 73 | +pub enum CConcreteType { |
| 74 | + DT_Anything = 0, |
| 75 | + DT_Integer = 1, |
| 76 | + DT_Pointer = 2, |
| 77 | + DT_Half = 3, |
| 78 | + DT_Float = 4, |
| 79 | + DT_Double = 5, |
| 80 | + DT_Unknown = 6, |
| 81 | +} |
| 82 | +#[repr(C)] |
| 83 | +#[derive(Debug, Copy, Clone)] |
| 84 | +pub struct EnzymeTypeTree { |
| 85 | + _unused: [u8; 0], |
| 86 | +} |
| 87 | +pub type CTypeTreeRef = *mut EnzymeTypeTree; |
| 88 | +extern "C" { |
| 89 | + pub fn EnzymeNewTypeTree() -> CTypeTreeRef; |
| 90 | +} |
| 91 | +extern "C" { |
| 92 | + pub fn EnzymeFreeTypeTree(CTT: CTypeTreeRef); |
| 93 | +} |
| 94 | +extern "C" { |
| 95 | + pub fn EnzymeSetCLBool(arg1: *mut ::std::os::raw::c_void, arg2: u8); |
| 96 | +} |
| 97 | +extern "C" { |
| 98 | + pub fn EnzymeSetCLInteger(arg1: *mut ::std::os::raw::c_void, arg2: i64); |
| 99 | +} |
| 100 | +#[repr(C)] |
| 101 | +#[derive(Debug, Copy, Clone)] |
| 102 | +pub struct CFnTypeInfo { |
| 103 | + #[doc = " Types of arguments, assumed of size len(Arguments)"] |
| 104 | + pub Arguments: *mut CTypeTreeRef, |
| 105 | + #[doc = " Type of return"] |
| 106 | + pub Return: CTypeTreeRef, |
| 107 | + #[doc = " The specific constant(s) known to represented by an argument, if constant"] |
| 108 | + pub KnownValues: *mut IntList, |
| 109 | +} |
| 110 | +#[test] |
| 111 | +fn bindgen_test_layout_CFnTypeInfo() { |
| 112 | + assert_eq!( |
| 113 | + ::std::mem::size_of::<CFnTypeInfo>(), |
| 114 | + 24usize, |
| 115 | + concat!("Size of: ", stringify!(CFnTypeInfo)) |
| 116 | + ); |
| 117 | + assert_eq!( |
| 118 | + ::std::mem::align_of::<CFnTypeInfo>(), |
| 119 | + 8usize, |
| 120 | + concat!("Alignment of ", stringify!(CFnTypeInfo)) |
| 121 | + ); |
| 122 | + assert_eq!( |
| 123 | + unsafe { &(*(::std::ptr::null::<CFnTypeInfo>())).Arguments as *const _ as usize }, |
| 124 | + 0usize, |
| 125 | + concat!("Offset of field: ", stringify!(CFnTypeInfo), "::", stringify!(Arguments)) |
| 126 | + ); |
| 127 | + assert_eq!( |
| 128 | + unsafe { &(*(::std::ptr::null::<CFnTypeInfo>())).Return as *const _ as usize }, |
| 129 | + 8usize, |
| 130 | + concat!("Offset of field: ", stringify!(CFnTypeInfo), "::", stringify!(Return)) |
| 131 | + ); |
| 132 | + assert_eq!( |
| 133 | + unsafe { &(*(::std::ptr::null::<CFnTypeInfo>())).KnownValues as *const _ as usize }, |
| 134 | + 16usize, |
| 135 | + concat!("Offset of field: ", stringify!(CFnTypeInfo), "::", stringify!(KnownValues)) |
| 136 | + ); |
| 137 | +} |
| 138 | +#[repr(u32)] |
| 139 | +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] |
| 140 | +pub enum CDIFFE_TYPE { |
| 141 | + DFT_OUT_DIFF = 0, |
| 142 | + DFT_DUP_ARG = 1, |
| 143 | + DFT_CONSTANT = 2, |
| 144 | + DFT_DUP_NONEED = 3, |
| 145 | +} |
| 146 | +#[repr(u32)] |
| 147 | +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] |
| 148 | +pub enum CDerivativeMode { |
| 149 | + DEM_ForwardMode = 0, |
| 150 | + DEM_ReverseModePrimal = 1, |
| 151 | + DEM_ReverseModeGradient = 2, |
| 152 | + DEM_ReverseModeCombined = 3, |
| 153 | + DEM_ForwardModeSplit = 4, |
| 154 | +} |
| 155 | +extern "C" { |
| 156 | + pub fn EnzymeCreateForwardDiff( |
| 157 | + arg1: EnzymeLogicRef, |
| 158 | + todiff: LLVMValueRef, |
| 159 | + retType: CDIFFE_TYPE, |
| 160 | + constant_args: *mut CDIFFE_TYPE, |
| 161 | + constant_args_size: size_t, |
| 162 | + TA: EnzymeTypeAnalysisRef, |
| 163 | + returnValue: u8, |
| 164 | + mode: CDerivativeMode, |
| 165 | + freeMemory: u8, |
| 166 | + width: ::std::os::raw::c_uint, |
| 167 | + additionalArg: LLVMTypeRef, |
| 168 | + typeInfo: CFnTypeInfo, |
| 169 | + _uncacheable_args: *mut u8, |
| 170 | + uncacheable_args_size: size_t, |
| 171 | + augmented: EnzymeAugmentedReturnPtr, |
| 172 | + ) -> LLVMValueRef; |
| 173 | +} |
| 174 | +extern "C" { |
| 175 | + pub fn EnzymeCreatePrimalAndGradient( |
| 176 | + arg1: EnzymeLogicRef, |
| 177 | + todiff: LLVMValueRef, |
| 178 | + retType: CDIFFE_TYPE, |
| 179 | + constant_args: *mut CDIFFE_TYPE, |
| 180 | + constant_args_size: size_t, |
| 181 | + TA: EnzymeTypeAnalysisRef, |
| 182 | + returnValue: u8, |
| 183 | + dretUsed: u8, |
| 184 | + mode: CDerivativeMode, |
| 185 | + width: ::std::os::raw::c_uint, |
| 186 | + freeMemory: u8, |
| 187 | + additionalArg: LLVMTypeRef, |
| 188 | + typeInfo: CFnTypeInfo, |
| 189 | + _uncacheable_args: *mut u8, |
| 190 | + uncacheable_args_size: size_t, |
| 191 | + augmented: EnzymeAugmentedReturnPtr, |
| 192 | + AtomicAdd: u8, |
| 193 | + ) -> LLVMValueRef; |
| 194 | +} |
| 195 | +extern "C" { |
| 196 | + pub fn EnzymeCreateAugmentedPrimal( |
| 197 | + arg1: EnzymeLogicRef, |
| 198 | + todiff: LLVMValueRef, |
| 199 | + retType: CDIFFE_TYPE, |
| 200 | + constant_args: *mut CDIFFE_TYPE, |
| 201 | + constant_args_size: size_t, |
| 202 | + TA: EnzymeTypeAnalysisRef, |
| 203 | + returnUsed: u8, |
| 204 | + shadowReturnUsed: u8, |
| 205 | + typeInfo: CFnTypeInfo, |
| 206 | + _uncacheable_args: *mut u8, |
| 207 | + uncacheable_args_size: size_t, |
| 208 | + forceAnonymousTape: u8, |
| 209 | + width: ::std::os::raw::c_uint, |
| 210 | + AtomicAdd: u8, |
| 211 | + ) -> EnzymeAugmentedReturnPtr; |
| 212 | +} |
| 213 | +pub type CustomRuleType = ::std::option::Option< |
| 214 | + unsafe extern "C" fn( |
| 215 | + arg1: ::std::os::raw::c_int, |
| 216 | + arg2: CTypeTreeRef, |
| 217 | + arg3: *mut CTypeTreeRef, |
| 218 | + arg4: *mut IntList, |
| 219 | + arg5: size_t, |
| 220 | + arg6: LLVMValueRef, |
| 221 | + ) -> u8, |
| 222 | +>; |
| 223 | +extern "C" { |
| 224 | + pub fn CreateTypeAnalysis( |
| 225 | + Log: EnzymeLogicRef, |
| 226 | + customRuleNames: *mut *mut ::std::os::raw::c_char, |
| 227 | + customRules: *mut CustomRuleType, |
| 228 | + numRules: size_t, |
| 229 | + ) -> EnzymeTypeAnalysisRef; |
| 230 | +} |
| 231 | +extern "C" { |
| 232 | + pub fn ClearTypeAnalysis(arg1: EnzymeTypeAnalysisRef); |
| 233 | +} |
| 234 | +extern "C" { |
| 235 | + pub fn FreeTypeAnalysis(arg1: EnzymeTypeAnalysisRef); |
| 236 | +} |
| 237 | +extern "C" { |
| 238 | + pub fn CreateEnzymeLogic(PostOpt: u8) -> EnzymeLogicRef; |
| 239 | +} |
| 240 | +extern "C" { |
| 241 | + pub fn ClearEnzymeLogic(arg1: EnzymeLogicRef); |
| 242 | +} |
| 243 | +extern "C" { |
| 244 | + pub fn FreeEnzymeLogic(arg1: EnzymeLogicRef); |
| 245 | +} |
0 commit comments