From 7853f5e35a5540cc33274b219bf57b800aac15bc Mon Sep 17 00:00:00 2001 From: Ben Howe Date: Mon, 9 Mar 2026 16:39:06 -0700 Subject: [PATCH 1/2] Bump CUDA-Q commit and modify custom patches Signed-off-by: Ben Howe --- .cudaq_version | 2 +- scripts/ci/build_cudaq_wheel.sh | 63 ++++++++------------------------- 2 files changed, 16 insertions(+), 49 deletions(-) diff --git a/.cudaq_version b/.cudaq_version index 48532830..6215d3eb 100644 --- a/.cudaq_version +++ b/.cudaq_version @@ -1,6 +1,6 @@ { "cudaq": { "repository": "NVIDIA/cuda-quantum", - "ref": "ba4632a0558310cd1464636144a9898e57d6b4b8" + "ref": "39ca4ab6d44cd7be3cf5e1c00d56e65c763267f0" } } diff --git a/scripts/ci/build_cudaq_wheel.sh b/scripts/ci/build_cudaq_wheel.sh index 2023337a..91a38f37 100644 --- a/scripts/ci/build_cudaq_wheel.sh +++ b/scripts/ci/build_cudaq_wheel.sh @@ -1,7 +1,7 @@ #!/bin/sh # ============================================================================ # -# Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. # +# Copyright (c) 2022 - 2026 NVIDIA Corporation & Affiliates. # # All rights reserved. # # # # This source code and the accompanying materials are made available under # @@ -87,66 +87,33 @@ echo "Building CUDA-Q." cd /cuda-quantum CUDAQ_PATCH='diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3f2c138..ddb15b3 100644 +index dc906f615..5d591ea06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -540,7 +540,7 @@ add_subdirectory(tools) - add_subdirectory(utils) - +@@ -682,7 +682,7 @@ if(CUDAQ_BUILD_TESTS) + endif() + if (CUDAQ_ENABLE_PYTHON) - find_package(Python 3 COMPONENTS Interpreter Development) + find_package(Python 3 COMPONENTS Interpreter Development.Module) - + # Apply specific patch to pybind11 for our documentation. # Only apply the patch if not already applied. diff --git a/python/runtime/cudaq/domains/plugins/CMakeLists.txt b/python/runtime/cudaq/domains/plugins/CMakeLists.txt -index 7b7541d..2261334 100644 +index 675919e25..7de85b815 100644 --- a/python/runtime/cudaq/domains/plugins/CMakeLists.txt +++ b/python/runtime/cudaq/domains/plugins/CMakeLists.txt -@@ -17,6 +17,6 @@ if (SKBUILD) - if (NOT Python_FOUND) - message(FATAL_ERROR "find_package(Python) not run?") - endif() -- target_link_libraries(cudaq-pyscf PRIVATE Python::Python pybind11::pybind11 cudaq-chemistry cudaq-operator cudaq cudaq-py-utils) -+ target_link_libraries(cudaq-pyscf PRIVATE Python::Module pybind11::pybind11 cudaq-chemistry cudaq-operator cudaq cudaq-py-utils) +@@ -31,7 +31,7 @@ else() + endif() + target_link_libraries(cudaq-pyscf + PRIVATE +- Python::Python pybind11::pybind11 ++ Python::Module pybind11::pybind11 + cudaq-chemistry cudaq-operator cudaq cudaq-py-utils cudaq-platform-default) endif() - install(TARGETS cudaq-pyscf DESTINATION lib/plugins)' - -CUDAQ_PATCH2='diff --git a/lib/Frontend/nvqpp/ConvertDecl.cpp b/lib/Frontend/nvqpp/ConvertDecl.cpp -index 149959c8e..ea23990f6 100644 ---- a/lib/Frontend/nvqpp/ConvertDecl.cpp -+++ b/lib/Frontend/nvqpp/ConvertDecl.cpp -@@ -169,8 +169,10 @@ bool QuakeBridgeVisitor::interceptRecordDecl(clang::RecordDecl *x) { - auto fnTy = cast(popType()); - return pushType(cc::IndirectCallableType::get(fnTy)); - } -- auto loc = toLocation(x); -- TODO_loc(loc, "unhandled type, " + name + ", in cudaq namespace"); -+ if (!isInNamespace(x, "solvers") && !isInNamespace(x, "qec")) { -+ auto loc = toLocation(x); -+ TODO_loc(loc, "unhandled type, " + name + ", in cudaq namespace"); -+ } - } - if (isInNamespace(x, "std")) { - if (name.equals("vector")) { -diff --git a/lib/Frontend/nvqpp/ConvertExpr.cpp b/lib/Frontend/nvqpp/ConvertExpr.cpp -index e6350d1c5..28c98c6cb 100644 ---- a/lib/Frontend/nvqpp/ConvertExpr.cpp -+++ b/lib/Frontend/nvqpp/ConvertExpr.cpp -@@ -2050,7 +2050,9 @@ bool QuakeBridgeVisitor::VisitCallExpr(clang::CallExpr *x) { - return pushValue(call.getResult(0)); - } - -- TODO_loc(loc, "unknown function, " + funcName + ", in cudaq namespace"); -+ if (!isInNamespace(func, "solvers") && !isInNamespace(func, "qec")) { -+ TODO_loc(loc, "unknown function, " + funcName + ", in cudaq namespace"); -+ } - } // end in cudaq namespace - - if (isInNamespace(func, "std")) {' +' echo "$CUDAQ_PATCH" | git apply --verbose -echo "$CUDAQ_PATCH2" | git apply --verbose $python -m venv --system-site-packages .venv source .venv/bin/activate From 436d33e3e800b2b2d6294757e73cb7b5f127779e Mon Sep 17 00:00:00 2001 From: Ben Howe Date: Mon, 9 Mar 2026 20:46:35 -0700 Subject: [PATCH 2/2] Another patch update Signed-off-by: Ben Howe --- .github/workflows/scripts/build_cudaq.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/scripts/build_cudaq.sh b/.github/workflows/scripts/build_cudaq.sh index 1486113e..ca476512 100755 --- a/.github/workflows/scripts/build_cudaq.sh +++ b/.github/workflows/scripts/build_cudaq.sh @@ -106,23 +106,23 @@ echo "Building MLIR bindings for ${python}" && \ # ============================================================================== CUDAQ_PATCH='diff --git a/CMakeLists.txt b/CMakeLists.txt -index e12aed8871..d2960728e4 100644 +index dc906f615..5d591ea06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -657,7 +657,7 @@ if(CUDAQ_BUILD_TESTS) +@@ -682,7 +682,7 @@ if(CUDAQ_BUILD_TESTS) endif() - + if (CUDAQ_ENABLE_PYTHON) - find_package(Python 3 COMPONENTS Interpreter Development) + find_package(Python 3 COMPONENTS Interpreter Development.Module) - + # Apply specific patch to pybind11 for our documentation. # Only apply the patch if not already applied. diff --git a/python/runtime/cudaq/domains/plugins/CMakeLists.txt b/python/runtime/cudaq/domains/plugins/CMakeLists.txt -index cf0197f9fd..cceb843bdc 100644 +index 675919e25..7de85b815 100644 --- a/python/runtime/cudaq/domains/plugins/CMakeLists.txt +++ b/python/runtime/cudaq/domains/plugins/CMakeLists.txt -@@ -27,7 +27,7 @@ else() +@@ -31,7 +31,7 @@ else() endif() target_link_libraries(cudaq-pyscf PRIVATE