Open amccaskey opened 1 month ago
It could be easy (I did it) for someone to write a kernel but forget the qpu attribute. In the following case, an error is not thrown.
#include "cudaq.h" int main() { auto kernel = []() { cudaq::qvector q(2); }; }
The compiler should throw an error for this. It does throw an error for quantum allocations in free functions. I think I just caught it for lambdas.
I think this was intentionally allowed to support passing lambdas to top-level cudaq functions where the "kernel" aspect of the lambda is implied. Maybe we can narrow the loophole or get rid of it entirely.
cudaq
It could be easy (I did it) for someone to write a kernel but forget the qpu attribute. In the following case, an error is not thrown.
The compiler should throw an error for this. It does throw an error for quantum allocations in free functions. I think I just caught it for lambdas.