diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-04-14 14:56:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-14 14:56:15 -0400 |
| commit | bad484d838590d0a2aaf1b5b8ac820634af2decb (patch) | |
| tree | 00d41c9a6df3b4130a705a43b2a481a2e0207fc0 /source | |
| parent | 7fc8e11c378e2f6268ce99a27660aab2aa54c1d8 (diff) | |
NVTRC 64 bit requirement (#1792)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Made 64 bit requirement clearer for CUDA/PTX.
Added compile assert for NVRTC for 32 bit OS, that are known to require 64bit.
* Disabled location of NVRTC on linux/win x86.
* Only restrict NVRTC on windows
* Simplify checking on 64 bit windows for NVRTC.
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/compiler-core/slang-nvrtc-compiler.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/compiler-core/slang-nvrtc-compiler.cpp b/source/compiler-core/slang-nvrtc-compiler.cpp index b581d21fd..b37743a32 100644 --- a/source/compiler-core/slang-nvrtc-compiler.cpp +++ b/source/compiler-core/slang-nvrtc-compiler.cpp @@ -17,6 +17,8 @@ namespace nvrtc { + + typedef enum { NVRTC_SUCCESS = 0, NVRTC_ERROR_OUT_OF_MEMORY = 1, @@ -644,8 +646,8 @@ struct NVRTCPathVisitor : Path::Visitor static SlangResult _findAndLoadNVRTC(ISlangSharedLibraryLoader* loader, ComPtr<ISlangSharedLibrary>& outLibrary) { -#if SLANG_WINDOWS_FAMILY - // We only need to search 64 bit versions on windows +#if SLANG_WINDOWS_FAMILY && SLANG_PTR_IS_64 + // We only need to search 64 bit versions on windows NVRTCPathVisitor visitor(UnownedStringSlice::fromLiteral("nvrtc64_")); // First try the instance path (if supported on platform) @@ -717,7 +719,11 @@ static SlangResult _findAndLoadNVRTC(ISlangSharedLibraryLoader* loader, ComPtr<I return SLANG_OK; } } +#else + SLANG_UNUSED(loader); + SLANG_UNUSED(outLibrary); #endif + // This is an official-ish list of versions is here: // https://developer.nvidia.com/cuda-toolkit-archive @@ -729,8 +735,10 @@ static SlangResult _findAndLoadNVRTC(ISlangSharedLibraryLoader* loader, ComPtr<I return SLANG_E_NOT_FOUND; } + /* static */SlangResult NVRTCDownstreamCompilerUtil::locateCompilers(const String& path, ISlangSharedLibraryLoader* loader, DownstreamCompilerSet* set) { + ComPtr<ISlangSharedLibrary> library; // If the user supplies a path to their preferred version of NVRTC, @@ -769,5 +777,4 @@ static SlangResult _findAndLoadNVRTC(ISlangSharedLibraryLoader* loader, ComPtr<I return SLANG_OK; } - } |
