summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMukund Keshava <mkeshava@nvidia.com>2025-06-19 05:44:24 +0530
committerGitHub <noreply@github.com>2025-06-19 00:14:24 +0000
commit9d01a903130d9185abd9bea3387fb363f7b2e119 (patch)
tree30ff39653fc623ef5a1acc26d6bb8f2aeb2bc51c
parent82418b16a135825e51a2afda3c6a00758615ba27 (diff)
Fix cuda_fp16 header issue (#7476)
* Fix cuda_fp16 header issue This fixes the header include issue. However, it does not add a diagnostic. That will be added in a separate PR. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
-rw-r--r--source/compiler-core/slang-nvrtc-compiler.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/compiler-core/slang-nvrtc-compiler.cpp b/source/compiler-core/slang-nvrtc-compiler.cpp
index 162e91353..950a1fc6e 100644
--- a/source/compiler-core/slang-nvrtc-compiler.cpp
+++ b/source/compiler-core/slang-nvrtc-compiler.cpp
@@ -127,7 +127,7 @@ protected:
nvrtcProgram m_program;
};
- SlangResult _findCUDAIncludePath(String& outIncludePath);
+ SlangResult _findCUDAIncludePath(String& outPath);
SlangResult _getCUDAIncludePath(String& outIncludePath);
SlangResult _findOptixIncludePath(String& outIncludePath);
@@ -706,10 +706,13 @@ SlangResult NVRTCDownstreamCompiler::_findCUDAIncludePath(String& outPath)
}
#if SLANG_LINUX_FAMILY
- // Try /usr/include
- {
- String includePath = "/usr/include";
+ List<String> candidatePaths;
+ candidatePaths.add("/usr/local/include");
+ candidatePaths.add("/usr/local/cuda/include");
+ candidatePaths.add("/usr/include");
+ for (const String& includePath : candidatePaths)
+ {
if (File::exists(Path::combine(includePath, g_fp16HeaderName)))
{
outPath = includePath;
@@ -717,7 +720,6 @@ SlangResult NVRTCDownstreamCompiler::_findCUDAIncludePath(String& outPath)
}
}
#endif
-
return SLANG_E_NOT_FOUND;
}