NVIDIA / NVIDIA/cuda-quantum

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

Open
#2,267 1 comment 0 reactions 2 assignees View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.