summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-capabilities.capdef20
-rw-r--r--source/slang/slang-compiler.cpp33
2 files changed, 43 insertions, 10 deletions
diff --git a/source/slang/slang-capabilities.capdef b/source/slang/slang-capabilities.capdef
index fafcb214f..9d1a11f07 100644
--- a/source/slang/slang-capabilities.capdef
+++ b/source/slang/slang-capabilities.capdef
@@ -1812,43 +1812,43 @@ alias GLSL_430_SPIRV_1_0 = _GLSL_430 + GLSL_420_SPIRV_1_0 | GLSL_420_SPIRV_1_0;
//
/// cuda 1.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_1_0 = _cuda_sm_1_0 | sm_4_0;
+alias cuda_sm_1_0 = _cuda_sm_1_0;
/// cuda 2.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_2_0 = _cuda_sm_2_0 | sm_4_1;
+alias cuda_sm_2_0 = _cuda_sm_2_0 | cuda_sm_1_0 | sm_4_0;
/// cuda 3.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_3_0 = _cuda_sm_3_0 | sm_6_0;
+alias cuda_sm_3_0 = _cuda_sm_3_0 | cuda_sm_2_0;
/// cuda 3.5 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_3_5 = _cuda_sm_3_5 | sm_6_0;
+alias cuda_sm_3_5 = _cuda_sm_3_5 | cuda_sm_3_0;
/// cuda 4.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_4_0 = _cuda_sm_4_0 | sm_6_0;
+alias cuda_sm_4_0 = _cuda_sm_4_0 | cuda_sm_3_5;
/// cuda 5.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_5_0 = _cuda_sm_5_0 | sm_6_0;
+alias cuda_sm_5_0 = _cuda_sm_5_0 | cuda_sm_4_0;
/// cuda 6.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_6_0 = _cuda_sm_6_0 | sm_6_0;
+alias cuda_sm_6_0 = _cuda_sm_6_0 | cuda_sm_5_0 | sm_4_1;
/// cuda 7.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_7_0 = _cuda_sm_7_0 | sm_5_1;
+alias cuda_sm_7_0 = _cuda_sm_7_0 | cuda_sm_6_0;
/// cuda 8.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_8_0 = _cuda_sm_8_0 | sm_5_1;
+alias cuda_sm_8_0 = _cuda_sm_8_0 | cuda_sm_7_0;
/// cuda 9.0 and related capabilities of other targets.
/// [Version]
-alias cuda_sm_9_0 = _cuda_sm_9_0 | sm_5_1;
+alias cuda_sm_9_0 = _cuda_sm_9_0 | cuda_sm_8_0 | sm_5_0;
// Metal profile capabilities
//
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp
index 15f22630c..d6659e707 100644
--- a/source/slang/slang-compiler.cpp
+++ b/source/slang/slang-compiler.cpp
@@ -1418,6 +1418,39 @@ SlangResult CodeGenContext::emitWithDownstreamForEntryPoints(ComPtr<IArtifact>&
}
}
+ CapabilitySet targetCaps = getTargetCaps();
+ for (auto atomSets : targetCaps.getAtomSets())
+ {
+ for (auto atomVal : atomSets)
+ {
+ auto atom = CapabilityAtom(atomVal);
+ switch (atom)
+ {
+ default:
+ break;
+
+#define CASE(KIND, NAME, VERSION) \
+ case CapabilityAtom::NAME: \
+ requiredCapabilityVersions.add(DownstreamCompileOptions::CapabilityVersion{ \
+ DownstreamCompileOptions::CapabilityVersion::Kind::KIND, \
+ VERSION}); \
+ break
+
+ CASE(CUDASM, _cuda_sm_1_0, SemanticVersion(1, 0));
+ CASE(CUDASM, _cuda_sm_2_0, SemanticVersion(2, 0));
+ CASE(CUDASM, _cuda_sm_3_0, SemanticVersion(3, 0));
+ CASE(CUDASM, _cuda_sm_4_0, SemanticVersion(4, 0));
+ CASE(CUDASM, _cuda_sm_5_0, SemanticVersion(5, 0));
+ CASE(CUDASM, _cuda_sm_6_0, SemanticVersion(6, 0));
+ CASE(CUDASM, _cuda_sm_7_0, SemanticVersion(7, 0));
+ CASE(CUDASM, _cuda_sm_8_0, SemanticVersion(8, 0));
+ CASE(CUDASM, _cuda_sm_9_0, SemanticVersion(9, 0));
+
+#undef CASE
+ }
+ }
+ }
+
// Set the file sytem and source manager, as *may* be used by downstream compiler
options.fileSystemExt = getFileSystemExt();
options.sourceManager = getSourceManager();