cucim icon indicating copy to clipboard operation
cucim copied to clipboard

Refactoring kernel code into .cu/.c files

Open jakirkham opened this issue 2 years ago • 1 comments

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

jakirkham avatar Aug 02 '22 20:08 jakirkham

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 strs. 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

jakirkham avatar Nov 30 '22 06:11 jakirkham