Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions source/compiler-core/slang-nvrtc-compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class NVRTCDownstreamCompiler : public DownstreamCompilerBase
nvrtcProgram m_program;
};

SlangResult _findCUDAIncludePath(String& outIncludePath);
SlangResult _findCUDAIncludePath(String& outPath);
SlangResult _getCUDAIncludePath(String& outIncludePath);

SlangResult _findOptixIncludePath(String& outIncludePath);
Expand Down Expand Up @@ -706,18 +706,20 @@ 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;
return SLANG_OK;
}
}
#endif

return SLANG_E_NOT_FOUND;
}

Expand Down
Loading