Wrap kernel with target
Nobody has claimed this yet.
- 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
Currently, set_target is set globally and if we wanted to offload different kernels onto different architectures we could do this:
cudaq.set_target("superconducting")
@cudaq.kernel
def kernel_1()
pass
#execute kernel 1 onto superconducting
cudaq.set_target("photonic")
@cudaq.kernel
def kernel_2()
pass
#execute kernel 2 on photonic now that the target has been changed
This however is not natural and somewhat cumbersome as we have to have things defined in a sequential manner.
I think wrapping a target to a kernel is more natural:
@cudaq.kernel(target = 'superconducting')
def kernel_1()
pass
@cudaq.kernel(target = 'photonic')
def kernel_2()
pass
#execute kernel 1 onto superconducting
#execute kernel 2 onto photonic
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing set_target implementation and the cudaq.kernel decorator, then trace how targets are selected when kernels execute. The issue does not name specific files or tests; done would mean allowing each kernel to retain its own target so different kernels can run on different architectures without sequential global changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- quantum-computing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100