In file included from tmp2.cpp:1:
In file included from /cuda-quantum/runtime/cudaq.h:13:
In file included from /cuda-quantum/runtime/cudaq/qis/qubit_qis.h:15:
In file included from /cuda-quantum/runtime/cudaq/qis/qarray.h:12:
In file included from /cuda-quantum/runtime/cudaq/qis/qview.h:12:
In file included from /cuda-quantum/runtime/cudaq/qis/qudit.h:11:
In file included from /cuda-quantum/runtime/cudaq/qis/execution_manager.h:13:
In file included from /cuda-quantum/runtime/cudaq/spin_op.h:14:
In file included from /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/functional:59:
/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:587:18: error: may not use quantum types in non-kernel functions
operator()(_ArgTypes... __args) const
^
error: C++ source has errors. nvq++ cannot proceed.
presumably due to qview<> in the std::function type triggering the "quantum types not allowed" error at ASTBridge.cpp:318. I'm not sure how to make the bridge view this as valid.
This is a useful programming pattern when building libraries.
This seems to be working in the AST-Quake/callable-2.cpp test file . In fact the above code compiles if I change the qview to a qubit& and update the function body accordingly. It also works if I change to qvector<>& in the functional argument. Not sure why qview<> does not work.
produces the following error
presumably due to
qview<>
in thestd::function
type triggering the "quantum types not allowed" error atASTBridge.cpp:318
. I'm not sure how to make the bridge view this as valid.This is a useful programming pattern when building libraries.
This seems to be working in the
AST-Quake/callable-2.cpp
test file . In fact the above code compiles if I change theqview
to aqubit&
and update the function body accordingly. It also works if I change toqvector<>&
in the functional argument. Not sure whyqview<>
does not work.