+117
−40
+22
−6
+3
−1
Loading
The Python ref type (custom type) will be propagated to C++ kernels, e.g. int& or double&. This will make sure that nested kernels (a kernel calls other kernels) will support pass-by-reference appropriately.
The difficulty is *inline* unpacking to a r-val is not compatible with the by-reference ctor arg. Hence, adjust the codegen to upack those special cases to local var before passing to the ctor.
This will only occur at the Python-C++ interface level where we have a special mechanism to persist these pass-by-ref vars to the qreg and reflect them back to the Python side.
Signed-off-by:
Thien Nguyen <nguyentm@ornl.gov>