cucim
cucim copied to clipboard
Refactoring kernel code into .cu/.c files
In a few cases, we have needed to include kernel code in strings in Python. It would be good to start refactoring this out into separate .cu/.c files that we load instead. This has the benefit that .cu/.c files are more familiar to developers and various tooling (linters/compilers/etc.). Also it can potentially be used in C/C++ code directly. Making this change could help with general maintainability & usability of the codebase going forward.
Originally posted by @jakirkham in https://github.com/rapidsai/cucim/pull/317#discussion_r934985904
As one example of this kind of change, please see commit ( https://github.com/rapidsai/cucim/pull/317/commits/2608b2e9771ea4143f10ca8c29660cc0a19150ca ). There are some other CUDA or C/C++ codes in Python str
s. It would likely be simple to refactor these out into .cu
or .c
/.cpp
.
A separate, but related question would be how we would like to use these on the C++ side.
Edit: Here are a few more examples