Skip to content

Introducing namespace cudaq_internal#4101

Open
Renaud-K wants to merge 1 commit intoNVIDIA:mainfrom
Renaud-K:cpp-guidelines
Open

Introducing namespace cudaq_internal#4101
Renaud-K wants to merge 1 commit intoNVIDIA:mainfrom
Renaud-K:cpp-guidelines

Conversation

@Renaud-K
Copy link
Collaborator

@Renaud-K Renaud-K commented Mar 5, 2026

It occurred to me that under this proposal, it is still not quite clear to users whether they are accessing internal functionality or not. There is the possibility that internal headers are included transitively. In this case nothing can really prevent a user from using an internal class. For instance:

cudaq::compiler::Compiler c;

I believe this means that we need to introduce a cudaq_internal namespace along with the cudaq_internal root for header files.
This is what this PR is proposing.

Along with it, I am adding guidelines from the LLVM coding standard which are relevant.

Signed-off-by: Renaud Kauffmann <rkauffmann@nvidia.com>
@Renaud-K Renaud-K requested a review from amccaskey March 5, 2026 21:29
@schweitzpgi
Copy link
Collaborator

schweitzpgi commented Mar 5, 2026

We had already settled on a namespace of cudaq::detail for "internal use only" artifacts.

I think @khalatepradnya had a PR to standardize that once upon a time, and there are all manner of "alternative spellings" IIRC. internal, __internal__, detail, details, my_dog_fido, ...

@schweitzpgi schweitzpgi added the runtime CUDA quantum runtime label Mar 5, 2026
@khalatepradnya
Copy link
Collaborator

We had already settled on a namespace of cudaq::detail for "internal use only" artifacts.

I think @khalatepradnya had a PR to standardize that once upon a time, and there are all manner of "alternative spellings" IIRC. internal, __internal__, detail, details, my_dog_fido, ...

It was this PR #2946.
Unfortunately, it was nixed owing to some incoming refactoring...

@Renaud-K
Copy link
Collaborator Author

Renaud-K commented Mar 5, 2026

detail is a sub namespace for private implementations. I don't think it is suited here because although the modules are internal, they do have an externally facing interface.
There are 3 levels of API:

  1. private (detail or anonymous)
  2. internal public in the cmake sense (cudaq_internal::compiler)
  3. user facing (cudaq::ptsb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

runtime CUDA quantum runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants