forked from KhronosGroup/ANARI-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DebugLibrary.cpp
48 lines (36 loc) · 1.28 KB
/
DebugLibrary.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
// Copyright 2023-2024 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#include "DebugDevice.h"
#include "anari/backend/LibraryImpl.h"
#include "anari/ext/debug/debug_device_exports.h"
namespace anari {
namespace debug_device {
struct DebugLibrary : public anari::LibraryImpl
{
DebugLibrary(
void *lib, ANARIStatusCallback defaultStatusCB, const void *statusCBPtr);
ANARIDevice newDevice(const char *subtype) override;
const char **getDeviceExtensions(const char *deviceType) override;
};
// Definitions ////////////////////////////////////////////////////////////////
DebugLibrary::DebugLibrary(
void *lib, ANARIStatusCallback defaultStatusCB, const void *statusCBPtr)
: anari::LibraryImpl(lib, defaultStatusCB, statusCBPtr)
{}
ANARIDevice DebugLibrary::newDevice(const char * /*subtype*/)
{
return (ANARIDevice) new DebugDevice(this_library());
}
const char **DebugLibrary::getDeviceExtensions(const char * /*deviceType*/)
{
return nullptr;
}
} // namespace debug_device
} // namespace anari
// Define library entrypoint //////////////////////////////////////////////////
extern "C" DEBUG_DEVICE_INTERFACE ANARI_DEFINE_LIBRARY_ENTRYPOINT(
debug, handle, scb, scbPtr)
{
return (ANARILibrary) new anari::debug_device::DebugLibrary(
handle, scb, scbPtr);
}