NVIDIA / NVIDIA/cuda-quantum

Support naming kernels created using `kernel_builder`

Open
#636 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement kernel builder stale-notified
Dominant language
C++
Stars
1.1k
Forks
456
Avg merge
1d 22h
Merged PRs (30d)
165

Description

Required prerequisites
  • Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.
Describe the feature

When initializing a kernel using kernel_builder, its name is automatically generated as __nvqpp__mlirgen____nvqppBuilderKernel followed by a 12-digit suffix:

https://github.com/NVIDIA/cuda-quantum/blob/77cbcd1ab00ef597727858abb9e248602c53c27d/runtime/cudaq/builder/kernel_builder.cpp#L135-L138

This makes it hard to read the output quake code, and thus, debug it.
Would it be possible to support overriding the default name?
Since kernel names must be unique, a (random or counting) suffix could be added to differentiate duplicate names.

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.

Research direction

Start with runtime/cudaq/builder/kernel_builder.cpp around lines 135-138, where the default kernel name is generated, and inspect how that name reaches the output Quake code. Define how callers override the name and how duplicate names remain unique. Done means named kernels produce readable Quake output without collisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.