summaryrefslogtreecommitdiffstats
path: root/tools/render-test/render-test-main.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 /tools/render-test/render-test-main.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 'tools/render-test/render-test-main.cpp')
-rw-r--r--tools/render-test/render-test-main.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index ab041b5bc..1d88ee500 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -544,6 +544,15 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi
// If it's CPU testing we don't need a window or a renderer
if (gOptions.rendererType == RendererType::CPU)
{
+ // Check we have all the required features
+ for (const auto& renderFeature : gOptions.renderFeatures)
+ {
+ if (!CPUComputeUtil::hasFeature(renderFeature.getUnownedSlice()))
+ {
+ return SLANG_E_NOT_AVAILABLE;
+ }
+ }
+
ShaderCompilerUtil::OutputAndLayout compilationAndLayout;
SLANG_RETURN_ON_FAIL(ShaderCompilerUtil::compileWithLayout(session, gOptions.sourcePath, gOptions.compileArgs, gOptions.shaderType, input, compilationAndLayout));
@@ -604,12 +613,20 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi
}
if (gOptions.rendererType == RendererType::CUDA)
- {
+ {
+#if RENDER_TEST_CUDA
+ // Check we have all the required features
+ for (const auto& renderFeature : gOptions.renderFeatures)
+ {
+ if (!CUDAComputeUtil::hasFeature(renderFeature.getUnownedSlice()))
+ {
+ return SLANG_E_NOT_AVAILABLE;
+ }
+ }
+
ShaderCompilerUtil::OutputAndLayout compilationAndLayout;
SLANG_RETURN_ON_FAIL(ShaderCompilerUtil::compileWithLayout(session, gOptions.sourcePath, gOptions.compileArgs, gOptions.shaderType, input, compilationAndLayout));
-#if RENDER_TEST_CUDA
-
const uint64_t startTicks = ProcessUtil::getClockTick();
CUDAComputeUtil::Context context;