Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Howe <[email protected]>
bmhowe23 committed Jan 18, 2025
1 parent 7070990 commit bb7b874
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions libs/qec/lib/decoder.cpp
Original file line number Diff line number Diff line change
@@ -7,15 +7,13 @@
******************************************************************************/

#include "cudaq/qec/decoder.h"
#include "cuda-qx/core/library_utils.h"
#include "cudaq/qec/plugin_loader.h"
#include "cudaq/utils/cudaq_utils.h"
#include <cassert>
#include <dlfcn.h>
#include <filesystem>
#include <vector>

#include "cuda-qx/core/library_utils.h"

INSTANTIATE_REGISTRY(cudaq::qec::decoder, const cudaqx::tensor<uint8_t> &)
INSTANTIATE_REGISTRY(cudaq::qec::decoder, const cudaqx::tensor<uint8_t> &,
const cudaqx::heterogeneous_map &)
4 changes: 0 additions & 4 deletions libs/qec/lib/plugin_loader.cpp
Original file line number Diff line number Diff line change
@@ -19,15 +19,13 @@ static std::map<std::string, PluginHandle> &get_plugin_handles() {

// Function to load plugins from a directory based on their type
void load_plugins(const std::string &plugin_dir, PluginType type) {
printf("BMH Loading plugins from %s\n", plugin_dir.c_str());
if (!fs::exists(plugin_dir)) {
std::cerr << "WARNING: Plugin directory does not exist: " << plugin_dir
<< std::endl;
return;
}
for (const auto &entry : fs::directory_iterator(plugin_dir)) {
if (entry.path().extension() == ".so") {
printf("BMH Opening %s\n", entry.path().c_str());
void *raw_handle = dlopen(entry.path().c_str(), RTLD_NOW);
if (raw_handle) {
// Custom deleter ensures dlclose is called
@@ -43,8 +41,6 @@ void load_plugins(const std::string &plugin_dir, PluginType type) {
std::cerr << "ERROR: Failed to load plugin: " << entry.path()
<< " Error: " << dlerror() << std::endl;
}
} else {
printf("BMH Skipping %s\n", entry.path().c_str());
}
}
}

0 comments on commit bb7b874

Please sign in to comment.