From bad484d838590d0a2aaf1b5b8ac820634af2decb Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 14 Apr 2021 14:56:15 -0400 Subject: 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 --- source/compiler-core/slang-nvrtc-compiler.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source') 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& 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 library; // If the user supplies a path to their preferred version of NVRTC, @@ -769,5 +777,4 @@ static SlangResult _findAndLoadNVRTC(ISlangSharedLibraryLoader* loader, ComPtr