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

Compiler crash when compiling a kernel with std::uint8_t as argument #344

Closed
3 tasks done
boschmitt opened this issue Jul 3, 2023 · 0 comments
Closed
3 tasks done
Assignees
Labels
bug Something isn't working

Comments

@boschmitt
Copy link
Collaborator

Required prerequisites

  • Make sure you've read the documentation. Your issue may be addressed there.
  • Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
  • If possible, make a PR with a failing test to give us a starting point to work on!

Describe the bug

The compiler is crashing when trying to compile kernels that take values of type std::uint8_t, std::size_t, and possibly other similar types as arguments.

Example:

#include <cudaq.h>
#include <iostream>

__qpu__ void variable_qreg(std::uint8_t value) {
  cudaq::qreg qubits(value);
  mz(qubits);
}

int main() {
  for (auto i = 1; i < 5; ++i) {
    auto result = cudaq::sample(1000, variable_qreg, i);
    std::cout << result.most_probable() << '\n';
  }
  return 0;
}

Steps to reproduce the bug

Try to compile the above program.

Expected behavior

Compiler should not crash.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

  • CUDA Quantum version: main
  • Python version:
  • C++ compiler: gcc 12
  • Operating system: Ubuntu 22.04 (x86-64, docker)

Suggestions

No response

@bettinaheim bettinaheim added bug Something isn't working needs triage Marks items that require a follow up for proper processing labels Jul 5, 2023
@bettinaheim bettinaheim removed the needs triage Marks items that require a follow up for proper processing label Jul 6, 2023
MarkusPfundstein pushed a commit to fermioniq/cuda-quantum that referenced this issue Sep 23, 2024
…#356)

* Fix NVIDIA#344 - no support for std::uint8_t kernel argument

Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>

---------

Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants