From dc112f41a3409c3c209b7a151c53b0502235c14b Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Wed, 2 Aug 2023 14:48:55 +0100 Subject: [PATCH] Add `numba.cuda` path to NVRTC include path --- numba/cuda/cudadrv/nvrtc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/numba/cuda/cudadrv/nvrtc.py b/numba/cuda/cudadrv/nvrtc.py index 7db321c283c..d10fd90b9cd 100644 --- a/numba/cuda/cudadrv/nvrtc.py +++ b/numba/cuda/cudadrv/nvrtc.py @@ -5,6 +5,7 @@ NvrtcSupportError) import functools +import os import threading import warnings @@ -233,7 +234,11 @@ def compile(src, name, cc): major, minor = cc arch = f'--gpu-architecture=compute_{major}{minor}' include = f'-I{config.CUDA_INCLUDE_PATH}' - options = [arch, include, '-rdc', 'true'] + + cudadrv_path = os.path.dirname(os.path.abspath(__file__)) + numba_cuda_path = os.path.dirname(cudadrv_path) + numba_include = f'-I{numba_cuda_path}' + options = [arch, include, numba_include, '-rdc', 'true'] # Compile the program compile_error = nvrtc.compile_program(program, options)