HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
oidn.h File Reference
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "config.h"
+ Include dependency graph for oidn.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OIDN_UUID_SIZE   16u
 
#define OIDN_LUID_SIZE   8u
 

Typedefs

typedef struct CUstream_st * cudaStream_t
 
typedef struct ihipStream_t * hipStream_t
 
typedef voidMTLCommandQueue_id
 
typedef voidMTLBuffer_id
 
typedef void(* OIDNErrorFunction )(void *userPtr, OIDNError code, const char *message)
 
typedef struct OIDNDeviceImpl * OIDNDevice
 
typedef struct OIDNBufferImpl * OIDNBuffer
 
typedef bool(* OIDNProgressMonitorFunction )(void *userPtr, double n)
 
typedef struct OIDNFilterImpl * OIDNFilter
 

Enumerations

enum  OIDNDeviceType {
  OIDN_DEVICE_TYPE_DEFAULT = 0, OIDN_DEVICE_TYPE_CPU = 1, OIDN_DEVICE_TYPE_SYCL = 2, OIDN_DEVICE_TYPE_CUDA = 3,
  OIDN_DEVICE_TYPE_HIP = 4, OIDN_DEVICE_TYPE_METAL = 5
}
 
enum  OIDNError {
  OIDN_ERROR_NONE = 0, OIDN_ERROR_UNKNOWN = 1, OIDN_ERROR_INVALID_ARGUMENT = 2, OIDN_ERROR_INVALID_OPERATION = 3,
  OIDN_ERROR_OUT_OF_MEMORY = 4, OIDN_ERROR_UNSUPPORTED_HARDWARE = 5, OIDN_ERROR_CANCELLED = 6
}
 
enum  OIDNFormat {
  OIDN_FORMAT_UNDEFINED = 0, OIDN_FORMAT_FLOAT = 1, OIDN_FORMAT_FLOAT2, OIDN_FORMAT_FLOAT3,
  OIDN_FORMAT_FLOAT4, OIDN_FORMAT_HALF = 257, OIDN_FORMAT_HALF2, OIDN_FORMAT_HALF3,
  OIDN_FORMAT_HALF4
}
 
enum  OIDNStorage { OIDN_STORAGE_UNDEFINED = 0, OIDN_STORAGE_HOST = 1, OIDN_STORAGE_DEVICE = 2, OIDN_STORAGE_MANAGED = 3 }
 
enum  OIDNExternalMemoryTypeFlag {
  OIDN_EXTERNAL_MEMORY_TYPE_FLAG_NONE = 0, OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_FD = 1 << 0, OIDN_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF = 1 << 1, OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32 = 1 << 2,
  OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT = 1 << 3, OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE = 1 << 4, OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE_KMT = 1 << 5, OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE = 1 << 6,
  OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE_KMT = 1 << 7, OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP = 1 << 8, OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE = 1 << 9
}
 
enum  OIDNQuality { OIDN_QUALITY_DEFAULT = 0, OIDN_QUALITY_BALANCED = 5, OIDN_QUALITY_HIGH = 6 }
 

Functions

OIDN_API int oidnGetNumPhysicalDevices ()
 
OIDN_API bool oidnGetPhysicalDeviceBool (int physicalDeviceID, const char *name)
 
OIDN_API int oidnGetPhysicalDeviceInt (int physicalDeviceID, const char *name)
 
unsigned int oidnGetPhysicalDeviceUInt (int physicalDeviceID, const char *name)
 
OIDN_API const char * oidnGetPhysicalDeviceString (int physicalDeviceID, const char *name)
 
OIDN_API const voidoidnGetPhysicalDeviceData (int physicalDeviceID, const char *name, size_t *byteSize)
 
OIDN_API OIDNDevice oidnNewDevice (OIDNDeviceType type)
 
OIDN_API OIDNDevice oidnNewDeviceByID (int physicalDeviceID)
 
OIDN_API OIDNDevice oidnNewDeviceByUUID (const void *uuid)
 
OIDN_API OIDNDevice oidnNewDeviceByLUID (const void *luid)
 
OIDN_API OIDNDevice oidnNewDeviceByPCIAddress (int pciDomain, int pciBus, int pciDevice, int pciFunction)
 
OIDN_API OIDNDevice oidnNewCUDADevice (const int *deviceIDs, const cudaStream_t *streams, int numPairs)
 
OIDN_API OIDNDevice oidnNewHIPDevice (const int *deviceIDs, const hipStream_t *streams, int numPairs)
 
OIDN_API OIDNDevice oidnNewMetalDevice (const MTLCommandQueue_id *commandQueues, int numQueues)
 
OIDN_API void oidnRetainDevice (OIDNDevice device)
 
OIDN_API void oidnReleaseDevice (OIDNDevice device)
 
OIDN_API void oidnSetDeviceBool (OIDNDevice device, const char *name, bool value)
 
void oidnSetDevice1b (OIDNDevice device, const char *name, bool value)
 
OIDN_API void oidnSetDeviceInt (OIDNDevice device, const char *name, int value)
 
void oidnSetDevice1i (OIDNDevice device, const char *name, int value)
 
void oidnSetDeviceUInt (OIDNDevice device, const char *name, unsigned int value)
 
OIDN_API bool oidnGetDeviceBool (OIDNDevice device, const char *name)
 
bool oidnGetDevice1b (OIDNDevice device, const char *name)
 
OIDN_API int oidnGetDeviceInt (OIDNDevice device, const char *name)
 
unsigned int oidnGetDeviceUInt (OIDNDevice device, const char *name)
 
int oidnGetDevice1i (OIDNDevice device, const char *name)
 
OIDN_API void oidnSetDeviceErrorFunction (OIDNDevice device, OIDNErrorFunction func, void *userPtr)
 
OIDN_API OIDNError oidnGetDeviceError (OIDNDevice device, const char **outMessage)
 
OIDN_API void oidnCommitDevice (OIDNDevice device)
 
OIDN_API void oidnSyncDevice (OIDNDevice device)
 
OIDN_API OIDNBuffer oidnNewBuffer (OIDNDevice device, size_t byteSize)
 
OIDN_API OIDNBuffer oidnNewBufferWithStorage (OIDNDevice device, size_t byteSize, OIDNStorage storage)
 
OIDN_API OIDNBuffer oidnNewSharedBuffer (OIDNDevice device, void *devPtr, size_t byteSize)
 
OIDN_API OIDNBuffer oidnNewSharedBufferFromFD (OIDNDevice device, OIDNExternalMemoryTypeFlag fdType, int fd, size_t byteSize)
 
OIDN_API OIDNBuffer oidnNewSharedBufferFromWin32Handle (OIDNDevice device, OIDNExternalMemoryTypeFlag handleType, void *handle, const void *name, size_t byteSize)
 
OIDN_API OIDNBuffer oidnNewSharedBufferFromMetal (OIDNDevice device, MTLBuffer_id buffer)
 
OIDN_API size_t oidnGetBufferSize (OIDNBuffer buffer)
 
OIDN_API OIDNStorage oidnGetBufferStorage (OIDNBuffer buffer)
 
OIDN_API voidoidnGetBufferData (OIDNBuffer buffer)
 
OIDN_API void oidnReadBuffer (OIDNBuffer buffer, size_t byteOffset, size_t byteSize, void *dstHostPtr)
 
OIDN_API void oidnReadBufferAsync (OIDNBuffer buffer, size_t byteOffset, size_t byteSize, void *dstHostPtr)
 
OIDN_API void oidnWriteBuffer (OIDNBuffer buffer, size_t byteOffset, size_t byteSize, const void *srcHostPtr)
 
OIDN_API void oidnWriteBufferAsync (OIDNBuffer buffer, size_t byteOffset, size_t byteSize, const void *srcHostPtr)
 
OIDN_API void oidnRetainBuffer (OIDNBuffer buffer)
 
OIDN_API void oidnReleaseBuffer (OIDNBuffer buffer)
 
OIDN_API OIDNFilter oidnNewFilter (OIDNDevice device, const char *type)
 
OIDN_API void oidnRetainFilter (OIDNFilter filter)
 
OIDN_API void oidnReleaseFilter (OIDNFilter filter)
 
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 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 oidnUnsetFilterImage (OIDNFilter filter, const char *name)
 
void oidnRemoveFilterImage (OIDNFilter filter, const char *name)
 
OIDN_API void oidnSetSharedFilterData (OIDNFilter filter, const char *name, void *hostPtr, size_t byteSize)
 
OIDN_API void oidnUpdateFilterData (OIDNFilter filter, const char *name)
 
OIDN_API void oidnUnsetFilterData (OIDNFilter filter, const char *name)
 
void oidnRemoveFilterData (OIDNFilter filter, const char *name)
 
OIDN_API void oidnSetFilterBool (OIDNFilter filter, const char *name, bool value)
 
void oidnSetFilter1b (OIDNFilter filter, const char *name, bool value)
 
OIDN_API bool oidnGetFilterBool (OIDNFilter filter, const char *name)
 
bool oidnGetFilter1b (OIDNFilter filter, const char *name)
 
OIDN_API void oidnSetFilterInt (OIDNFilter filter, const char *name, int value)
 
void oidnSetFilter1i (OIDNFilter filter, const char *name, int value)
 
OIDN_API int oidnGetFilterInt (OIDNFilter filter, const char *name)
 
int oidnGetFilter1i (OIDNFilter filter, const char *name)
 
OIDN_API void oidnSetFilterFloat (OIDNFilter filter, const char *name, float value)
 
void oidnSetFilter1f (OIDNFilter filter, const char *name, float value)
 
OIDN_API float oidnGetFilterFloat (OIDNFilter filter, const char *name)
 
float oidnGetFilter1f (OIDNFilter filter, const char *name)
 
OIDN_API void oidnSetFilterProgressMonitorFunction (OIDNFilter filter, OIDNProgressMonitorFunction func, void *userPtr)
 
OIDN_API void oidnCommitFilter (OIDNFilter filter)
 
OIDN_API void oidnExecuteFilter (OIDNFilter filter)
 
OIDN_API void oidnExecuteFilterAsync (OIDNFilter filter)
 

Macro Definition Documentation

#define OIDN_LUID_SIZE   8u

Definition at line 45 of file oidn.h.

#define OIDN_UUID_SIZE   16u

Definition at line 44 of file oidn.h.

Typedef Documentation

typedef struct CUstream_st* cudaStream_t

Definition at line 24 of file oidn.h.

typedef struct ihipStream_t* hipStream_t

Definition at line 25 of file oidn.h.

typedef void* MTLBuffer_id

Definition at line 35 of file oidn.h.

Definition at line 34 of file oidn.h.

typedef struct OIDNBufferImpl* OIDNBuffer

Definition at line 292 of file oidn.h.

typedef struct OIDNDeviceImpl* OIDNDevice

Definition at line 101 of file oidn.h.

typedef void(* OIDNErrorFunction)(void *userPtr, OIDNError code, const char *message)

Definition at line 98 of file oidn.h.

typedef struct OIDNFilterImpl* OIDNFilter

Definition at line 367 of file oidn.h.

typedef bool(* OIDNProgressMonitorFunction)(void *userPtr, double n)

Definition at line 364 of file oidn.h.

Enumeration Type Documentation

Enumerator
OIDN_DEVICE_TYPE_DEFAULT 
OIDN_DEVICE_TYPE_CPU 
OIDN_DEVICE_TYPE_SYCL 
OIDN_DEVICE_TYPE_CUDA 
OIDN_DEVICE_TYPE_HIP 
OIDN_DEVICE_TYPE_METAL 

Definition at line 74 of file oidn.h.

enum OIDNError
Enumerator
OIDN_ERROR_NONE 
OIDN_ERROR_UNKNOWN 
OIDN_ERROR_INVALID_ARGUMENT 
OIDN_ERROR_INVALID_OPERATION 
OIDN_ERROR_OUT_OF_MEMORY 
OIDN_ERROR_UNSUPPORTED_HARDWARE 
OIDN_ERROR_CANCELLED 

Definition at line 86 of file oidn.h.

Enumerator
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_NONE 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_FD 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE_KMT 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE_KMT 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP 
OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE 

Definition at line 251 of file oidn.h.

enum OIDNFormat
Enumerator
OIDN_FORMAT_UNDEFINED 
OIDN_FORMAT_FLOAT 
OIDN_FORMAT_FLOAT2 
OIDN_FORMAT_FLOAT3 
OIDN_FORMAT_FLOAT4 
OIDN_FORMAT_HALF 
OIDN_FORMAT_HALF2 
OIDN_FORMAT_HALF3 
OIDN_FORMAT_HALF4 

Definition at line 217 of file oidn.h.

Enumerator
OIDN_QUALITY_DEFAULT 
OIDN_QUALITY_BALANCED 
OIDN_QUALITY_HIGH 

Definition at line 354 of file oidn.h.

Enumerator
OIDN_STORAGE_UNDEFINED 
OIDN_STORAGE_HOST 
OIDN_STORAGE_DEVICE 
OIDN_STORAGE_MANAGED 

Definition at line 235 of file oidn.h.

Function Documentation

OIDN_API void oidnCommitDevice ( OIDNDevice  device)
OIDN_API void oidnCommitFilter ( OIDNFilter  filter)
OIDN_API void oidnExecuteFilter ( OIDNFilter  filter)
OIDN_API void oidnExecuteFilterAsync ( OIDNFilter  filter)
OIDN_API void* oidnGetBufferData ( OIDNBuffer  buffer)
OIDN_API size_t oidnGetBufferSize ( OIDNBuffer  buffer)
OIDN_API OIDNStorage oidnGetBufferStorage ( OIDNBuffer  buffer)
bool oidnGetDevice1b ( OIDNDevice  device,
const char *  name 
)
inline

Definition at line 176 of file oidn.h.

int oidnGetDevice1i ( OIDNDevice  device,
const char *  name 
)
inline

Definition at line 191 of file oidn.h.

OIDN_API bool oidnGetDeviceBool ( OIDNDevice  device,
const char *  name 
)
OIDN_API OIDNError oidnGetDeviceError ( OIDNDevice  device,
const char **  outMessage 
)
OIDN_API int oidnGetDeviceInt ( OIDNDevice  device,
const char *  name 
)
unsigned int oidnGetDeviceUInt ( OIDNDevice  device,
const char *  name 
)
inline

Definition at line 185 of file oidn.h.

bool oidnGetFilter1b ( OIDNFilter  filter,
const char *  name 
)
inline

Definition at line 432 of file oidn.h.

float oidnGetFilter1f ( OIDNFilter  filter,
const char *  name 
)
inline

Definition at line 468 of file oidn.h.

int oidnGetFilter1i ( OIDNFilter  filter,
const char *  name 
)
inline

Definition at line 450 of file oidn.h.

OIDN_API bool oidnGetFilterBool ( OIDNFilter  filter,
const char *  name 
)
OIDN_API float oidnGetFilterFloat ( OIDNFilter  filter,
const char *  name 
)
OIDN_API int oidnGetFilterInt ( OIDNFilter  filter,
const char *  name 
)
OIDN_API int oidnGetNumPhysicalDevices ( )
OIDN_API bool oidnGetPhysicalDeviceBool ( int  physicalDeviceID,
const char *  name 
)
OIDN_API const void* oidnGetPhysicalDeviceData ( int  physicalDeviceID,
const char *  name,
size_t *  byteSize 
)
OIDN_API int oidnGetPhysicalDeviceInt ( int  physicalDeviceID,
const char *  name 
)
OIDN_API const char* oidnGetPhysicalDeviceString ( int  physicalDeviceID,
const char *  name 
)
unsigned int oidnGetPhysicalDeviceUInt ( int  physicalDeviceID,
const char *  name 
)
inline

Definition at line 57 of file oidn.h.

OIDN_API OIDNBuffer oidnNewBuffer ( OIDNDevice  device,
size_t  byteSize 
)
OIDN_API OIDNBuffer oidnNewBufferWithStorage ( OIDNDevice  device,
size_t  byteSize,
OIDNStorage  storage 
)
OIDN_API OIDNDevice oidnNewCUDADevice ( const int deviceIDs,
const cudaStream_t streams,
int  numPairs 
)
OIDN_API OIDNDevice oidnNewDevice ( OIDNDeviceType  type)
OIDN_API OIDNDevice oidnNewDeviceByID ( int  physicalDeviceID)
OIDN_API OIDNDevice oidnNewDeviceByLUID ( const void luid)
OIDN_API OIDNDevice oidnNewDeviceByPCIAddress ( int  pciDomain,
int  pciBus,
int  pciDevice,
int  pciFunction 
)
OIDN_API OIDNDevice oidnNewDeviceByUUID ( const void uuid)
OIDN_API OIDNFilter oidnNewFilter ( OIDNDevice  device,
const char *  type 
)
OIDN_API OIDNDevice oidnNewHIPDevice ( const int deviceIDs,
const hipStream_t streams,
int  numPairs 
)
OIDN_API OIDNDevice oidnNewMetalDevice ( const MTLCommandQueue_id commandQueues,
int  numQueues 
)
OIDN_API OIDNBuffer oidnNewSharedBuffer ( OIDNDevice  device,
void devPtr,
size_t  byteSize 
)
OIDN_API OIDNBuffer oidnNewSharedBufferFromFD ( OIDNDevice  device,
OIDNExternalMemoryTypeFlag  fdType,
int  fd,
size_t  byteSize 
)
OIDN_API OIDNBuffer oidnNewSharedBufferFromMetal ( OIDNDevice  device,
MTLBuffer_id  buffer 
)
OIDN_API OIDNBuffer oidnNewSharedBufferFromWin32Handle ( OIDNDevice  device,
OIDNExternalMemoryTypeFlag  handleType,
void handle,
const void name,
size_t  byteSize 
)
OIDN_API void oidnReadBuffer ( OIDNBuffer  buffer,
size_t  byteOffset,
size_t  byteSize,
void dstHostPtr 
)
OIDN_API void oidnReadBufferAsync ( OIDNBuffer  buffer,
size_t  byteOffset,
size_t  byteSize,
void dstHostPtr 
)
OIDN_API void oidnReleaseBuffer ( OIDNBuffer  buffer)
OIDN_API void oidnReleaseDevice ( OIDNDevice  device)
OIDN_API void oidnReleaseFilter ( OIDNFilter  filter)
void oidnRemoveFilterData ( OIDNFilter  filter,
const char *  name 
)
inline

Definition at line 414 of file oidn.h.

void oidnRemoveFilterImage ( OIDNFilter  filter,
const char *  name 
)
inline

Definition at line 398 of file oidn.h.

OIDN_API void oidnRetainBuffer ( OIDNBuffer  buffer)
OIDN_API void oidnRetainDevice ( OIDNDevice  device)
OIDN_API void oidnRetainFilter ( OIDNFilter  filter)
void oidnSetDevice1b ( OIDNDevice  device,
const char *  name,
bool  value 
)
inline

Definition at line 152 of file oidn.h.

void oidnSetDevice1i ( OIDNDevice  device,
const char *  name,
int  value 
)
inline

Definition at line 161 of file oidn.h.

OIDN_API void oidnSetDeviceBool ( OIDNDevice  device,
const char *  name,
bool  value 
)
OIDN_API void oidnSetDeviceErrorFunction ( OIDNDevice  device,
OIDNErrorFunction  func,
void userPtr 
)
OIDN_API void oidnSetDeviceInt ( OIDNDevice  device,
const char *  name,
int  value 
)
void oidnSetDeviceUInt ( OIDNDevice  device,
const char *  name,
unsigned int  value 
)
inline

Definition at line 167 of file oidn.h.

void oidnSetFilter1b ( OIDNFilter  filter,
const char *  name,
bool  value 
)
inline

Definition at line 423 of file oidn.h.

void oidnSetFilter1f ( OIDNFilter  filter,
const char *  name,
float  value 
)
inline

Definition at line 459 of file oidn.h.

void oidnSetFilter1i ( OIDNFilter  filter,
const char *  name,
int  value 
)
inline

Definition at line 441 of file oidn.h.

OIDN_API void oidnSetFilterBool ( OIDNFilter  filter,
const char *  name,
bool  value 
)
OIDN_API void oidnSetFilterFloat ( OIDNFilter  filter,
const char *  name,
float  value 
)
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 oidnSetFilterInt ( OIDNFilter  filter,
const char *  name,
int  value 
)
OIDN_API void oidnSetFilterProgressMonitorFunction ( OIDNFilter  filter,
OIDNProgressMonitorFunction  func,
void userPtr 
)
OIDN_API void oidnSetSharedFilterData ( OIDNFilter  filter,
const char *  name,
void hostPtr,
size_t  byteSize 
)
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 oidnSyncDevice ( OIDNDevice  device)
OIDN_API void oidnUnsetFilterData ( OIDNFilter  filter,
const char *  name 
)
OIDN_API void oidnUnsetFilterImage ( OIDNFilter  filter,
const char *  name 
)
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 oidnWriteBufferAsync ( OIDNBuffer  buffer,
size_t  byteOffset,
size_t  byteSize,
const void srcHostPtr 
)