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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
/* automatically generated by rust-bindgen 0.69.4 */

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUstream_st {
    _unused: [u8; 0],
}
pub type cudaStream_t = *mut CUstream_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ihipStream_t {
    _unused: [u8; 0],
}
pub type hipStream_t = *mut ihipStream_t;
pub type MTLCommandQueue_id = *mut ::std::os::raw::c_void;
pub type MTLBuffer_id = *mut ::std::os::raw::c_void;
extern "C" {
    pub fn oidnGetNumPhysicalDevices() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn oidnGetPhysicalDeviceBool(
        physicalDeviceID: ::std::os::raw::c_int,
        name: *const ::std::os::raw::c_char,
    ) -> bool;
}
extern "C" {
    pub fn oidnGetPhysicalDeviceInt(
        physicalDeviceID: ::std::os::raw::c_int,
        name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn oidnGetPhysicalDeviceString(
        physicalDeviceID: ::std::os::raw::c_int,
        name: *const ::std::os::raw::c_char,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn oidnGetPhysicalDeviceData(
        physicalDeviceID: ::std::os::raw::c_int,
        name: *const ::std::os::raw::c_char,
        byteSize: *mut usize,
    ) -> *const ::std::os::raw::c_void;
}
pub const OIDNDeviceType_OIDN_DEVICE_TYPE_DEFAULT: OIDNDeviceType = 0;
pub const OIDNDeviceType_OIDN_DEVICE_TYPE_CPU: OIDNDeviceType = 1;
pub const OIDNDeviceType_OIDN_DEVICE_TYPE_SYCL: OIDNDeviceType = 2;
pub const OIDNDeviceType_OIDN_DEVICE_TYPE_CUDA: OIDNDeviceType = 3;
pub const OIDNDeviceType_OIDN_DEVICE_TYPE_HIP: OIDNDeviceType = 4;
pub const OIDNDeviceType_OIDN_DEVICE_TYPE_METAL: OIDNDeviceType = 5;
pub type OIDNDeviceType = ::std::os::raw::c_uint;
pub const OIDNError_OIDN_ERROR_NONE: OIDNError = 0;
pub const OIDNError_OIDN_ERROR_UNKNOWN: OIDNError = 1;
pub const OIDNError_OIDN_ERROR_INVALID_ARGUMENT: OIDNError = 2;
pub const OIDNError_OIDN_ERROR_INVALID_OPERATION: OIDNError = 3;
pub const OIDNError_OIDN_ERROR_OUT_OF_MEMORY: OIDNError = 4;
pub const OIDNError_OIDN_ERROR_UNSUPPORTED_HARDWARE: OIDNError = 5;
pub const OIDNError_OIDN_ERROR_CANCELLED: OIDNError = 6;
pub type OIDNError = ::std::os::raw::c_uint;
pub type OIDNErrorFunction = ::std::option::Option<
    unsafe extern "C" fn(
        userPtr: *mut ::std::os::raw::c_void,
        code: OIDNError,
        message: *const ::std::os::raw::c_char,
    ),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OIDNDeviceImpl {
    _unused: [u8; 0],
}
pub type OIDNDevice = *mut OIDNDeviceImpl;
extern "C" {
    pub fn oidnNewDevice(type_: OIDNDeviceType) -> OIDNDevice;
}
extern "C" {
    pub fn oidnNewDeviceByID(physicalDeviceID: ::std::os::raw::c_int) -> OIDNDevice;
}
extern "C" {
    pub fn oidnNewDeviceByUUID(uuid: *const ::std::os::raw::c_void) -> OIDNDevice;
}
extern "C" {
    pub fn oidnNewDeviceByLUID(luid: *const ::std::os::raw::c_void) -> OIDNDevice;
}
extern "C" {
    pub fn oidnNewDeviceByPCIAddress(
        pciDomain: ::std::os::raw::c_int,
        pciBus: ::std::os::raw::c_int,
        pciDevice: ::std::os::raw::c_int,
        pciFunction: ::std::os::raw::c_int,
    ) -> OIDNDevice;
}
extern "C" {
    pub fn oidnNewCUDADevice(
        deviceIDs: *const ::std::os::raw::c_int,
        streams: *const cudaStream_t,
        numPairs: ::std::os::raw::c_int,
    ) -> OIDNDevice;
}
extern "C" {
    pub fn oidnNewHIPDevice(
        deviceIDs: *const ::std::os::raw::c_int,
        streams: *const hipStream_t,
        numPairs: ::std::os::raw::c_int,
    ) -> OIDNDevice;
}
extern "C" {
    pub fn oidnNewMetalDevice(
        commandQueues: *const MTLCommandQueue_id,
        numQueues: ::std::os::raw::c_int,
    ) -> OIDNDevice;
}
extern "C" {
    pub fn oidnRetainDevice(device: OIDNDevice);
}
extern "C" {
    pub fn oidnReleaseDevice(device: OIDNDevice);
}
extern "C" {
    pub fn oidnSetDeviceBool(device: OIDNDevice, name: *const ::std::os::raw::c_char, value: bool);
}
extern "C" {
    pub fn oidnSetDeviceInt(
        device: OIDNDevice,
        name: *const ::std::os::raw::c_char,
        value: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn oidnGetDeviceBool(device: OIDNDevice, name: *const ::std::os::raw::c_char) -> bool;
}
extern "C" {
    pub fn oidnGetDeviceInt(
        device: OIDNDevice,
        name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn oidnSetDeviceErrorFunction(
        device: OIDNDevice,
        func: OIDNErrorFunction,
        userPtr: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn oidnGetDeviceError(
        device: OIDNDevice,
        outMessage: *mut *const ::std::os::raw::c_char,
    ) -> OIDNError;
}
extern "C" {
    pub fn oidnCommitDevice(device: OIDNDevice);
}
extern "C" {
    pub fn oidnSyncDevice(device: OIDNDevice);
}
pub const OIDNFormat_OIDN_FORMAT_UNDEFINED: OIDNFormat = 0;
pub const OIDNFormat_OIDN_FORMAT_FLOAT: OIDNFormat = 1;
pub const OIDNFormat_OIDN_FORMAT_FLOAT2: OIDNFormat = 2;
pub const OIDNFormat_OIDN_FORMAT_FLOAT3: OIDNFormat = 3;
pub const OIDNFormat_OIDN_FORMAT_FLOAT4: OIDNFormat = 4;
pub const OIDNFormat_OIDN_FORMAT_HALF: OIDNFormat = 257;
pub const OIDNFormat_OIDN_FORMAT_HALF2: OIDNFormat = 258;
pub const OIDNFormat_OIDN_FORMAT_HALF3: OIDNFormat = 259;
pub const OIDNFormat_OIDN_FORMAT_HALF4: OIDNFormat = 260;
pub type OIDNFormat = ::std::os::raw::c_uint;
pub const OIDNStorage_OIDN_STORAGE_UNDEFINED: OIDNStorage = 0;
pub const OIDNStorage_OIDN_STORAGE_HOST: OIDNStorage = 1;
pub const OIDNStorage_OIDN_STORAGE_DEVICE: OIDNStorage = 2;
pub const OIDNStorage_OIDN_STORAGE_MANAGED: OIDNStorage = 3;
pub type OIDNStorage = ::std::os::raw::c_uint;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_NONE:
    OIDNExternalMemoryTypeFlag = 0;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_FD:
    OIDNExternalMemoryTypeFlag = 1;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF:
    OIDNExternalMemoryTypeFlag = 2;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32:
    OIDNExternalMemoryTypeFlag = 4;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT:
    OIDNExternalMemoryTypeFlag = 8;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE:
    OIDNExternalMemoryTypeFlag = 16;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE_KMT:
    OIDNExternalMemoryTypeFlag = 32;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE:
    OIDNExternalMemoryTypeFlag = 64;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE_KMT:
    OIDNExternalMemoryTypeFlag = 128;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP:
    OIDNExternalMemoryTypeFlag = 256;
pub const OIDNExternalMemoryTypeFlag_OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE:
    OIDNExternalMemoryTypeFlag = 512;
pub type OIDNExternalMemoryTypeFlag = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OIDNBufferImpl {
    _unused: [u8; 0],
}
pub type OIDNBuffer = *mut OIDNBufferImpl;
extern "C" {
    pub fn oidnNewBuffer(device: OIDNDevice, byteSize: usize) -> OIDNBuffer;
}
extern "C" {
    pub fn oidnNewBufferWithStorage(
        device: OIDNDevice,
        byteSize: usize,
        storage: OIDNStorage,
    ) -> OIDNBuffer;
}
extern "C" {
    pub fn oidnNewSharedBuffer(
        device: OIDNDevice,
        devPtr: *mut ::std::os::raw::c_void,
        byteSize: usize,
    ) -> OIDNBuffer;
}
extern "C" {
    pub fn oidnNewSharedBufferFromFD(
        device: OIDNDevice,
        fdType: OIDNExternalMemoryTypeFlag,
        fd: ::std::os::raw::c_int,
        byteSize: usize,
    ) -> OIDNBuffer;
}
extern "C" {
    pub fn oidnNewSharedBufferFromWin32Handle(
        device: OIDNDevice,
        handleType: OIDNExternalMemoryTypeFlag,
        handle: *mut ::std::os::raw::c_void,
        name: *const ::std::os::raw::c_void,
        byteSize: usize,
    ) -> OIDNBuffer;
}
extern "C" {
    pub fn oidnNewSharedBufferFromMetal(device: OIDNDevice, buffer: MTLBuffer_id) -> OIDNBuffer;
}
extern "C" {
    pub fn oidnGetBufferSize(buffer: OIDNBuffer) -> usize;
}
extern "C" {
    pub fn oidnGetBufferStorage(buffer: OIDNBuffer) -> OIDNStorage;
}
extern "C" {
    pub fn oidnGetBufferData(buffer: OIDNBuffer) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn oidnReadBuffer(
        buffer: OIDNBuffer,
        byteOffset: usize,
        byteSize: usize,
        dstHostPtr: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn oidnReadBufferAsync(
        buffer: OIDNBuffer,
        byteOffset: usize,
        byteSize: usize,
        dstHostPtr: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn oidnWriteBuffer(
        buffer: OIDNBuffer,
        byteOffset: usize,
        byteSize: usize,
        srcHostPtr: *const ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn oidnWriteBufferAsync(
        buffer: OIDNBuffer,
        byteOffset: usize,
        byteSize: usize,
        srcHostPtr: *const ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn oidnRetainBuffer(buffer: OIDNBuffer);
}
extern "C" {
    pub fn oidnReleaseBuffer(buffer: OIDNBuffer);
}
pub const OIDNQuality_OIDN_QUALITY_DEFAULT: OIDNQuality = 0;
pub const OIDNQuality_OIDN_QUALITY_BALANCED: OIDNQuality = 5;
pub const OIDNQuality_OIDN_QUALITY_HIGH: OIDNQuality = 6;
pub type OIDNQuality = ::std::os::raw::c_uint;
pub type OIDNProgressMonitorFunction = ::std::option::Option<
    unsafe extern "C" fn(userPtr: *mut ::std::os::raw::c_void, n: f64) -> bool,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OIDNFilterImpl {
    _unused: [u8; 0],
}
pub type OIDNFilter = *mut OIDNFilterImpl;
extern "C" {
    pub fn oidnNewFilter(device: OIDNDevice, type_: *const ::std::os::raw::c_char) -> OIDNFilter;
}
extern "C" {
    pub fn oidnRetainFilter(filter: OIDNFilter);
}
extern "C" {
    pub fn oidnReleaseFilter(filter: OIDNFilter);
}
extern "C" {
    pub fn oidnSetFilterImage(
        filter: OIDNFilter,
        name: *const ::std::os::raw::c_char,
        buffer: OIDNBuffer,
        format: OIDNFormat,
        width: usize,
        height: usize,
        byteOffset: usize,
        pixelByteStride: usize,
        rowByteStride: usize,
    );
}
extern "C" {
    pub fn oidnSetSharedFilterImage(
        filter: OIDNFilter,
        name: *const ::std::os::raw::c_char,
        devPtr: *mut ::std::os::raw::c_void,
        format: OIDNFormat,
        width: usize,
        height: usize,
        byteOffset: usize,
        pixelByteStride: usize,
        rowByteStride: usize,
    );
}
extern "C" {
    pub fn oidnUnsetFilterImage(filter: OIDNFilter, name: *const ::std::os::raw::c_char);
}
extern "C" {
    pub fn oidnSetSharedFilterData(
        filter: OIDNFilter,
        name: *const ::std::os::raw::c_char,
        hostPtr: *mut ::std::os::raw::c_void,
        byteSize: usize,
    );
}
extern "C" {
    pub fn oidnUpdateFilterData(filter: OIDNFilter, name: *const ::std::os::raw::c_char);
}
extern "C" {
    pub fn oidnUnsetFilterData(filter: OIDNFilter, name: *const ::std::os::raw::c_char);
}
extern "C" {
    pub fn oidnSetFilterBool(filter: OIDNFilter, name: *const ::std::os::raw::c_char, value: bool);
}
extern "C" {
    pub fn oidnGetFilterBool(filter: OIDNFilter, name: *const ::std::os::raw::c_char) -> bool;
}
extern "C" {
    pub fn oidnSetFilterInt(
        filter: OIDNFilter,
        name: *const ::std::os::raw::c_char,
        value: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn oidnGetFilterInt(
        filter: OIDNFilter,
        name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn oidnSetFilterFloat(filter: OIDNFilter, name: *const ::std::os::raw::c_char, value: f32);
}
extern "C" {
    pub fn oidnGetFilterFloat(filter: OIDNFilter, name: *const ::std::os::raw::c_char) -> f32;
}
extern "C" {
    pub fn oidnSetFilterProgressMonitorFunction(
        filter: OIDNFilter,
        func: OIDNProgressMonitorFunction,
        userPtr: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn oidnCommitFilter(filter: OIDNFilter);
}
extern "C" {
    pub fn oidnExecuteFilter(filter: OIDNFilter);
}
extern "C" {
    pub fn oidnExecuteFilterAsync(filter: OIDNFilter);
}