-
Notifications
You must be signed in to change notification settings - Fork 59
Description
[UPDATE OF FEATURE REQUIREMENT]
The original intent of the feature request is, actually to support additional search paths for the NVRTC binding. However, I framed it as if we should allow arbitrary compilation flags for NVRTC. The nvrtc bindings are specific to compiling external functions into a format that can be linked with Numba kernels lowered with nvvm. It require certain consistency with the rest of the compilation pipeline (lto - lto, RDC requirements, etc.). Exposing arbitrary compilation flag to user can cause unpredictable breakage.
Extending the existing search paths globally, is however, a bit less risky.
For arbitrary compilation commands, we should instead support it on a per-library basis. Which can be specified partially based on cuda.core.ProgramOptions interface.
[ORIGINAL]
Is your feature request related to a problem? Please describe.
Currently nvrtc.compile only accepts src, name, cc as input arguments. When we compile a CUDA source. we may want to configure additional compile flags such as -include. To enhance the capability. We should make Numba's nvrtc binding to be more configurable when we need to compile additional feature with Numba.
Describe the solution you'd like
I think there are multiple ways we can achieve this:
- The most straight forward way is to augment the argument list to also accept
**options, and append to the existing option list. But it may take multiple layers of exposing to make it available to the dispatcher, and maybe it's not the most preferable UX too. - Via environment variable. Expose the additional includes via
NUMBA_CUDA_RTC_INCLUDE_PATHSenvironment variable. This makesNumba-cudaeasier to adapt under different setup configuration. But may require better documentation on how it should be set.