From 6ab0baf910dea838dca2d29557c3361297180a34 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 22 Aug 2022 17:39:56 -0400 Subject: Improve binary compatibility for DownstreamCompiler types (#2371) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP replacing DownstreamCompileResult. * First attempt at replacing DownstreamCompileResult with IArtifact and associated types. * Small renaming around CharSlice. * ICastable -> ISlangCastable Added IClonable Fix issue with cloning in ArtifactDiagnostics. * Only add the blob if one is defined in DXC. * Guard adding blob representation. * Make cloneInterface available across code base. Set enums backing type for ArtifactDiagnostic. * Added ::create for ArtifactDiagnostics. * Use SemanticVersion for DownstreamCompilerDesc. Set sizes for enum types. * Depreciate old incompatible CompileOptions. Change SemanticVersion use 32 bits for the patch. * Split out CastableUtil. * Change IDownstreamCompiler to use canConvert and convert to use artifact types. * Fix typos. * Fix typo bug. Allow trafficing in PTX assembly/binaries * struct DownstreamCompilerBaseUtil -> struct DownstreamCompilerUtilBase Co-authored-by: Yong He --- source/core/slang-semantic-version.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/core/slang-semantic-version.cpp') diff --git a/source/core/slang-semantic-version.cpp b/source/core/slang-semantic-version.cpp index cc631d292..550ea993b 100644 --- a/source/core/slang-semantic-version.cpp +++ b/source/core/slang-semantic-version.cpp @@ -26,16 +26,16 @@ SlangResult SemanticVersion::parse(const UnownedStringSlice& value, char separat { SLANG_RETURN_ON_FAIL(StringUtil::parseInt(slices[i], ints[i])); - const Int max = (i == 0) ? 0x7fffffff : 0xffff; + const Int max = (i == 2) ? 0x7fffffff : 0xffff; if (ints[i] < 0 || ints[i] > max) { return SLANG_FAIL; } } - outVersion.m_major = uint32_t(ints[0]); + outVersion.m_major = uint16_t(ints[0]); outVersion.m_minor = uint16_t(ints[1]); - outVersion.m_patch = uint16_t(ints[2]); + outVersion.m_patch = uint32_t(ints[2]); return SLANG_OK; } @@ -50,7 +50,7 @@ void SemanticVersion::append(StringBuilder& buf) const buf << Int32(m_major) << "." << Int32(m_minor); if (m_patch != 0) { - buf << "." << Int32(m_patch); + buf << "." << UInt32(m_patch); } } @@ -90,8 +90,6 @@ void SemanticVersion::append(StringBuilder& buf) const return bestVersion; } - - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MatchSemanticVersion !!!!!!!!!!!!!!!!!!!!!!!!!!!!! /* static */SemanticVersion MatchSemanticVersion::findAnyBest(const SemanticVersion* versions, Count count, const ThisType& matchVersion) -- cgit v1.2.3