HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
oidn.hpp File Reference
#include "oidn.h"
#include <cstdint>
#include <cassert>
#include <cstring>
#include <algorithm>
#include <type_traits>
#include <vector>
#include <array>
#include <string>
+ Include dependency graph for oidn.hpp:

Go to the source code of this file.

Classes

struct  IsFlag< FlagT >
 
class  Flags< FlagT >
 
struct  IsFlag< ExternalMemoryTypeFlag >
 
class  BufferRef
 
class  FilterRef
 
struct  UUID
 
struct  LUID
 
class  DeviceRef
 
class  PhysicalDeviceRef
 

Typedefs

using ExternalMemoryTypeFlags = Flags< ExternalMemoryTypeFlag >
 
using ProgressMonitorFunction = OIDNProgressMonitorFunction
 
typedef void(* ErrorFunction )(void *userPtr, Error code, const char *message)
 

Enumerations

enum  Format {
  Format::Undefined = OIDN_FORMAT_UNDEFINED, Format::Float = OIDN_FORMAT_FLOAT, Format::Float2 = OIDN_FORMAT_FLOAT2, Format::Float3 = OIDN_FORMAT_FLOAT3,
  Format::Float4 = OIDN_FORMAT_FLOAT4, Format::Half = OIDN_FORMAT_HALF, Format::Half2 = OIDN_FORMAT_HALF2, Format::Half3 = OIDN_FORMAT_HALF3,
  Format::Half4 = OIDN_FORMAT_HALF4
}
 
enum  Storage { Storage::Undefined = OIDN_STORAGE_UNDEFINED, Storage::Host = OIDN_STORAGE_HOST, Storage::Device = OIDN_STORAGE_DEVICE, Storage::Managed = OIDN_STORAGE_MANAGED }
 
enum  ExternalMemoryTypeFlag {
  ExternalMemoryTypeFlag::None = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_NONE, ExternalMemoryTypeFlag::OpaqueFD = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_FD, ExternalMemoryTypeFlag::DMABuf = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF, ExternalMemoryTypeFlag::OpaqueWin32 = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32,
  ExternalMemoryTypeFlag::OpaqueWin32KMT = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT, ExternalMemoryTypeFlag::D3D11Texture = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE, ExternalMemoryTypeFlag::D3D11TextureKMT = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE_KMT, ExternalMemoryTypeFlag::D3D11Resource = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE,
  ExternalMemoryTypeFlag::D3D11ResourceKMT = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_RESOURCE_KMT, ExternalMemoryTypeFlag::D3D12Heap = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP, ExternalMemoryTypeFlag::D3D12Resource = OIDN_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE
}
 
enum  Quality { Quality::Default = OIDN_QUALITY_DEFAULT, Quality::Balanced = OIDN_QUALITY_BALANCED, Quality::High = OIDN_QUALITY_HIGH }
 
enum  DeviceType {
  DeviceType::Default = OIDN_DEVICE_TYPE_DEFAULT, DeviceType::CPU = OIDN_DEVICE_TYPE_CPU, DeviceType::SYCL = OIDN_DEVICE_TYPE_SYCL, DeviceType::CUDA = OIDN_DEVICE_TYPE_CUDA,
  DeviceType::HIP = OIDN_DEVICE_TYPE_HIP, DeviceType::Metal = OIDN_DEVICE_TYPE_METAL
}
 
enum  Error {
  Error::None = OIDN_ERROR_NONE, Error::Unknown = OIDN_ERROR_UNKNOWN, Error::InvalidArgument = OIDN_ERROR_INVALID_ARGUMENT, Error::InvalidOperation = OIDN_ERROR_INVALID_OPERATION,
  Error::OutOfMemory = OIDN_ERROR_OUT_OF_MEMORY, Error::UnsupportedHardware = OIDN_ERROR_UNSUPPORTED_HARDWARE, Error::Cancelled = OIDN_ERROR_CANCELLED
}
 

Functions

template<typename FlagT >
constexpr Flags< FlagT > operator& (FlagT a, const Flags< FlagT > &b) noexcept
 
template<typename FlagT >
constexpr Flags< FlagT > operator| (FlagT a, const Flags< FlagT > &b) noexcept
 
template<typename FlagT >
constexpr Flags< FlagT > operator^ (FlagT a, const Flags< FlagT > &b) noexcept
 
template<typename FlagT , typename std::enable_if< IsFlag< FlagT >::value, bool >::type = true>
constexpr Flags< FlagT > operator& (FlagT a, FlagT b) noexcept
 
template<typename FlagT , typename std::enable_if< IsFlag< FlagT >::value, bool >::type = true>
constexpr Flags< FlagT > operator| (FlagT a, FlagT b) noexcept
 
template<typename FlagT , typename std::enable_if< IsFlag< FlagT >::value, bool >::type = true>
constexpr Flags< FlagT > operator^ (FlagT a, FlagT b) noexcept
 
Error getError ()
 
Error getError (const char *&outMessage)
 
DeviceRef newDevice (DeviceType type=DeviceType::Default)
 
DeviceRef newDevice (int physicalDeviceID)
 
DeviceRef newDevice (const UUID &uuid)
 
DeviceRef newDevice (const LUID &luid)
 
DeviceRef newDevice (int pciDomain, int pciBus, int pciDevice, int pciFunction)
 
DeviceRef newCUDADevice (int deviceID, cudaStream_t stream)
 
DeviceRef newCUDADevice (const std::vector< int > &deviceIDs, const std::vector< cudaStream_t > &streams)
 
DeviceRef newHIPDevice (int deviceID, hipStream_t stream)
 
DeviceRef newHIPDevice (const std::vector< int > &deviceIDs, const std::vector< hipStream_t > &streams)
 
DeviceRef newMetalDevice (MTLCommandQueue_id commandQueue)
 
DeviceRef newMetalDevice (const std::vector< MTLCommandQueue_id > &commandQueues)
 
int getNumPhysicalDevices ()
 

Typedef Documentation

typedef void(* ErrorFunction)(void *userPtr, Error code, const char *message)

Definition at line 589 of file oidn.hpp.

Definition at line 194 of file oidn.hpp.

Definition at line 331 of file oidn.hpp.

Enumeration Type Documentation

enum DeviceType
strong
Enumerator
Default 
CPU 
SYCL 
CUDA 
HIP 
Metal 

Definition at line 565 of file oidn.hpp.

enum Error
strong
Enumerator
None 
Unknown 
InvalidArgument 
InvalidOperation 
OutOfMemory 
UnsupportedHardware 
Cancelled 

Definition at line 577 of file oidn.hpp.

Enumerator
None 
OpaqueFD 
DMABuf 
OpaqueWin32 
OpaqueWin32KMT 
D3D11Texture 
D3D11TextureKMT 
D3D11Resource 
D3D11ResourceKMT 
D3D12Heap 
D3D12Resource 

Definition at line 152 of file oidn.hpp.

enum Format
strong
Enumerator
Undefined 
Float 
Float2 
Float3 
Float4 
Half 
Half2 
Half3 
Half4 

Definition at line 118 of file oidn.hpp.

enum Quality
strong
Enumerator
Default 
Balanced 
High 

Definition at line 322 of file oidn.hpp.

enum Storage
strong
Enumerator
Undefined 
Host 
Device 
Managed 

Definition at line 136 of file oidn.hpp.

Function Documentation

Error getError ( )
inline

Definition at line 823 of file oidn.hpp.

Error getError ( const char *&  outMessage)
inline

Definition at line 830 of file oidn.hpp.

int getNumPhysicalDevices ( )
inline

Definition at line 979 of file oidn.hpp.

DeviceRef newCUDADevice ( int  deviceID,
cudaStream_t  stream 
)
inline

Definition at line 883 of file oidn.hpp.

DeviceRef newCUDADevice ( const std::vector< int > &  deviceIDs,
const std::vector< cudaStream_t > &  streams 
)
inline

Definition at line 891 of file oidn.hpp.

DeviceRef newDevice ( DeviceType  type = DeviceType::Default)
inline

Definition at line 836 of file oidn.hpp.

DeviceRef newDevice ( int  physicalDeviceID)
inline

Definition at line 842 of file oidn.hpp.

DeviceRef newDevice ( const UUID uuid)
inline

Definition at line 848 of file oidn.hpp.

DeviceRef newDevice ( const LUID luid)
inline

Definition at line 854 of file oidn.hpp.

DeviceRef newDevice ( int  pciDomain,
int  pciBus,
int  pciDevice,
int  pciFunction 
)
inline

Definition at line 860 of file oidn.hpp.

DeviceRef newHIPDevice ( int  deviceID,
hipStream_t  stream 
)
inline

Definition at line 901 of file oidn.hpp.

DeviceRef newHIPDevice ( const std::vector< int > &  deviceIDs,
const std::vector< hipStream_t > &  streams 
)
inline

Definition at line 909 of file oidn.hpp.

DeviceRef newMetalDevice ( MTLCommandQueue_id  commandQueue)
inline

Definition at line 918 of file oidn.hpp.

DeviceRef newMetalDevice ( const std::vector< MTLCommandQueue_id > &  commandQueues)
inline

Definition at line 925 of file oidn.hpp.

template<typename FlagT >
constexpr Flags<FlagT> operator& ( FlagT  a,
const Flags< FlagT > &  b 
)
inlinenoexcept

Definition at line 78 of file oidn.hpp.

template<typename FlagT , typename std::enable_if< IsFlag< FlagT >::value, bool >::type = true>
constexpr Flags<FlagT> operator& ( FlagT  a,
FlagT  b 
)
inlinenoexcept

Definition at line 96 of file oidn.hpp.

template<typename FlagT >
constexpr Flags<FlagT> operator^ ( FlagT  a,
const Flags< FlagT > &  b 
)
inlinenoexcept

Definition at line 90 of file oidn.hpp.

template<typename FlagT , typename std::enable_if< IsFlag< FlagT >::value, bool >::type = true>
constexpr Flags<FlagT> operator^ ( FlagT  a,
FlagT  b 
)
inlinenoexcept

Definition at line 108 of file oidn.hpp.

template<typename FlagT >
constexpr Flags<FlagT> operator| ( FlagT  a,
const Flags< FlagT > &  b 
)
inlinenoexcept

Definition at line 84 of file oidn.hpp.

template<typename FlagT , typename std::enable_if< IsFlag< FlagT >::value, bool >::type = true>
constexpr Flags<FlagT> operator| ( FlagT  a,
FlagT  b 
)
inlinenoexcept

Definition at line 102 of file oidn.hpp.