You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
Make sure you've read the documentation. Your issue may be addressed there.
Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
If possible, make a PR with a failing test to give us a starting point to work on!
Describe the bug
If you use a while loop inside a kernel with two conditions, the code fails and produces the following error.
python: /usr/local/llvm/include/llvm/Support/Casting.h:579: decltype(auto) llvm::cast(From*) [with To = mlir::arith::CmpIOp; From = mlir::Operation]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed.
Aborted (core dumped)
Steps to reproduce the bug
import cudaq
@cudaq.kernel
def test():
reg = cudaq.qvector(5)
y=1
x=0
while x < 4 and y==1:
h(reg)
x+=1
print(cudaq.sample(test))
Expected behavior
Expect the while loop to execute with the given logic.
Is this a regression? If it is, put the last known working version (or commit) here.
I can reproduce the issue while using docker images cu12-0.9.1 (stable) and cu12-latest (nightly).
The error can be bypassed by rewriting the loop condition, the following is equivalent but arguably a bit uglier:
Required prerequisites
Describe the bug
If you use a while loop inside a kernel with two conditions, the code fails and produces the following error.
python: /usr/local/llvm/include/llvm/Support/Casting.h:579: decltype(auto) llvm::cast(From*) [with To = mlir::arith::CmpIOp; From = mlir::Operation]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed.
Aborted (core dumped)
Steps to reproduce the bug
Expected behavior
Expect the while loop to execute with the given logic.
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
Suggestions
No response
The text was updated successfully, but these errors were encountered: