HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
28 typedef struct CUstream_st* cudaStream_t;
29 typedef struct ihipStream_t* hipStream_t;
30 
31 #if defined(__OBJC__)
32  @protocol MTLDevice;
33  @protocol MTLCommandQueue;
34  @protocol MTLBuffer;
35 
39 #else
40  typedef void* MTLDevice_id;
41  typedef void* MTLCommandQueue_id;
42  typedef void* MTLBuffer_id;
43 #endif
44 
46 
47 // -------------------------------------------------------------------------------------------------
48 // Physical Device
49 // -------------------------------------------------------------------------------------------------
50 
51 #define OIDN_UUID_SIZE 16u // size of a universally unique identifier (UUID) of a physical device
52 #define OIDN_LUID_SIZE 8u // size of a locally unique identifier (LUID) of a physical device
53 
54 // Returns the number of supported physical devices.
56 
57 // Gets a boolean parameter of the physical device.
58 OIDN_API bool oidnGetPhysicalDeviceBool(int physicalDeviceID, const char* name);
59 
60 // Gets an integer parameter of the physical device.
61 OIDN_API int oidnGetPhysicalDeviceInt(int physicalDeviceID, const char* name);
62 
63 // Gets an unsigned integer parameter of the physical device.
64 inline unsigned int oidnGetPhysicalDeviceUInt(int physicalDeviceID, const char* name)
65 {
66  return (unsigned int)oidnGetPhysicalDeviceInt(physicalDeviceID, name);
67 }
68 
69 // Gets a string parameter of the physical device.
70 OIDN_API const char* oidnGetPhysicalDeviceString(int physicalDeviceID, const char* name);
71 
72 // Gets an opaque data parameter of the physical device.
73 OIDN_API const void* oidnGetPhysicalDeviceData(int physicalDeviceID, const char* name,
74  size_t* byteSize);
75 
76 // -------------------------------------------------------------------------------------------------
77 // Device
78 // -------------------------------------------------------------------------------------------------
79 
80 // Device types
81 typedef enum
82 {
83  OIDN_DEVICE_TYPE_DEFAULT = 0, // select device automatically
84 
85  OIDN_DEVICE_TYPE_CPU = 1, // CPU device
86  OIDN_DEVICE_TYPE_SYCL = 2, // SYCL device
87  OIDN_DEVICE_TYPE_CUDA = 3, // CUDA device
88  OIDN_DEVICE_TYPE_HIP = 4, // HIP device
89  OIDN_DEVICE_TYPE_METAL = 5, // Metal device
91 
92 // Error codes
93 typedef enum
94 {
95  OIDN_ERROR_NONE = 0, // no error occurred
96  OIDN_ERROR_UNKNOWN = 1, // an unknown error occurred
97  OIDN_ERROR_INVALID_ARGUMENT = 2, // an invalid argument was specified
98  OIDN_ERROR_INVALID_OPERATION = 3, // the operation is not allowed
99  OIDN_ERROR_OUT_OF_MEMORY = 4, // not enough memory to execute the operation
100  OIDN_ERROR_UNSUPPORTED_HARDWARE = 5, // the hardware (e.g. CPU) is not supported
101  OIDN_ERROR_CANCELLED = 6, // the operation was cancelled by the user
102 } OIDNError;
103 
104 // Error callback function
105 typedef void (*OIDNErrorFunction)(void* userPtr, OIDNError code, const char* message);
106 
107 // Device handle
108 typedef struct OIDNDeviceImpl* OIDNDevice;
109 
110 // Returns whether the CPU device is supported.
112 
113 #if defined(__cplusplus)
114 // Returns whether the specified SYCL device is supported.
115 OIDN_API bool oidnIsSYCLDeviceSupported(const sycl::device* device);
116 #endif
117 
118 // Returns whether the specified CUDA device is supported.
119 OIDN_API bool oidnIsCUDADeviceSupported(int deviceID);
120 
121 // Returns whether the specified HIP device is supported.
122 OIDN_API bool oidnIsHIPDeviceSupported(int deviceID);
123 
124 // Returns whether the specified Metal device is supported.
126 
127 // Creates a device of the specified type.
129 
130 // Creates a device from a physical device specified by its ID (0 to oidnGetNumPhysicalDevices()-1).
131 OIDN_API OIDNDevice oidnNewDeviceByID(int physicalDeviceID);
132 
133 // Creates a device from a physical device specified by its UUID.
134 OIDN_API OIDNDevice oidnNewDeviceByUUID(const void* uuid);
135 
136 // Creates a device from a physical device specified by its LUID.
137 OIDN_API OIDNDevice oidnNewDeviceByLUID(const void* luid);
138 
139 // Creates a device from a physical device specified by its PCI address.
140 OIDN_API OIDNDevice oidnNewDeviceByPCIAddress(int pciDomain, int pciBus, int pciDevice,
141  int pciFunction);
142 
143 #if defined(__cplusplus)
144 // Creates a device from the specified list of SYCL queues.
145 // The queues should belong to different SYCL sub-devices (Xe Stack/Tile) of the same SYCL
146 // root-device (GPU).
147 OIDN_API OIDNDevice oidnNewSYCLDevice(const sycl::queue* queues, int numQueues);
148 #endif
149 
150 // Creates a device from the specified pairs of CUDA device IDs and streams (null stream
151 // corresponds to the default stream). Currently only one device ID/stream is supported.
152 OIDN_API OIDNDevice oidnNewCUDADevice(const int* deviceIDs, const cudaStream_t* streams,
153  int numPairs);
154 
155 // Creates a device from the specified pairs of HIP device IDs and streams (null stream
156 // corresponds to the default stream). Currently only one device ID/stream is supported.
157 OIDN_API OIDNDevice oidnNewHIPDevice(const int* deviceIDs, const hipStream_t* streams,
158  int numPairs);
159 
160 // Creates a device from the specified list of Metal command queues.
161 // Currently only one queue is supported.
162 OIDN_API OIDNDevice oidnNewMetalDevice(const MTLCommandQueue_id* commandQueues, int numQueues);
163 
164 // Retains the device (increments the reference count).
166 
167 // Releases the device (decrements the reference count).
169 
170 // Sets a boolean parameter of the device.
171 OIDN_API void oidnSetDeviceBool(OIDNDevice device, const char* name, bool value);
172 
173 OIDN_DEPRECATED("oidnSetDevice1b is deprecated. Use oidnSetDeviceBool instead.")
174 inline void oidnSetDevice1b(OIDNDevice device, const char* name, bool value)
175 {
176  oidnSetDeviceBool(device, name, value);
177 }
178 
179 // Sets an integer parameter of the device.
180 OIDN_API void oidnSetDeviceInt(OIDNDevice device, const char* name, int value);
181 
182 OIDN_DEPRECATED("oidnSetDevice1i is deprecated. Use oidnSetDeviceInt instead.")
183 inline void oidnSetDevice1i(OIDNDevice device, const char* name, int value)
184 {
185  oidnSetDeviceInt(device, name, value);
186 }
187 
188 // Sets an unsigned integer parameter of the device.
189 inline void oidnSetDeviceUInt(OIDNDevice device, const char* name, unsigned int value)
190 {
191  oidnSetDeviceInt(device, name, (int)value);
192 }
193 
194 // Gets a boolean parameter of the device.
195 OIDN_API bool oidnGetDeviceBool(OIDNDevice device, const char* name);
196 
197 OIDN_DEPRECATED("oidnGetDevice1b is deprecated. Use oidnGetDeviceBool instead.")
198 inline bool oidnGetDevice1b(OIDNDevice device, const char* name)
199 {
200  return oidnGetDeviceBool(device, name);
201 }
202 
203 // Gets an integer parameter of the device.
204 OIDN_API int oidnGetDeviceInt(OIDNDevice device, const char* name);
205 
206 // Gets an unsigned integer parameter of the device.
207 inline unsigned int oidnGetDeviceUInt(OIDNDevice device, const char* name)
208 {
209  return (unsigned int)oidnGetDeviceInt(device, name);
210 }
211 
212 OIDN_DEPRECATED("oidnGetDevice1i is deprecated. Use oidnGetDeviceInt instead.")
213 inline int oidnGetDevice1i(OIDNDevice device, const char* name)
214 {
215  return oidnGetDeviceInt(device, name);
216 }
217 
218 // Sets the error callback function of the device.
220 
221 // Returns the first unqueried error code stored in the device for the current thread, optionally
222 // also returning a string message (if not NULL), and clears the stored error. Can be called with
223 // a NULL device as well to check for per-thread global errors (e.g. why a device creation or
224 // physical device query has failed).
225 OIDN_API OIDNError oidnGetDeviceError(OIDNDevice device, const char** outMessage);
226 
227 // Commits all previous changes to the device.
228 // Must be called before first using the device (e.g. creating filters).
230 
231 // Waits for all asynchronous operations running on the device to complete.
232 OIDN_API void oidnSyncDevice(OIDNDevice device);
233 
234 // -------------------------------------------------------------------------------------------------
235 // Buffer
236 // -------------------------------------------------------------------------------------------------
237 
238 // Formats for images and other data stored in buffers
239 typedef enum
240 {
242 
243  // 32-bit single-precision floating-point scalar and vector formats
248 
249  // 16-bit half-precision floating-point scalar and vector formats
254 } OIDNFormat;
255 
256 // Storage modes for buffers
257 typedef enum
258 {
260 
261  // stored on the host, accessible by both host and device
263 
264  // stored on the device, *not* accessible by the host
266 
267  // automatically migrated between host and device, accessible by both
268  // *not* supported by all devices, "managedMemorySupported" device parameter should be checked
270 } OIDNStorage;
271 
272 // External memory type flags
273 typedef enum
274 {
276 
277  // opaque POSIX file descriptor handle
279 
280  // file descriptor handle for a Linux dma_buf
282 
283  // NT handle
285 
286  // global share (KMT) handle
288 
289  // NT handle returned by IDXGIResource1::CreateSharedHandle referring to a Direct3D 11 texture
290  // resource
292 
293  // global share (KMT) handle returned by IDXGIResource::GetSharedHandle referring to a Direct3D 11
294  // texture resource
296 
297  // NT handle returned by IDXGIResource1::CreateSharedHandle referring to a Direct3D 11 resource
299 
300  // global share (KMT) handle returned by IDXGIResource::GetSharedHandle referring to a Direct3D 11
301  // resource
303 
304  // NT handle returned by ID3D12Device::CreateSharedHandle referring to a Direct3D 12 heap
305  // resource
307 
308  // NT handle returned by ID3D12Device::CreateSharedHandle referring to a Direct3D 12 committed
309  // resource
312 
313 // Buffer handle
314 typedef struct OIDNBufferImpl* OIDNBuffer;
315 
316 // Creates a buffer accessible to both the host and device.
317 OIDN_API OIDNBuffer oidnNewBuffer(OIDNDevice device, size_t byteSize);
318 
319 // Creates a buffer with the specified storage mode.
321 
322 // Creates a shared buffer from memory allocated and owned by the user and accessible to the device.
323 OIDN_API OIDNBuffer oidnNewSharedBuffer(OIDNDevice device, void* devPtr, size_t byteSize);
324 
325 // Creates a shared buffer by importing external memory from a POSIX file descriptor.
328  int fd, size_t byteSize);
329 
330 // Creates a shared buffer by importing external memory from a Win32 handle.
333  void* handle, const void* name, size_t byteSize);
334 
335 // Creates a shared buffer from a Metal buffer.
336 // Only buffers with shared or private storage and hazard tracking are supported.
338 
339 // Gets the size of the buffer in bytes.
341 
342 // Gets the storage mode of the buffer.
344 
345 // Gets a pointer to the buffer data, which is accessible to the device but not necessarily to
346 // the host as well, depending on the storage mode. Null pointer may be returned if the buffer
347 // is empty or getting a pointer to data with device storage is not supported by the device.
349 
350 // Copies data from a region of the buffer to host memory.
351 OIDN_API void oidnReadBuffer(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, void* dstHostPtr);
352 
353 // Copies data from a region of the buffer to host memory asynchronously.
355  size_t byteOffset, size_t byteSize, void* dstHostPtr);
356 
357 // Copies data to a region of the buffer from host memory.
359  size_t byteOffset, size_t byteSize, const void* srcHostPtr);
360 
361 // Copies data to a region of the buffer from host memory asynchronously.
363  size_t byteOffset, size_t byteSize, const void* srcHostPtr);
364 
365 // Retains the buffer (increments the reference count).
367 
368 // Releases the buffer (decrements the reference count).
370 
371 // -------------------------------------------------------------------------------------------------
372 // Filter
373 // -------------------------------------------------------------------------------------------------
374 
375 // Filter quality/performance modes
376 typedef enum
377 {
378  OIDN_QUALITY_DEFAULT = 0, // default quality
379 
380  OIDN_QUALITY_FAST = 4, // high performance (for interactive/real-time preview rendering)
381  OIDN_QUALITY_BALANCED = 5, // balanced quality/performance (for interactive/real-time rendering)
382  OIDN_QUALITY_HIGH = 6, // high quality (for final-frame rendering)
383 } OIDNQuality;
384 
385 // Progress monitor callback function
386 typedef bool (*OIDNProgressMonitorFunction)(void* userPtr, double n);
387 
388 // Filter handle
389 typedef struct OIDNFilterImpl* OIDNFilter;
390 
391 // Creates a filter of the specified type (e.g. "RT").
392 OIDN_API OIDNFilter oidnNewFilter(OIDNDevice device, const char* type);
393 
394 // Retains the filter (increments the reference count).
396 
397 // Releases the filter (decrements the reference count).
399 
400 // Sets an image parameter of the filter with data stored in a buffer.
401 // If pixelByteStride and/or rowByteStride are zero, these will be computed automatically.
404  size_t width, size_t height,
405  size_t byteOffset,
406  size_t pixelByteStride, size_t rowByteStride);
407 
408 // Sets an image parameter of the filter with data owned by the user and accessible to the device.
409 // If pixelByteStride and/or rowByteStride are zero, these will be computed automatically.
411  void* devPtr, OIDNFormat format,
412  size_t width, size_t height,
413  size_t byteOffset,
414  size_t pixelByteStride, size_t rowByteStride);
415 
416 // Unsets an image parameter of the filter that was previously set.
418 
419 OIDN_DEPRECATED("oidnRemoveFilterImage is deprecated. Use oidnUnsetFilterImage instead.")
420 inline void oidnRemoveFilterImage(OIDNFilter filter, const char* name)
421 {
422  oidnUnsetFilterImage(filter, name);
423 }
424 
425 // Sets an opaque data parameter of the filter owned by the user and accessible to the host.
427  void* hostPtr, size_t byteSize);
428 
429 // Notifies the filter that the contents of an opaque data parameter has been changed.
431 
432 // Unsets an opaque data parameter of the filter that was previously set.
434 
435 OIDN_DEPRECATED("oidnRemoveFilterData is deprecated. Use oidnUnsetFilterData instead.")
436 inline void oidnRemoveFilterData(OIDNFilter filter, const char* name)
437 {
438  oidnUnsetFilterData(filter, name);
439 }
440 
441 // Sets a boolean parameter of the filter.
442 OIDN_API void oidnSetFilterBool(OIDNFilter filter, const char* name, bool value);
443 
444 OIDN_DEPRECATED("oidnSetFilter1b is deprecated. Use oidnSetFilterBool instead.")
445 inline void oidnSetFilter1b(OIDNFilter filter, const char* name, bool value)
446 {
447  oidnSetFilterBool(filter, name, value);
448 }
449 
450 // Gets a boolean parameter of the filter.
451 OIDN_API bool oidnGetFilterBool(OIDNFilter filter, const char* name);
452 
453 OIDN_DEPRECATED("oidnGetFilter1b is deprecated. Use oidnGetFilterBool instead.")
454 inline bool oidnGetFilter1b(OIDNFilter filter, const char* name)
455 {
456  return oidnGetFilterBool(filter, name);
457 }
458 
459 // Sets an integer parameter of the filter.
460 OIDN_API void oidnSetFilterInt(OIDNFilter filter, const char* name, int value);
461 
462 OIDN_DEPRECATED("oidnSetFilter1i is deprecated. Use oidnSetFilterInt instead.")
463 inline void oidnSetFilter1i(OIDNFilter filter, const char* name, int value)
464 {
465  oidnSetFilterInt(filter, name, value);
466 }
467 
468 // Gets an integer parameter of the filter.
470 
471 OIDN_DEPRECATED("oidnGetFilter1i is deprecated. Use oidnGetFilterInt instead.")
472 inline int oidnGetFilter1i(OIDNFilter filter, const char* name)
473 {
474  return oidnGetFilterInt(filter, name);
475 }
476 
477 // Sets a float parameter of the filter.
478 OIDN_API void oidnSetFilterFloat(OIDNFilter filter, const char* name, float value);
479 
480 OIDN_DEPRECATED("oidnSetFilter1f is deprecated. Use oidnSetFilterFloat instead.")
481 inline void oidnSetFilter1f(OIDNFilter filter, const char* name, float value)
482 {
483  oidnSetFilterFloat(filter, name, value);
484 }
485 
486 // Gets a float parameter of the filter.
487 OIDN_API float oidnGetFilterFloat(OIDNFilter filter, const char* name);
488 
489 OIDN_DEPRECATED("oidnGetFilter1f is deprecated. Use oidnGetFilterFloat instead.")
490 inline float oidnGetFilter1f(OIDNFilter filter, const char* name)
491 {
492  return oidnGetFilterFloat(filter, name);
493 }
494 
495 // Sets the progress monitor callback function of the filter.
497  OIDNProgressMonitorFunction func, void* userPtr);
498 
499 // Commits all previous changes to the filter.
500 // Must be called before first executing the filter.
502 
503 // Executes the filter.
505 
506 // Executes the filter asynchronously.
508 
509 #if defined(__cplusplus)
510 // Executes the filter of a SYCL device using the specified dependent events asynchronously, and
511 // optionally returns an event for completion.
512 OIDN_API void oidnExecuteSYCLFilterAsync(OIDNFilter filter,
513  const sycl::event* depEvents, int numDepEvents,
514  sycl::event* doneEvent);
515 #endif
516 
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
OIDN_API void oidnSetDeviceInt(OIDNDevice device, const char *name, int value)
OIDN_API OIDNDevice oidnNewCUDADevice(const int *deviceIDs, const cudaStream_t *streams, int numPairs)
OIDN_API void oidnExecuteFilterAsync(OIDNFilter filter)
#define OIDN_API_NAMESPACE_BEGIN
Definition: config.h:25
OIDN_API OIDNBuffer oidnNewSharedBufferFromWin32Handle(OIDNDevice device, OIDNExternalMemoryTypeFlag handleType, void *handle, const void *name, size_t byteSize)
OIDN_API void oidnExecuteFilter(OIDNFilter filter)
OIDN_API void oidnReadBufferAsync(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, void *dstHostPtr)
OIDN_API void oidnReleaseDevice(OIDNDevice device)
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 void oidnReleaseFilter(OIDNFilter filter)
void
Definition: png.h:1083
getFileOption("OpenEXR:storage") storage
Definition: HDK_Image.dox:276
OIDN_API void oidnUnsetFilterImage(OIDNFilter filter, const char *name)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
OIDNFormat
Definition: oidn.h:239
OIDN_API bool oidnGetDeviceBool(OIDNDevice device, const char *name)
GLuint64 GLenum handleType
Definition: RE_OGL.h:262
int oidnGetFilter1i(OIDNFilter filter, const char *name)
Definition: oidn.h:472
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 void oidnSetFilterInt(OIDNFilter filter, const char *name, int value)
OIDN_API void oidnUnsetFilterData(OIDNFilter filter, const char *name)
OIDNExternalMemoryTypeFlag
Definition: oidn.h:273
void oidnSetFilter1i(OIDNFilter filter, const char *name, int value)
Definition: oidn.h:463
OIDN_API OIDNDevice oidnNewHIPDevice(const int *deviceIDs, const hipStream_t *streams, int numPairs)
OIDN_API int oidnGetFilterInt(OIDNFilter filter, const char *name)
void oidnSetDevice1i(OIDNDevice device, const char *name, int value)
Definition: oidn.h:183
OIDN_API int oidnGetNumPhysicalDevices()
OIDNStorage
Definition: oidn.h:257
OIDN_API int oidnGetPhysicalDeviceInt(int physicalDeviceID, const char *name)
void oidnRemoveFilterData(OIDNFilter filter, const char *name)
Definition: oidn.h:436
GLuint buffer
Definition: glcorearb.h:660
void * MTLDevice_id
Definition: oidn.h:40
OIDN_API float oidnGetFilterFloat(OIDNFilter filter, const char *name)
struct ihipStream_t * hipStream_t
Definition: oidn.h:29
struct OIDNFilterImpl * OIDNFilter
Definition: oidn.h:389
#define OIDN_API
Definition: config.h:55
OutGridT const XformOp bool bool
OIDN_API void oidnWriteBufferAsync(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, const void *srcHostPtr)
OIDN_API void oidnRetainFilter(OIDNFilter filter)
struct _cl_event * event
Definition: glcorearb.h:2961
void * MTLBuffer_id
Definition: oidn.h:42
OIDN_API void oidnRetainBuffer(OIDNBuffer buffer)
OIDNDeviceType
Definition: oidn.h:81
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
struct OIDNBufferImpl * OIDNBuffer
Definition: oidn.h:314
void(* OIDNErrorFunction)(void *userPtr, OIDNError code, const char *message)
Definition: oidn.h:105
GLdouble n
Definition: glcorearb.h:2008
#define OIDN_API_NAMESPACE_END
Definition: config.h:26
OIDN_API bool oidnIsMetalDeviceSupported(MTLDevice_id device)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
OIDN_API bool oidnIsCPUDeviceSupported()
OIDN_API void oidnUpdateFilterData(OIDNFilter filter, const char *name)
OIDN_API void oidnWriteBuffer(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, const void *srcHostPtr)
OIDN_API void oidnReleaseBuffer(OIDNBuffer buffer)
void * MTLCommandQueue_id
Definition: oidn.h:41
OIDN_API void oidnRetainDevice(OIDNDevice device)
OIDN_API const char * oidnGetPhysicalDeviceString(int physicalDeviceID, const char *name)
OIDN_API void oidnCommitFilter(OIDNFilter filter)
OIDN_API void oidnSetFilterProgressMonitorFunction(OIDNFilter filter, OIDNProgressMonitorFunction func, void *userPtr)
OIDN_API void oidnSetFilterBool(OIDNFilter filter, const char *name, bool value)
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
void oidnRemoveFilterImage(OIDNFilter filter, const char *name)
Definition: oidn.h:420
OIDN_API OIDNBuffer oidnNewSharedBufferFromFD(OIDNDevice device, OIDNExternalMemoryTypeFlag fdType, int fd, size_t byteSize)
OIDN_API bool oidnGetPhysicalDeviceBool(int physicalDeviceID, const char *name)
OIDN_API void oidnCommitDevice(OIDNDevice device)
OIDN_API void * oidnGetBufferData(OIDNBuffer buffer)
#define OIDN_DEPRECATED(msg)
Definition: config.h:61
OIDN_API OIDNBuffer oidnNewSharedBufferFromMetal(OIDNDevice device, MTLBuffer_id buffer)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the queue
Definition: thread.h:632
OIDN_API void oidnSyncDevice(OIDNDevice device)
OIDN_API OIDNBuffer oidnNewBuffer(OIDNDevice device, size_t byteSize)
OIDN_API bool oidnIsCUDADeviceSupported(int deviceID)
OIDN_API OIDNDevice oidnNewDevice(OIDNDeviceType type)
GLuint id
Definition: glcorearb.h:655
OIDN_API void oidnSetDeviceErrorFunction(OIDNDevice device, OIDNErrorFunction func, void *userPtr)
void oidnSetFilter1b(OIDNFilter filter, const char *name, bool value)
Definition: oidn.h:445
OIDN_API OIDNStorage oidnGetBufferStorage(OIDNBuffer buffer)
GLuint const GLchar * name
Definition: glcorearb.h:786
OIDN_API OIDNBuffer oidnNewSharedBuffer(OIDNDevice device, void *devPtr, size_t byteSize)
struct CUstream_st * cudaStream_t
Definition: oidn.h:28
OIDN_API OIDNDevice oidnNewMetalDevice(const MTLCommandQueue_id *commandQueues, int numQueues)
OIDN_API size_t oidnGetBufferSize(OIDNBuffer buffer)
OIDN_API bool oidnIsHIPDeviceSupported(int deviceID)
OIDN_API void oidnSetFilterFloat(OIDNFilter filter, const char *name, float value)
OIDN_API void oidnSetSharedFilterData(OIDNFilter filter, const char *name, void *hostPtr, size_t byteSize)
OIDN_API OIDNDevice oidnNewDeviceByLUID(const void *luid)
OIDNQuality
Definition: oidn.h:376
GLenum func
Definition: glcorearb.h:783
unsigned int oidnGetDeviceUInt(OIDNDevice device, const char *name)
Definition: oidn.h:207
bool(* OIDNProgressMonitorFunction)(void *userPtr, double n)
Definition: oidn.h:386
OIDNError
Definition: oidn.h:93
float oidnGetFilter1f(OIDNFilter filter, const char *name)
Definition: oidn.h:490
struct OIDNDeviceImpl * OIDNDevice
Definition: oidn.h:108
OIDN_API const void * oidnGetPhysicalDeviceData(int physicalDeviceID, const char *name, size_t *byteSize)
OIDN_API bool oidnGetFilterBool(OIDNFilter filter, const char *name)
bool oidnGetDevice1b(OIDNDevice device, const char *name)
Definition: oidn.h:198
unsigned int oidnGetPhysicalDeviceUInt(int physicalDeviceID, const char *name)
Definition: oidn.h:64
OIDN_API void oidnReadBuffer(OIDNBuffer buffer, size_t byteOffset, size_t byteSize, void *dstHostPtr)
void oidnSetFilter1f(OIDNFilter filter, const char *name, float value)
Definition: oidn.h:481
OIDN_API OIDNDevice oidnNewDeviceByPCIAddress(int pciDomain, int pciBus, int pciDevice, int pciFunction)
GLint GLsizei width
Definition: glcorearb.h:103
bool oidnGetFilter1b(OIDNFilter filter, const char *name)
Definition: oidn.h:454
OIDN_API OIDNBuffer oidnNewBufferWithStorage(OIDNDevice device, size_t byteSize, OIDNStorage storage)
OIDN_API OIDNDevice oidnNewDeviceByID(int physicalDeviceID)
int oidnGetDevice1i(OIDNDevice device, const char *name)
Definition: oidn.h:213
void oidnSetDevice1b(OIDNDevice device, const char *name, bool value)
Definition: oidn.h:174
OIDN_API OIDNDevice oidnNewDeviceByUUID(const void *uuid)
OIDN_API OIDNFilter oidnNewFilter(OIDNDevice device, const char *type)
OIDN_API void oidnSetDeviceBool(OIDNDevice device, const char *name, bool value)
void oidnSetDeviceUInt(OIDNDevice device, const char *name, unsigned int value)
Definition: oidn.h:189
OIDN_API OIDNError oidnGetDeviceError(OIDNDevice device, const char **outMessage)
GLuint64 GLenum GLint fd
Definition: RE_OGL.h:262
OIDN_API int oidnGetDeviceInt(OIDNDevice device, const char *name)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297