summaryrefslogtreecommitdiffstats
path: root/source/core/slang-semantic-version.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-03-30 19:23:09 -0400
committerGitHub <noreply@github.com>2020-03-30 23:23:09 +0000
commitea7690558bca71ce3a9453adff4e0135352a352f (patch)
tree3eb983d3f8e6b1c215f6d2818a0f3e793ecb4485 /source/core/slang-semantic-version.cpp
parentad5b60c8b5868c69a979779f201748fb7837fdc9 (diff)
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
Diffstat (limited to 'source/core/slang-semantic-version.cpp')
-rw-r--r--source/core/slang-semantic-version.cpp9
1 files changed, 7 insertions, 2 deletions
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);