cuda-quantum icon indicating copy to clipboard operation
cuda-quantum copied to clipboard

Errors should be thrown for a kernel lambda that lacks a __qpu__ attribute

Open amccaskey opened this issue 4 months ago • 0 comments

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.

amccaskey avatar Oct 10 '24 19:10 amccaskey