Skip to content

Commit

Permalink
Merge branch 'main' into ch-veq.type
Browse files Browse the repository at this point in the history
  • Loading branch information
schweitzpgi authored Dec 13, 2024
2 parents a17dc23 + de6699d commit 1f3a597
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/cudaq/platform/default/DefaultQuantumPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class DefaultQuantumPlatform : public cudaq::quantum_platform {
/// specified by that variable.
void setTargetBackend(const std::string &backend) override {
platformQPUs.clear();
threadToQpuId.clear();
platformQPUs.emplace_back(std::make_unique<DefaultQPU>());

cudaq::info("Backend string is {}", backend);
Expand Down Expand Up @@ -121,6 +122,7 @@ class DefaultQuantumPlatform : public cudaq::quantum_platform {
auto qpuName = config.BackendConfig->PlatformQpu;
cudaq::info("Default platform QPU subtype name: {}", qpuName);
platformQPUs.clear();
threadToQpuId.clear();
platformQPUs.emplace_back(cudaq::registry::get<cudaq::QPU>(qpuName));
if (platformQPUs.front() == nullptr)
throw std::runtime_error(
Expand Down
4 changes: 4 additions & 0 deletions runtime/cudaq/platform/mqpu/MultiQPUPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
// Make sure that we clean up the client QPUs first before cleaning up the
// remote servers.
platformQPUs.clear();
threadToQpuId.clear();
platformNumQPUs = 0;
m_remoteServers.clear();
}
Expand Down Expand Up @@ -154,6 +155,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
qpuSubType));
if (qpuSubType == "NvcfSimulatorQPU") {
platformQPUs.clear();
threadToQpuId.clear();
auto simName = getOpt(description, "backend");
if (simName.empty())
simName = "custatevec-fp32";
Expand Down Expand Up @@ -199,6 +201,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
} else if (qpuSubType == "orca") {
auto urls = cudaq::split(getOpt(description, "url"), ',');
platformQPUs.clear();
threadToQpuId.clear();
for (std::size_t qId = 0; qId < urls.size(); ++qId) {
// Populate the information and add the QPUs
platformQPUs.emplace_back(cudaq::registry::get<cudaq::QPU>("orca"));
Expand Down Expand Up @@ -244,6 +247,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
"receiving {}, expecting {}.",
sims.size(), urls.size()));
platformQPUs.clear();
threadToQpuId.clear();
for (std::size_t qId = 0; qId < urls.size(); ++qId) {
const auto simName = sims.size() == 1 ? sims.front() : sims[qId];
// Populate the information and add the QPUs
Expand Down

0 comments on commit 1f3a597

Please sign in to comment.