Change search precedence of CUB path
@@ -167,18 +167,14 @@ def get_compiler_setting(use_hip):
# for <cupy/complex.cuh>
cupy_header = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'../cupy/core/include')
- cub_path = None
- if cuda_path:
- cub_path = os.path.join(cuda_path, 'include', 'cub')
- if os.path.exists(cub_path):
- include_dirs.append(cupy_header)
- else:
- cub_path = None
- if cub_path is None:
cub_path = os.environ.get('CUB_PATH', '')
if os.path.exists(cub_path):
include_dirs.append(cupy_header)
include_dirs.append(cub_path)
+ elif cuda_path:
+ cub_path = os.path.join(cuda_path, 'include', 'cub')
+ if os.path.exists(cub_path):
+ include_dirs.append(cupy_header)
return {
'include_dirs': include_dirs,
