MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / enqueueAsyncTask

Method enqueueAsyncTask

runtime/cudaq/platform/quantum_platform.cpp:147–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147std::future<sample_result>
148quantum_platform::enqueueAsyncTask(const std::size_t qpu_id,
149 KernelExecutionTask &task) {
150 std::promise<sample_result> promise;
151 auto f = promise.get_future();
152 QuantumTask wrapped = detail::make_copyable_function(
153 [p = std::move(promise), t = task]() mutable {
154 auto counts = t();
155 p.set_value(counts);
156 });
157
158 platformQPUs[qpu_id]->enqueue(wrapped);
159 return f;
160}
161
162void quantum_platform::enqueueAsyncTask(const std::size_t qpu_id,
163 std::function<void()> &f) {

Callers 8

run_async_implFunction · 0.80
runSamplingAsyncPTSBEFunction · 0.80
runObservationAsyncFunction · 0.80
runSamplingAsyncFunction · 0.80
evolve_asyncFunction · 0.80
runGetStateAsyncFunction · 0.80
run_asyncFunction · 0.80

Calls 3

make_copyable_functionFunction · 0.85
tClass · 0.50
enqueueMethod · 0.45

Tested by

no test coverage detected