cuda-quantum
cuda-quantum copied to clipboard
Errors should be thrown for a kernel lambda that lacks a __qpu__ attribute
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.