-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sketch the implementation of
runTheKernel
.
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
- Loading branch information
1 parent
d53ced2
commit 833c3cf
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. * | ||
* All rights reserved. * | ||
* * | ||
* This source code and the accompanying materials are made available under * | ||
* the terms of the Apache License 2.0 which accompanies this distribution. * | ||
******************************************************************************/ | ||
|
||
#include "cudaq/algorithms/run.h" | ||
#include "common/ExecutionContext.h" | ||
#include "cudaq/simulators.h" | ||
#include "nvqir/CircuitSimulator.h" | ||
|
||
cudaq::details::RunResultSpan cudaq::details::runTheKernel( | ||
std::function<void()> &&kernel, quantum_platform &platform, | ||
const std::string &kernel_name, std::size_t shots) { | ||
// 1. Clear the outputLog. | ||
auto *circuitSimulator = nvqir::getCircuitSimulatorInternal(); | ||
auto *currentContext = circuitSimulator->getExecutionContext(); | ||
currentContext->outputLog.clear(); | ||
|
||
// 2. Launch the kernel on the QPU. | ||
// 3. Pass the outputLog to the decoder (target-specific?) | ||
// 4. Get the buffer and length of buffer (in bytes) from the decoder. | ||
// 5. Clear the outputLog (?) | ||
// 6. Pass the span back as a RunResultSpan. | ||
return {nullptr, 0}; | ||
} |