forked from KhronosGroup/ANARI-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeviceImpl.cpp
56 lines (42 loc) · 1.23 KB
/
DeviceImpl.cpp
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
// Copyright 2021-2024 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#include "anari/backend/DeviceImpl.h"
#include <algorithm>
#include <stdexcept>
namespace anari {
// extension functions ////////////////////////////////////////////////////////
ANARIObject DeviceImpl::newObject(const char *objectType, const char *type)
{
(void)objectType;
(void)type;
return nullptr;
}
void (*DeviceImpl::getProcAddress(const char *name))(void)
{
(void)name;
return nullptr;
}
// Device definitions /////////////////////////////////////////////////////////
DeviceImpl::DeviceImpl(ANARILibrary library)
: m_defaultStatusCB(((LibraryImpl *)library)->defaultStatusCB()),
m_defaultStatusCBUserPtr(
((LibraryImpl *)library)->defaultStatusCBUserPtr())
{}
ANARIDevice DeviceImpl::this_device() const
{
return (ANARIDevice)this;
}
ANARIStatusCallback DeviceImpl::defaultStatusCallback() const
{
return m_defaultStatusCB;
}
const void *DeviceImpl::defaultStatusCallbackUserPtr() const
{
return m_defaultStatusCBUserPtr;
}
bool DeviceImpl::handleIsDevice(ANARIObject obj) const
{
return static_cast<const void *>(obj) == static_cast<const void *>(this);
}
ANARI_TYPEFOR_DEFINITION(DeviceImpl *);
} // namespace anari