KEMBAR78
Improved support for kernel return values by schweitzpgi · Pull Request #1009 · NVIDIA/cuda-quantum · GitHub
Skip to content

Conversation

@schweitzpgi
Copy link
Collaborator

Round out the implementation of kernels that return values in the IR and carry that through to LLVM code generation (QIR). This extends the support for scalar numeric return values to include aggregate types. It also fixes some bugs, particularly with dynamically sized aggregate return values.

The principle changes are to GenKernelExecution, which now uses the sret convention to return aggregate values. This actually simplifies the generation of the thunk code since the sret buffer is preallocated and can be passed by pointer rather than having the thunk copy return values itself.

Add a regression test for !cc.stdvec, !cc.struct, !cc.array, and multiple return values.

@github-actions
Copy link

github-actions bot commented Dec 6, 2023

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Dec 6, 2023
@github-actions
Copy link

github-actions bot commented Dec 6, 2023

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Dec 6, 2023
@github-actions
Copy link

github-actions bot commented Dec 6, 2023

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Dec 6, 2023
Copy link
Collaborator

@bmhowe23 bmhowe23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Eric.

Round out the implementation of kernels that return values in the IR and
carry that through to LLVM code generation (QIR). This extends the
support for scalar numeric return values to include aggregate types. It
also fixes some bugs, particularly with dynamically sized aggregate
return values.

The principle changes are to GenKernelExecution, which now uses the sret
convention to return aggregate values. This actually simplifies the
generation of the thunk code since the sret buffer is preallocated and
can be passed by pointer rather than having the thunk copy return
values itself.

Add a regression test for !cc.stdvec, !cc.struct, !cc.array, and
multiple return values.
@schweitzpgi schweitzpgi enabled auto-merge (squash) December 7, 2023 15:58
@schweitzpgi schweitzpgi merged commit f7b6212 into NVIDIA:main Dec 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2023
@schweitzpgi schweitzpgi deleted the ch-return.value branch December 7, 2023 22:50
@bettinaheim bettinaheim added this to the release 0.6.0 milestone Jan 22, 2024
@bettinaheim bettinaheim added the release notes Changes need to be captured in the release notes label Jan 22, 2024
@bettinaheim bettinaheim changed the title Kernels with return values. Improved support for kernel return values Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release notes Changes need to be captured in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants