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 --- tools/render-test/render-test-main.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'tools/render-test/render-test-main.cpp') 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; -- cgit v1.2.3