Maestro 0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
GpuLibraryRegistry.h
Go to the documentation of this file.
1
2#pragma once
3
4#ifdef __linux__
5#include "GpuLibrary.h"
6#include <memory>
7#include <string>
8#include <utility>
9
10namespace Simulators
11{
12class GpuLibraryRegistry
13{
14 public:
15 explicit GpuLibraryRegistry(std::string path = "libmaestro_gpu_simulators.so") : path(std::move(path))
16 {
17 }
18
19 std::shared_ptr<GpuLibrary> Acquire(int device, bool mute = false)
20 {
21 auto library = GpuLibrary::GetInstance();
22 return library->InitializeForDevice(path.c_str(), device, mute) ? library : nullptr;
23 }
24
25 int DeviceCount()
26 {
27 return GpuLibrary::GetInstance()->DiscoverDevices(path.c_str());
28 }
29
30 private:
31 std::string path;
32};
33} // namespace Simulators
34#endif
Bounded online routing based on current physical bond dimensions.