Skip to content

Commit 9563a6a

Browse files
Adapt to CUDA-Q internal-namespace unification (cudaq::detail) (#583)
## Description Adapt CUDA-QX to CUDA-Q [PR #4663](NVIDIA/cuda-quantum#4663), which unified CUDA-Q's internal-use namespaces (`details` / `internal` / `__internal__` / `__internal`) into a single `cudaq::detail`. - Update references `cudaq::details::` → `cudaq::detail::`: - `should_log` / `LogLevel` — `libs/qec/lib/decoder.cpp`, `libs/qec/lib/realtime/config.cpp`, `libs/qec/lib/decoders/plugins/trt_decoder/trt_decoder.cpp` - `runObservation` — `libs/solvers/include/cudaq/solvers/observe_gradient.h` - Bump `.cudaq_version` to the #4663 commit (`f14de75d0dad64fa8b82f8ac1b28a46206b8b73d`). Pinned to exactly the #4663 commit rather than top-of-tree to avoid pulling in CUDA-Q #4655 ("Deprecating library mode," which removes nvq++'s `--enable-mlir`) — that is an unrelated adaptation best handled in its own PR. ## Runtime / performance impact N/A — namespace rename and version-pin bump only; no behavior change. Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com>
1 parent e937431 commit 9563a6a

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

.cudaq_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cudaq": {
33
"repository": "NVIDIA/cuda-quantum",
4-
"ref": "ae64ffbb01cd277d742c4a838bf6175382c8cedf"
4+
"ref": "f14de75d0dad64fa8b82f8ac1b28a46206b8b73d"
55
}
66
}

libs/qec/lib/decoder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ bool decoder::enqueue_syndrome(const uint8_t *syndrome,
287287
std::chrono::duration<double> log_dur1, log_dur2, log_dur3;
288288

289289
const bool log_due_to_log_level =
290-
cudaq::details::should_log(cudaq::details::LogLevel::info);
290+
cudaq::detail::should_log(cudaq::detail::LogLevel::info);
291291
const bool should_log = pimpl->should_log || log_due_to_log_level;
292292

293293
if (should_log) {
@@ -423,7 +423,7 @@ void decoder::clear_corrections() {
423423
pimpl->corrections.clear();
424424
pimpl->corrections.resize(O_sparse.size());
425425
const bool log_due_to_log_level =
426-
cudaq::details::should_log(cudaq::details::LogLevel::info);
426+
cudaq::detail::should_log(cudaq::detail::LogLevel::info);
427427
const bool should_log = pimpl->should_log || log_due_to_log_level;
428428
if (should_log) {
429429
pimpl->log_counter++;
@@ -439,7 +439,7 @@ void decoder::clear_corrections() {
439439

440440
const uint8_t *decoder::get_obs_corrections() const {
441441
const bool log_due_to_log_level =
442-
cudaq::details::should_log(cudaq::details::LogLevel::info);
442+
cudaq::detail::should_log(cudaq::detail::LogLevel::info);
443443
const bool should_log = pimpl->should_log || log_due_to_log_level;
444444
if (should_log) {
445445
pimpl->log_counter++;
@@ -465,7 +465,7 @@ void decoder::reset_decoder() {
465465
pimpl->corrections.clear();
466466
pimpl->corrections.resize(O_sparse.size());
467467
const bool log_due_to_log_level =
468-
cudaq::details::should_log(cudaq::details::LogLevel::info);
468+
cudaq::detail::should_log(cudaq::detail::LogLevel::info);
469469
const bool should_log = pimpl->should_log || log_due_to_log_level;
470470
if (should_log) {
471471
pimpl->log_counter++;

libs/qec/lib/decoders/plugins/trt_decoder/trt_decoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ std::vector<decoder_result> trt_decoder::decode_batch_impl(
915915
size_t total_input_nonzero = 0;
916916
size_t total_residual_nonzero = 0;
917917
const bool log_residual_counts =
918-
cudaq::details::should_log(cudaq::details::LogLevel::info);
918+
cudaq::detail::should_log(cudaq::detail::LogLevel::info);
919919

920920
for (size_t batch_start = 0; batch_start < syndromes.size();
921921
batch_start += model_batch_size_) {

libs/qec/lib/realtime/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ void log_config(const char *config_str, bool from_file) {
557557
}();
558558

559559
if (dump_config) {
560-
if (cudaq::details::should_log(cudaq::details::LogLevel::info)) {
560+
if (cudaq::detail::should_log(cudaq::detail::LogLevel::info)) {
561561
CUDAQ_INFO(
562562
"Initializing realtime decoding library with config string: {}",
563563
config_str);

libs/solvers/include/cudaq/solvers/observe_gradient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class observe_gradient
6060
auto &platform = cudaq::get_platform();
6161
std::string kernelName =
6262
"auto_gradient_kernel_calc_" + std::to_string(batchIdx);
63-
auto result = cudaq::details::runObservation(
63+
auto result = cudaq::detail::runObservation(
6464
[&]() { quantumFunction(x); }, const_cast<spin_op &>(op), platform,
6565
shots, kernelName, 0, nullptr, batchIdx, numRequiredExpectations);
6666
data.emplace_back(x, result.value(), observe_execution_type::gradient);

0 commit comments

Comments
 (0)