Errors should be thrown for a kernel lambda that lacks a __qpu__ attribute
Open
@schweitzpgi is already working on this.
Since Oct 10, 2024.
stale-notified
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 455
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 165
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.