26#include "GPUReconstructionAvailableBackends.h"
49 if (
type != DeviceType::CPU) {
50 GPUError(
"Cannot create GPUReconstruction for a non-CPU device if DEBUG_STREAMER are enabled");
54 if (
type == DeviceType::CPU) {
58 if (loader && (
retVal = (*loader)->GetPtr(cfg))) {
66 }
else if (
type != DeviceType::CPU) {
81 if (
type == DeviceType::CPU) {
85 return loader !=
nullptr && (*loader)->LoadLibrary() == 0;
91 if (
type == DeviceType::CPU) {
93 }
else if (
type == DeviceType::CUDA) {
97 }
else if (
type == DeviceType::HIP) {
101 }
else if (
type == DeviceType::OCL) {
106 GPUError(
"Error: Invalid device type %u", (uint32_t)
type);
118 if (t == DeviceType::INVALID_DEVICE) {
119 GPUError(
"Invalid device type: %s",
type);
133int32_t GPUReconstruction::LibraryLoader::LoadLibrary()
135 static std::mutex mut;
136 std::lock_guard<std::mutex> lock(mut);
144 if (hGPULib ==
nullptr) {
146 GPUImportant(
"The following error occured during dlopen: %s", dlerror());
148 GPUError(
"Error Opening cagpu library for GPU Tracker (%s)", mLibName);
152 if (createFunc ==
nullptr) {
153 GPUError(
"Error fetching entry function in GPU library\n");
157 mGPULib = (
void*)(
size_t)hGPULib;
158 mGPUEntry = createFunc;
159 GPUInfo(
"GPU Tracker library loaded and GPU tracker object created sucessfully");
170 if (mGPUEntry ==
nullptr) {
179 if (mGPUEntry ==
nullptr) {
static DeviceType GetDeviceType(const char *type)
static constexpr const char *const DEVICE_TYPE_NAMES[]
LibraryLoader(const LibraryLoader &)=delete
static std::shared_ptr< LibraryLoader > sLibHIP
GPUDataTypes::DeviceType DeviceType
static std::shared_ptr< LibraryLoader > * GetLibraryInstance(DeviceType type, bool verbose)
static bool CheckInstanceAvailable(DeviceType type, bool verbose)
static std::shared_ptr< LibraryLoader > sLibOCL
static GPUReconstruction * CreateInstance(const GPUSettingsDeviceBackend &cfg)
static GPUReconstruction * GPUReconstruction_Create_CPU(const GPUSettingsDeviceBackend &cfg)
static std::shared_ptr< LibraryLoader > sLibCUDA
GLint GLint GLsizei GLint GLenum GLenum type
#define LIBRARY_EXTENSION
#define LIBRARY_LOAD(name)
GPUReconstruction * master