Path Tracing
Loading...
Searching...
No Matches
oidn.h
Go to the documentation of this file.
1// Copyright 2018 Intel Corporation
2// SPDX-License-Identifier: Apache-2.0
3
4#pragma once
5
6#include <stddef.h>
7#include <stdbool.h>
8#include <stdint.h>
9
10#include "config.h"
11
12#if defined(__cplusplus)
13 #if defined(SYCL_LANGUAGE_VERSION)
14 #include <sycl/sycl.hpp>
15 #define OIDN_SYCL_HPP
16 #elif defined(SYCL_FEATURE_SET_FULL) || defined(SYCL_FEATURE_SET_REDUCED)
17 #define OIDN_SYCL_HPP // not using a SYCL compiler but SYCL headers are included
18 #else
19 namespace sycl
20 {
21 class device;
22 class queue;
23 class event;
24 }
25 #endif
26#endif
27
28typedef struct CUstream_st* cudaStream_t;
29typedef struct ihipStream_t* hipStream_t;
30
31#if defined(__OBJC__)
32 @protocol MTLDevice;
33 @protocol MTLCommandQueue;
34 @protocol MTLBuffer;
35
36 typedef id<MTLDevice> MTLDevice_id;
37 typedef id<MTLCommandQueue> MTLCommandQueue_id;
38 typedef id<MTLBuffer> MTLBuffer_id;
39#else
40 typedef void* MTLDevice_id;
41 typedef void* MTLCommandQueue_id;
42 typedef void* MTLBuffer_id;
43#endif
44
46
47typedef unsigned int OIDNFlags;
48
49// -------------------------------------------------------------------------------------------------
50// Physical Device
51// -------------------------------------------------------------------------------------------------
52
53#define OIDN_UUID_SIZE 16u // size of a universally unique identifier (UUID) of a physical device
54#define OIDN_LUID_SIZE 8u // size of a locally unique identifier (LUID) of a physical device
55
56// Returns the number of supported physical devices.
58
59// Gets a boolean parameter of the physical device.
60OIDN_API bool oidnGetPhysicalDeviceBool(int physicalDeviceID, const char* name);
61
62// Gets an integer parameter of the physical device.
63OIDN_API int oidnGetPhysicalDeviceInt(int physicalDeviceID, const char* name);
64
65// Gets an unsigned integer parameter of the physical device.
66inline unsigned int oidnGetPhysicalDeviceUInt(int physicalDeviceID, const char* name)
67{
68 return (unsigned int)oidnGetPhysicalDeviceInt(physicalDeviceID, name);
69}
70
71// Gets a string parameter of the physical device.
72OIDN_API const char* oidnGetPhysicalDeviceString(int physicalDeviceID, const char* name);
73
74// Gets an opaque data parameter of the physical device.
75OIDN_API const void* oidnGetPhysicalDeviceData(int physicalDeviceID, const char* name,
76 size_t* byteSize);
77
78// -------------------------------------------------------------------------------------------------
79// Device
80// -------------------------------------------------------------------------------------------------
81
82// Device types
83typedef enum
84{
85 OIDN_DEVICE_TYPE_DEFAULT = 0, // select device automatically
86
87 OIDN_DEVICE_TYPE_CPU = 1, // CPU device
88 OIDN_DEVICE_TYPE_SYCL = 2, // SYCL device
89 OIDN_DEVICE_TYPE_CUDA = 3, // CUDA device
90 OIDN_DEVICE_TYPE_HIP = 4, // HIP device
91 OIDN_DEVICE_TYPE_METAL = 5, // Metal device
93
94// Error codes
95typedef enum
96{
97 OIDN_ERROR_NONE = 0, // no error occurred
98 OIDN_ERROR_UNKNOWN = 1, // an unknown error occurred
99 OIDN_ERROR_INVALID_ARGUMENT = 2, // an invalid argument was specified
100 OIDN_ERROR_INVALID_OPERATION = 3, // the operation is not allowed
101 OIDN_ERROR_OUT_OF_MEMORY = 4, // not enough memory to execute the operation
102 OIDN_ERROR_UNSUPPORTED_HARDWARE = 5, // the hardware (e.g. CPU) is not supported
103 OIDN_ERROR_CANCELLED = 6, // the operation was cancelled by the user
104} OIDNError;
105
106// Error callback function
107typedef void (*OIDNErrorFunction)(void* userPtr, OIDNError code, const char* message);
108
109// Device handle
110typedef struct OIDNDeviceImpl* OIDNDevice;
111
112// Returns whether the CPU device is supported.
114
115#if defined(__cplusplus)
116// Returns whether the specified SYCL device is supported.
117OIDN_API bool oidnIsSYCLDeviceSupported(const sycl::device* device);
118#endif
119
120// Returns whether the specified CUDA device is supported.
122
123// Returns whether the specified HIP device is supported.
125
126// Returns whether the specified Metal device is supported.
128
129// Creates a device of the specified type.
131
132// Creates a device from a physical device specified by its ID (0 to oidnGetNumPhysicalDevices()-1).
134
135// Creates a device from a physical device specified by its UUID.
137
138// Creates a device from a physical device specified by its LUID.
140
141// Creates a device from a physical device specified by its PCI address.
142OIDN_API OIDNDevice oidnNewDeviceByPCIAddress(int pciDomain, int pciBus, int pciDevice,
143 int pciFunction);
144
145#if defined(__cplusplus)
146// Creates a device from the specified list of SYCL queues.
147// The queues should belong to different SYCL sub-devices (Xe Stack/Tile) of the same SYCL
148// root-device (GPU).
149OIDN_API OIDNDevice oidnNewSYCLDevice(const sycl::queue* queues, int numQueues);
150#endif
151
152// Creates a device from the specified pairs of CUDA device IDs and streams (null stream
153// corresponds to the default stream). Currently only one device ID/stream is supported.
154OIDN_API OIDNDevice oidnNewCUDADevice(const int* deviceIDs, const cudaStream_t* streams,
155 int numPairs);
156
157// Creates a device from the specified pairs of HIP device IDs and streams (null stream
158// corresponds to the default stream). Currently only one device ID/stream is supported.
159OIDN_API OIDNDevice oidnNewHIPDevice(const int* deviceIDs, const hipStream_t* streams,
160 int numPairs);
161
162// Creates a device from the specified list of Metal command queues.
163// Currently only one queue is supported.
164OIDN_API OIDNDevice oidnNewMetalDevice(const MTLCommandQueue_id* commandQueues, int numQueues);
165
166// Retains the device (increments the reference count).
168
169// Releases the device (decrements the reference count).
171
172// Sets a boolean parameter of the device.
173OIDN_API void oidnSetDeviceBool(OIDNDevice device, const char* name, bool value);
174
175OIDN_DEPRECATED("oidnSetDevice1b is deprecated. Use oidnSetDeviceBool instead.")
176inline void oidnSetDevice1b(OIDNDevice device, const char* name, bool value)
177{
178 oidnSetDeviceBool(device, name, value);
179}
180
181// Sets an integer parameter of the device.
182OIDN_API void oidnSetDeviceInt(OIDNDevice device, const char* name, int value);
183
184OIDN_DEPRECATED("oidnSetDevice1i is deprecated. Use oidnSetDeviceInt instead.")
185inline void oidnSetDevice1i(OIDNDevice device, const char* name, int value)
186{
187 oidnSetDeviceInt(device, name, value);
188}
189
190// Sets an unsigned integer parameter of the device.
191inline void oidnSetDeviceUInt(OIDNDevice device, const char* name, unsigned int value)
192{
193 oidnSetDeviceInt(device, name, (int)value);
194}
195
196// Gets a boolean parameter of the device.
197OIDN_API bool oidnGetDeviceBool(OIDNDevice device, const char* name);
198
199OIDN_DEPRECATED("oidnGetDevice1b is deprecated. Use oidnGetDeviceBool instead.")
200inline bool oidnGetDevice1b(OIDNDevice device, const char* name)
201{
202 return oidnGetDeviceBool(device, name);
203}
204
205// Gets an integer parameter of the device.
206OIDN_API int oidnGetDeviceInt(OIDNDevice device, const char* name);
207
208// Gets an unsigned integer parameter of the device.
209inline unsigned int oidnGetDeviceUInt(OIDNDevice device, const char* name)
210{
211 return (unsigned int)oidnGetDeviceInt(device, name);
212}
213
214OIDN_DEPRECATED("oidnGetDevice1i is deprecated. Use oidnGetDeviceInt instead.")
215inline int oidnGetDevice1i(OIDNDevice device, const char* name)
216{
217 return oidnGetDeviceInt(device, name);
218}
219
220// Sets the error callback function of the device.
222
223// Returns the first unqueried error code stored in the device for the current thread, optionally
224// also returning a string message (if not null), and clears the stored error. Can be called with
225// a null device as well to check for per-thread global errors (e.g. why a device creation or
226// physical device query has failed).
227OIDN_API OIDNError oidnGetDeviceError(OIDNDevice device, const char** outMessage);
228
229// Commits all previous changes to the device.
230// Must be called before first using the device (e.g. creating filters).
232
233// Waits for all asynchronous operations running on the device to complete.
235
236// -------------------------------------------------------------------------------------------------
237// Buffer
238// -------------------------------------------------------------------------------------------------
239
240// Formats for images and other data stored in buffers
241typedef enum
242{
244
245 // 32-bit single-precision floating-point scalar and vector formats
250
251 // 16-bit half-precision floating-point scalar and vector formats
256} OIDNFormat;
257
258// Storage modes for buffers
259typedef enum
260{
262
263 // stored on the host, accessible by both host and device
265
266 // stored on the device, *not* accessible by the host
268
269 // automatically migrated between host and device, accessible by both
270 // *not* supported by all devices, "managedMemorySupported" device parameter should be checked
273
274// External memory type flags
275typedef enum
276{
278
279 // opaque POSIX file descriptor handle
281
282 // file descriptor handle for a Linux dma_buf
284
285 // opaque NT handle
287
288 // opaque global share (KMT) handle
290
291 // NT handle returned by IDXGIResource1::CreateSharedHandle referring to a Direct3D 11 texture
292 // resource
294
295 // global share (KMT) handle returned by IDXGIResource::GetSharedHandle referring to a Direct3D 11
296 // texture resource
298
299 // NT handle returned by IDXGIResource1::CreateSharedHandle referring to a Direct3D 11 resource
301
302 // global share (KMT) handle returned by IDXGIResource::GetSharedHandle referring to a Direct3D 11
303 // resource
305
306 // NT handle returned by ID3D12Device::CreateSharedHandle referring to a Direct3D 12 heap
307 // resource
309
310 // NT handle returned by ID3D12Device::CreateSharedHandle referring to a Direct3D 12 committed
311 // resource
313
314 // modifier flag indicating that the external memory has dedicated allocation
315 // used only in combination with one of handle type flags above
318
320
321// Buffer handle
322typedef struct OIDNBufferImpl* OIDNBuffer;
323
324// Creates a buffer accessible to both the host and device.
326
327// Creates a buffer with the specified storage mode.
329
330// Creates a shared buffer from memory allocated and owned by the user and accessible to the device.
331OIDN_API OIDNBuffer oidnNewSharedBuffer(OIDNDevice device, void* devPtr, size_t byteSize);
332
333// Creates a shared buffer by importing external memory from a POSIX file descriptor.
336 int fd, size_t byteSize);
337
338// Creates a shared buffer by importing external memory from a Win32 handle.
341 void* handle, const void* name, size_t byteSize);
342
343// Creates a shared buffer from a Metal buffer.
344// Only buffers with shared or private storage and hazard tracking are supported.
346
347// Gets the size of the buffer in bytes.
349
350// Gets the storage mode of the buffer.
352
353// Gets a pointer to the buffer data, which is accessible to the device but not necessarily to
354// the host as well, depending on the storage mode. Null pointer may be returned if the buffer
355// is empty or getting a pointer to data with device storage is not supported by the device.
357
358// Copies data from a region of the buffer to host memory.
359OIDN_API void oidnReadBuffer(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, void* dstHostPtr);
360
361// Copies data from a region of the buffer to host memory asynchronously.
363 size_t byteOffset, size_t byteSize, void* dstHostPtr);
364
365// Copies data to a region of the buffer from host memory.
367 size_t byteOffset, size_t byteSize, const void* srcHostPtr);
368
369// Copies data to a region of the buffer from host memory asynchronously.
371 size_t byteOffset, size_t byteSize, const void* srcHostPtr);
372
373// Retains the buffer (increments the reference count).
375
376// Releases the buffer (decrements the reference count).
378
379// -------------------------------------------------------------------------------------------------
380// Semaphore
381// -------------------------------------------------------------------------------------------------
382
383// External semaphore type flags
384typedef enum
385{
387
388 // opaque POSIX file descriptor handle
390
391 // opaque NT handle
393
394 // opaque global share (KMT) handle
396
397 // NT handle referencing a Direct3D 11 fence object
399
400 // NT handle referencing a Direct3D 12 fence object
402
403 // NT handle referencing a Direct3D 11 keyed mutex object
405
406 // global share (KMT) handle referencing a Direct3D 11 keyed mutex object
408
409 // POSIX file descriptor referencing a timeline semaphore
411
412 // NT handle referencing a timeline semaphore
415
417
418// Semaphore handle
419typedef struct OIDNSemaphoreImpl* OIDNSemaphore;
420
421// Creates a shared semaphore by importing an external semaphore from a POSIX file descriptor.
424 int fd);
425
426// Creates a shared semaphore by importing an external semaphore from a Win32 handle.
429 void* handle, const void* name);
430
431// Signals semaphores using optionally specified values/keys (required only for certain semaphore
432// types, otherwise may be null) asynchronously.
434 const OIDNSemaphore* semaphores,
435 const uint64_t* values,
436 int numSemaphores);
437
438// Waits on semaphores using optionally specified values/keys and timeouts in milliseconds (required
439// only for certain semaphore types, otherwise may be null) asynchronously.
441 const OIDNSemaphore* semaphores,
442 const uint64_t* values,
443 const uint32_t* timeoutsMs,
444 int numSemaphores);
445
446// Retains the semaphore (increments the reference count).
448
449// Releases the semaphore (decrements the reference count).
451
452// -------------------------------------------------------------------------------------------------
453// Filter
454// -------------------------------------------------------------------------------------------------
455
456// Filter quality/performance modes
457typedef enum
458{
459 OIDN_QUALITY_DEFAULT = 0, // default quality
460
461 OIDN_QUALITY_FAST = 4, // high performance (for interactive/real-time preview rendering)
462 OIDN_QUALITY_BALANCED = 5, // balanced quality/performance (for interactive/real-time rendering)
463 OIDN_QUALITY_HIGH = 6, // high quality (for final-frame rendering)
465
466// Progress monitor callback function
467typedef bool (*OIDNProgressMonitorFunction)(void* userPtr, double n);
468
469// Filter handle
470typedef struct OIDNFilterImpl* OIDNFilter;
471
472// Creates a filter of the specified type (e.g. "RT").
474
475// Retains the filter (increments the reference count).
477
478// Releases the filter (decrements the reference count).
480
481// Sets an image parameter of the filter with data stored in a buffer.
482// If pixelByteStride and/or rowByteStride are zero, these will be computed automatically.
485 size_t width, size_t height,
486 size_t byteOffset,
487 size_t pixelByteStride, size_t rowByteStride);
488
489// Sets an image parameter of the filter with data owned by the user and accessible to the device.
490// If pixelByteStride and/or rowByteStride are zero, these will be computed automatically.
492 void* devPtr, OIDNFormat format,
493 size_t width, size_t height,
494 size_t byteOffset,
495 size_t pixelByteStride, size_t rowByteStride);
496
497// Unsets an image parameter of the filter that was previously set.
499
500OIDN_DEPRECATED("oidnRemoveFilterImage is deprecated. Use oidnUnsetFilterImage instead.")
501inline void oidnRemoveFilterImage(OIDNFilter filter, const char* name)
502{
503 oidnUnsetFilterImage(filter, name);
504}
505
506// Sets an opaque data parameter of the filter owned by the user and accessible to the host.
508 void* hostPtr, size_t byteSize);
509
510// Notifies the filter that the contents of an opaque data parameter has been changed.
512
513// Unsets an opaque data parameter of the filter that was previously set.
514OIDN_API void oidnUnsetFilterData(OIDNFilter filter, const char* name);
515
516OIDN_DEPRECATED("oidnRemoveFilterData is deprecated. Use oidnUnsetFilterData instead.")
517inline void oidnRemoveFilterData(OIDNFilter filter, const char* name)
518{
519 oidnUnsetFilterData(filter, name);
520}
521
522// Sets a boolean parameter of the filter.
523OIDN_API void oidnSetFilterBool(OIDNFilter filter, const char* name, bool value);
524
525OIDN_DEPRECATED("oidnSetFilter1b is deprecated. Use oidnSetFilterBool instead.")
526inline void oidnSetFilter1b(OIDNFilter filter, const char* name, bool value)
527{
528 oidnSetFilterBool(filter, name, value);
529}
530
531// Gets a boolean parameter of the filter.
532OIDN_API bool oidnGetFilterBool(OIDNFilter filter, const char* name);
533
534OIDN_DEPRECATED("oidnGetFilter1b is deprecated. Use oidnGetFilterBool instead.")
535inline bool oidnGetFilter1b(OIDNFilter filter, const char* name)
536{
537 return oidnGetFilterBool(filter, name);
538}
539
540// Sets an integer parameter of the filter.
541OIDN_API void oidnSetFilterInt(OIDNFilter filter, const char* name, int value);
542
543OIDN_DEPRECATED("oidnSetFilter1i is deprecated. Use oidnSetFilterInt instead.")
544inline void oidnSetFilter1i(OIDNFilter filter, const char* name, int value)
545{
546 oidnSetFilterInt(filter, name, value);
547}
548
549// Gets an integer parameter of the filter.
550OIDN_API int oidnGetFilterInt(OIDNFilter filter, const char* name);
551
552OIDN_DEPRECATED("oidnGetFilter1i is deprecated. Use oidnGetFilterInt instead.")
553inline int oidnGetFilter1i(OIDNFilter filter, const char* name)
554{
555 return oidnGetFilterInt(filter, name);
556}
557
558// Sets a float parameter of the filter.
559OIDN_API void oidnSetFilterFloat(OIDNFilter filter, const char* name, float value);
560
561OIDN_DEPRECATED("oidnSetFilter1f is deprecated. Use oidnSetFilterFloat instead.")
562inline void oidnSetFilter1f(OIDNFilter filter, const char* name, float value)
563{
564 oidnSetFilterFloat(filter, name, value);
565}
566
567// Gets a float parameter of the filter.
568OIDN_API float oidnGetFilterFloat(OIDNFilter filter, const char* name);
569
570OIDN_DEPRECATED("oidnGetFilter1f is deprecated. Use oidnGetFilterFloat instead.")
571inline float oidnGetFilter1f(OIDNFilter filter, const char* name)
572{
573 return oidnGetFilterFloat(filter, name);
574}
575
576// Sets the progress monitor callback function of the filter.
578 OIDNProgressMonitorFunction func, void* userPtr);
579
580// Commits all previous changes to the filter.
581// Must be called before first executing the filter.
583
584// Executes the filter.
586
587// Executes the filter asynchronously.
589
590#if defined(__cplusplus)
591// Executes the filter of a SYCL device using the specified dependent events asynchronously, and
592// optionally returns an event for completion.
593OIDN_API void oidnExecuteSYCLFilterAsync(OIDNFilter filter,
594 const sycl::event* depEvents, int numDepEvents,
595 sycl::event* doneEvent);
596#endif
597
#define OIDN_API_NAMESPACE_END
Definition config.h:27
#define OIDN_API_NAMESPACE_BEGIN
Definition config.h:26
#define OIDN_API
Definition config.h:56
#define OIDN_DEPRECATED(msg)
Definition config.h:62
GLint GLsizei width
Definition imgui_impl_opengl3_loader.h:191
GLsizei GLboolean const GLfloat * value
Definition imgui_impl_opengl3_loader.h:330
GLuint buffer
Definition imgui_impl_opengl3_loader.h:274
const GLchar * name
Definition imgui_impl_opengl3_loader.h:317
GLint GLint GLsizei GLsizei GLint GLenum GLenum type
Definition imgui_impl_opengl3_loader.h:193
GLint GLsizei GLsizei height
Definition imgui_impl_opengl3_loader.h:191
GLint GLint GLsizei GLsizei GLint GLenum format
Definition imgui_impl_opengl3_loader.h:193
typedef void(APIENTRYP PFNGLPOLYGONMODEPROC)(GLenum face
OIDN_API void oidnReleaseFilter(OIDNFilter filter)
OIDN_API void oidnRetainDevice(OIDNDevice device)
OIDN_API OIDNError oidnGetDeviceError(OIDNDevice device, const char **outMessage)
OIDN_API const char * oidnGetPhysicalDeviceString(int physicalDeviceID, const char *name)
OIDN_API OIDNDevice oidnNewDeviceByLUID(const void *luid)
OIDN_API OIDNDevice oidnNewMetalDevice(const MTLCommandQueue_id *commandQueues, int numQueues)
OIDN_API void oidnReadBufferAsync(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, void *dstHostPtr)
unsigned int oidnGetDeviceUInt(OIDNDevice device, const char *name)
Definition oidn.h:209
struct ihipStream_t * hipStream_t
Definition oidn.h:29
OIDN_API OIDNFilter oidnNewFilter(OIDNDevice device, const char *type)
OIDN_API OIDNBuffer oidnNewSharedBufferFromWin32Handle(OIDNDevice device, OIDNExternalMemoryTypeFlags handleType, void *handle, const void *name, size_t byteSize)
OIDNQuality
Definition oidn.h:458
@ OIDN_QUALITY_HIGH
Definition oidn.h:463
@ OIDN_QUALITY_DEFAULT
Definition oidn.h:459
@ OIDN_QUALITY_FAST
Definition oidn.h:461
@ OIDN_QUALITY_BALANCED
Definition oidn.h:462
struct OIDNBufferImpl * OIDNBuffer
Definition oidn.h:322
OIDNExternalSemaphoreTypeFlag
Definition oidn.h:385
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_OPAQUE_FD
Definition oidn.h:389
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_KEYED_MUTEX_KMT
Definition oidn.h:407
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_NONE
Definition oidn.h:386
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_TIMELINE_SEMAPHORE_FD
Definition oidn.h:410
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_TIMELINE_SEMAPHORE_WIN32
Definition oidn.h:413
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_D3D12_FENCE
Definition oidn.h:401
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_D3D11_FENCE
Definition oidn.h:398
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_OPAQUE_WIN32
Definition oidn.h:392
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_KEYED_MUTEX
Definition oidn.h:404
@ OIDN_EXTERNAL_SEMAPHORE_TYPE_FLAG_OPAQUE_WIN32_KMT
Definition oidn.h:395
OIDN_API OIDNDevice oidnNewCUDADevice(const int *deviceIDs, const cudaStream_t *streams, int numPairs)
bool oidnGetDevice1b(OIDNDevice device, const char *name)
Definition oidn.h:200
void oidnSetFilter1f(OIDNFilter filter, const char *name, float value)
Definition oidn.h:562
OIDN_API OIDNDevice oidnNewHIPDevice(const int *deviceIDs, const hipStream_t *streams, int numPairs)
OIDN_API void oidnExecuteFilterAsync(OIDNFilter filter)
OIDN_API bool oidnIsCPUDeviceSupported()
OIDN_API void oidnSetDeviceInt(OIDNDevice device, const char *name, int value)
void oidnRemoveFilterImage(OIDNFilter filter, const char *name)
Definition oidn.h:501
OIDN_API bool oidnGetDeviceBool(OIDNDevice device, const char *name)
struct OIDNDeviceImpl * OIDNDevice
Definition oidn.h:110
OIDNFlags OIDNExternalSemaphoreTypeFlags
Definition oidn.h:416
OIDN_API int oidnGetPhysicalDeviceInt(int physicalDeviceID, const char *name)
OIDN_API_NAMESPACE_BEGIN typedef unsigned int OIDNFlags
Definition oidn.h:47
OIDNError
Definition oidn.h:96
@ OIDN_ERROR_UNKNOWN
Definition oidn.h:98
@ OIDN_ERROR_UNSUPPORTED_HARDWARE
Definition oidn.h:102
@ OIDN_ERROR_INVALID_OPERATION
Definition oidn.h:100
@ OIDN_ERROR_CANCELLED
Definition oidn.h:103
@ OIDN_ERROR_NONE
Definition oidn.h:97
@ OIDN_ERROR_OUT_OF_MEMORY
Definition oidn.h:101
@ OIDN_ERROR_INVALID_ARGUMENT
Definition oidn.h:99
int oidnGetDevice1i(OIDNDevice device, const char *name)
Definition oidn.h:215
OIDN_API OIDNSemaphore oidnNewSharedSemaphoreFromFD(OIDNDevice device, OIDNExternalSemaphoreTypeFlags fdType, int fd)
void oidnSetFilter1b(OIDNFilter filter, const char *name, bool value)
Definition oidn.h:526
OIDN_API void oidnSyncDevice(OIDNDevice device)
OIDN_API void oidnSetFilterBool(OIDNFilter filter, const char *name, bool value)
OIDN_API void oidnReadBuffer(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, void *dstHostPtr)
void * MTLBuffer_id
Definition oidn.h:42
OIDN_API void oidnSetFilterProgressMonitorFunction(OIDNFilter filter, OIDNProgressMonitorFunction func, void *userPtr)
OIDN_API void oidnSignalSemaphoresAsync(OIDNDevice device, const OIDNSemaphore *semaphores, const uint64_t *values, int numSemaphores)
void * MTLDevice_id
Definition oidn.h:40
OIDN_API int oidnGetFilterInt(OIDNFilter filter, const char *name)
OIDN_API void oidnSetDeviceBool(OIDNDevice device, const char *name, bool value)
OIDN_API void oidnRetainSemaphore(OIDNSemaphore semaphore)
OIDN_API OIDNDevice oidnNewDeviceByID(int physicalDeviceID)
OIDN_API void oidnUnsetFilterData(OIDNFilter filter, const char *name)
bool(* OIDNProgressMonitorFunction)(void *userPtr, double n)
Definition oidn.h:467
OIDNFlags OIDNExternalMemoryTypeFlags
Definition oidn.h:319
OIDNStorage
Definition oidn.h:260
@ OIDN_STORAGE_HOST
Definition oidn.h:264
@ OIDN_STORAGE_MANAGED
Definition oidn.h:271
@ OIDN_STORAGE_DEVICE
Definition oidn.h:267
@ OIDN_STORAGE_UNDEFINED
Definition oidn.h:261
OIDN_API bool oidnIsMetalDeviceSupported(MTLDevice_id device)
OIDN_API void oidnWaitSemaphoresAsync(OIDNDevice device, const OIDNSemaphore *semaphores, const uint64_t *values, const uint32_t *timeoutsMs, int numSemaphores)
OIDN_API int oidnGetNumPhysicalDevices()
OIDN_API void oidnUnsetFilterImage(OIDNFilter filter, const char *name)
OIDN_API size_t oidnGetBufferSize(OIDNBuffer buffer)
struct OIDNSemaphoreImpl * OIDNSemaphore
Definition oidn.h:419
OIDN_API OIDNBuffer oidnNewSharedBufferFromFD(OIDNDevice device, OIDNExternalMemoryTypeFlags fdType, int fd, size_t byteSize)
OIDN_API float oidnGetFilterFloat(OIDNFilter filter, const char *name)
OIDN_API void oidnSetFilterInt(OIDNFilter filter, const char *name, int value)
OIDN_API void oidnSetSharedFilterImage(OIDNFilter filter, const char *name, void *devPtr, OIDNFormat format, size_t width, size_t height, size_t byteOffset, size_t pixelByteStride, size_t rowByteStride)
OIDN_API OIDNDevice oidnNewDeviceByPCIAddress(int pciDomain, int pciBus, int pciDevice, int pciFunction)
OIDN_API OIDNBuffer oidnNewSharedBuffer(OIDNDevice device, void *devPtr, size_t byteSize)
float oidnGetFilter1f(OIDNFilter filter, const char *name)
Definition oidn.h:571
OIDN_API OIDNBuffer oidnNewSharedBufferFromMetal(OIDNDevice device, MTLBuffer_id buffer)
OIDN_API void oidnCommitFilter(OIDNFilter filter)
OIDN_API OIDNDevice oidnNewDevice(OIDNDeviceType type)
OIDN_API bool oidnIsHIPDeviceSupported(int deviceID)
unsigned int oidnGetPhysicalDeviceUInt(int physicalDeviceID, const char *name)
Definition oidn.h:66
void oidnSetDevice1i(OIDNDevice device, const char *name, int value)
Definition oidn.h:185
OIDNDeviceType
Definition oidn.h:84
@ OIDN_DEVICE_TYPE_CPU
Definition oidn.h:87
@ OIDN_DEVICE_TYPE_SYCL
Definition oidn.h:88
@ OIDN_DEVICE_TYPE_CUDA
Definition oidn.h:89
@ OIDN_DEVICE_TYPE_METAL
Definition oidn.h:91
@ OIDN_DEVICE_TYPE_HIP
Definition oidn.h:90
@ OIDN_DEVICE_TYPE_DEFAULT
Definition oidn.h:85
OIDN_API void oidnCommitDevice(OIDNDevice device)
struct OIDNFilterImpl * OIDNFilter
Definition oidn.h:470
OIDN_API void oidnWriteBufferAsync(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, const void *srcHostPtr)
OIDN_API OIDNBuffer oidnNewBuffer(OIDNDevice device, size_t byteSize)
OIDN_API OIDNBuffer oidnNewBufferWithStorage(OIDNDevice device, size_t byteSize, OIDNStorage storage)
OIDN_API void oidnSetFilterFloat(OIDNFilter filter, const char *name, float value)
void oidnSetDevice1b(OIDNDevice device, const char *name, bool value)
Definition oidn.h:176
OIDN_API OIDNStorage oidnGetBufferStorage(OIDNBuffer buffer)
OIDNFormat
Definition oidn.h:242
@ OIDN_FORMAT_FLOAT
Definition oidn.h:246
@ OIDN_FORMAT_FLOAT4
Definition oidn.h:249
@ OIDN_FORMAT_HALF
Definition oidn.h:252
@ OIDN_FORMAT_HALF4
Definition oidn.h:255
@ OIDN_FORMAT_UNDEFINED
Definition oidn.h:243
@ OIDN_FORMAT_FLOAT3
Definition oidn.h:248
@ OIDN_FORMAT_HALF2
Definition oidn.h:253
@ OIDN_FORMAT_FLOAT2
Definition oidn.h:247
@ OIDN_FORMAT_HALF3
Definition oidn.h:254
OIDN_API void oidnReleaseBuffer(OIDNBuffer buffer)
OIDN_API void oidnSetFilterImage(OIDNFilter filter, const char *name, OIDNBuffer buffer, OIDNFormat format, size_t width, size_t height, size_t byteOffset, size_t pixelByteStride, size_t rowByteStride)
OIDN_API OIDNDevice oidnNewDeviceByUUID(const void *uuid)
OIDN_API bool oidnGetPhysicalDeviceBool(int physicalDeviceID, const char *name)
OIDN_API void oidnExecuteFilter(OIDNFilter filter)
OIDN_API const void * oidnGetPhysicalDeviceData(int physicalDeviceID, const char *name, size_t *byteSize)
OIDN_API void oidnSetSharedFilterData(OIDNFilter filter, const char *name, void *hostPtr, size_t byteSize)
bool oidnGetFilter1b(OIDNFilter filter, const char *name)
Definition oidn.h:535
OIDN_API void oidnWriteBuffer(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, const void *srcHostPtr)
OIDN_API void oidnRetainFilter(OIDNFilter filter)
OIDN_API void oidnUpdateFilterData(OIDNFilter filter, const char *name)
struct CUstream_st * cudaStream_t
Definition oidn.h:28
void oidnRemoveFilterData(OIDNFilter filter, const char *name)
Definition oidn.h:517
OIDN_API bool oidnGetFilterBool(OIDNFilter filter, const char *name)
OIDN_API bool oidnIsCUDADeviceSupported(int deviceID)
OIDN_API void * oidnGetBufferData(OIDNBuffer buffer)
void * MTLCommandQueue_id
Definition oidn.h:41
void(* OIDNErrorFunction)(void *userPtr, OIDNError code, const char *message)
Definition oidn.h:107
void oidnSetFilter1i(OIDNFilter filter, const char *name, int value)
Definition oidn.h:544
OIDN_API OIDNSemaphore oidnNewSharedSemaphoreFromWin32Handle(OIDNDevice device, OIDNExternalSemaphoreTypeFlags handleType, void *handle, const void *name)
OIDN_API void oidnReleaseDevice(OIDNDevice device)
OIDN_API void oidnRetainBuffer(OIDNBuffer buffer)
OIDN_API void oidnReleaseSemaphore(OIDNSemaphore semaphore)
int oidnGetFilter1i(OIDNFilter filter, const char *name)
Definition oidn.h:553
OIDN_API void oidnSetDeviceErrorFunction(OIDNDevice device, OIDNErrorFunction func, void *userPtr)
OIDNExternalMemoryTypeFlag
Definition oidn.h:276
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_NONE
Definition oidn.h:277
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP
Definition oidn.h:308
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT
Definition oidn.h:289
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE
Definition oidn.h:312
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE_KMT
Definition oidn.h:304
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF
Definition oidn.h:283
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_FD
Definition oidn.h:280
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_DEDICATED
Definition oidn.h:316
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32
Definition oidn.h:286
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE
Definition oidn.h:293
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE_KMT
Definition oidn.h:297
@ OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE
Definition oidn.h:300
void oidnSetDeviceUInt(OIDNDevice device, const char *name, unsigned int value)
Definition oidn.h:191
OIDN_API int oidnGetDeviceInt(OIDNDevice device, const char *name)