From ea7690558bca71ce3a9453adff4e0135352a352f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 30 Mar 2020 19:23:09 -0400 Subject: CUDA version handling (#1301) * render feature for CUDA compute model. * Use SemanticVersion type. * Enable CUDA wave tests that require CUDA SM 7.0. Provide mechanism for DownstreamCompiler to specify version numbers. * Enabled wave-equality.slang * Make CUDA SM version major version not just a single digit. * Fix assert. * DownstreamCompiler::Version -> CapabilityVersion --- source/core/slang-semantic-version.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 93536e007..7f603fd9c 100644 --- a/source/core/slang-semantic-version.cpp +++ b/source/core/slang-semantic-version.cpp @@ -7,13 +7,13 @@ namespace Slang { -SlangResult SemanticVersion::parse(const UnownedStringSlice& value, SemanticVersion& outVersion) +SlangResult SemanticVersion::parse(const UnownedStringSlice& value, char separatorChar, SemanticVersion& outVersion) { outVersion.reset(); UnownedStringSlice slices[3]; Index splitCount; - SLANG_RETURN_ON_FAIL(StringUtil::split(value, '.', 3, slices, splitCount)); + SLANG_RETURN_ON_FAIL(StringUtil::split(value, separatorChar, 3, slices, splitCount)); if (splitCount <= 0) { return SLANG_FAIL; @@ -38,6 +38,11 @@ SlangResult SemanticVersion::parse(const UnownedStringSlice& value, SemanticVers return SLANG_OK; } +SlangResult SemanticVersion::parse(const UnownedStringSlice& value, SemanticVersion& outVersion) +{ + return parse(value, '.', outVersion); +} + void SemanticVersion::append(StringBuilder& buf) const { buf << Int32(m_major) << "." << Int32(m_minor); -- cgit v1.2.3