c.parallel: device wrappers as code, not format strings #3439
+568
−415
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
So far, even with the recent refactoring, the code for the device wrappers lived in format strings. This has a number of downsides, and this PR aims to resolve those.
The wrappers are now actual C++ templates, can be edited with the help of LSP and code formatters, and attempts to obtain their type names will now do some rudimentary type checking in the host code. This is not perfect, as things like
cccl_op_t
carry basically no type information, but is an improvement over the status quo.Also added is a CMake target that bundles all the wrappers into a file that contains their contents, preprocessed to a degree, wrapped into a string, so all the code can be simply added into the NVRTC TU wherever needed.
Resolves #2525
Resolves #2665
Resolves #2918
Checklist