60 static bool InitGpuLibraryWithMute();
63 return gpuLibrary && gpuLibrary->IsValid();
66 static std::shared_ptr<GpuLibrary> GetGpuLibrary() {
67 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
71 static std::unique_ptr<GpuLibStateVectorSim> CreateGpuLibStateVectorSim() {
72 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
74 return std::make_unique<GpuLibStateVectorSim>(gpuLibrary);
77 static std::unique_ptr<GpuLibMPSSim> CreateGpuLibMPSSim() {
78 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
80 return std::make_unique<GpuLibMPSSim>(gpuLibrary);
83 static std::unique_ptr<GpuLibTNSim> CreateGpuLibTensorNetSim() {
84 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
86 return std::make_unique<GpuLibTNSim>(gpuLibrary);
89 static std::shared_ptr<GpuStabilizer> CreateGpuStabilizerSimulator() {
90 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
91 return std::make_shared<GpuStabilizer>(gpuLibrary);
94 static std::shared_ptr<GpuPauliPropagator> CreateGpuPauliPropagatorSimulator() {
95 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
96 return std::make_shared<GpuPauliPropagator>(gpuLibrary);
99 static std::unique_ptr<GpuPauliPropagator> CreateGpuPauliPropagatorSimulatorUnique() {
100 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
101 return std::make_unique<GpuPauliPropagator>(gpuLibrary);
105 static std::shared_ptr<GpuLibrary> gpuLibrary;
106 static std::atomic_bool firstTime;