Skip to content

Commit

Permalink
Fix a bug in sample.h affecting sample_async in library mode (#1379)
Browse files Browse the repository at this point in the history
In library mode, we need to run a tracing pass before actual execution.
With multi-qpu, we set_exec_ctx on specific qpu id but didn't reset the
context on that particular qpu id (fall back to reset QPU 0 context all
the time).
  • Loading branch information
1tnguyen committed Mar 12, 2024
1 parent db27c40 commit 0c8e28b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/cudaq/algorithms/sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ runSampling(KernelFunctor &&wrappedKernel, quantum_platform &platform,
auto &platform = get_platform();
platform.set_exec_ctx(&context, qpu_id);
wrappedKernel();
platform.reset_exec_ctx();
platform.reset_exec_ctx(qpu_id);
// In trace mode, if we have a measure result
// that is passed to an if statement, then
// we'll have collected registernames
Expand Down

0 comments on commit 0c8e28b

Please sign in to comment.