From ddebd60853b3f34bfd8e89de804fd15808abf75d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 9 May 2023 18:00:48 -0700 Subject: Various fixes for autodiff and slangpy. (#2876) * Various fixes for autodiff and slangpy. * Fix cuda code gen for `select`. * Fix getBuildTagString(). * Fix. --------- Co-authored-by: Yong He --- source/slang/slang.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index a1c8f9b03..f2598786f 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -125,6 +125,14 @@ namespace Slang { const char* getBuildTagString() { + if (UnownedStringSlice(SLANG_TAG_VERSION) == "unknown") + { + // If the tag is unknown, then we will try to get the timestamp of the shared library + // and use that as the version string, so that we can at least return something + // that uniquely identifies the build. + static String timeStampString = String(SharedLibraryUtils::getSharedLibraryTimestamp((void*)spCreateSession)); + return timeStampString.getBuffer(); + } return SLANG_TAG_VERSION; } -- cgit v1.2.3