Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding r-val overload (QuakeValue &&) for kernel_builder adjoint modifier #99

Merged
merged 4 commits into from
Apr 30, 2023

Conversation

1tnguyen
Copy link
Collaborator

Description

kernel.t<cudaq::adj>(qubits[0]); will fail to compile with error

cannot convert ‘cudaq::QuakeValue::operator[](std::size_t)(0)’ (type ‘cudaq::QuakeValue’) to type ‘cudaq::QuakeValue&’

Root cause: we don't have the Rvalue overload for the adjoint case.

Fix: add the missing Rvalue overload, which redirects to the existing Lvalue implementation. This is similar to the base case (no modifier).

Tested by: adding a unit test case (checkAdjointOpRvalQuakeValue) to BuilderTester; compiling and running unit tests.

Checklist:

  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
    Not sure if needed?
  • I have read the CONTRIBUTING document.

…fier

Issue: `kernel.t<cudaq::adj>(qubits[0]);` will fail to compile with error

```
cannot convert ‘cudaq::QuakeValue::operator[](std::size_t)(0)’ (type ‘cudaq::QuakeValue’) to type ‘cudaq::QuakeValue&’
```

Root cause: we don't have the R-val overload for the adjoint case.

Fix: add the missing r-val overload, which redirects to the l-val implementation. This is similar to the base case (no modifier).

Tests by: adding a unit test case (`checkAdjointOpRvalQuakeValue`) to BuilderTester; compiling and running unit tests.

Signed-off-by: Thien Nguyen <thien.md.nguyen@gmail.com>
@amccaskey amccaskey enabled auto-merge (squash) April 30, 2023 18:57
@amccaskey amccaskey merged commit 37d6520 into NVIDIA:main Apr 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2023
@bettinaheim bettinaheim added the bug fix To be listed under Bug Fixes in the release notes label Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix To be listed under Bug Fixes in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants