Skip to content

Commit 8b9a8f5

Browse files
Reset platformCurrentQPU when we setTargetBackend (#3607)
Signed-off-by: Thien Nguyen <[email protected]> Co-authored-by: Bettina Heim <[email protected]>
1 parent f64dd86 commit 8b9a8f5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

runtime/cudaq/platform/mqpu/MultiQPUPlatform.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
157157
if (qpuSubType == "NvcfSimulatorQPU") {
158158
platformQPUs.clear();
159159
threadToQpuId.clear();
160+
platformCurrentQPU = 0;
160161
auto simName = getOpt(description, "backend");
161162
if (simName.empty())
162163
simName = "custatevec-fp32";
@@ -203,6 +204,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
203204
auto urls = cudaq::split(getOpt(description, "url"), ',');
204205
platformQPUs.clear();
205206
threadToQpuId.clear();
207+
platformCurrentQPU = 0;
206208
for (std::size_t qId = 0; qId < urls.size(); ++qId) {
207209
// Populate the information and add the QPUs
208210
platformQPUs.emplace_back(cudaq::registry::get<cudaq::QPU>("orca"));
@@ -249,6 +251,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
249251
sims.size(), urls.size()));
250252
platformQPUs.clear();
251253
threadToQpuId.clear();
254+
platformCurrentQPU = 0;
252255
for (std::size_t qId = 0; qId < urls.size(); ++qId) {
253256
const auto simName = sims.size() == 1 ? sims.front() : sims[qId];
254257
// Populate the information and add the QPUs

0 commit comments

Comments
 (0)