summaryrefslogtreecommitdiff
path: root/tools/slang-test/slang-test-main.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-08-19 14:08:57 -0400
committerGitHub <noreply@github.com>2019-08-19 14:08:57 -0400
commitdc6d0417b137c8ecdcb3b99b7624358bba7fefa8 (patch)
tree326fe7f93b08431685c6b01052c2eee18168776b /tools/slang-test/slang-test-main.cpp
parentc4541e83b4a57d8317932bc4277ee6a2d45bb2f6 (diff)
WIP: Compute test running on CPU (#1023)
* * Simplify some of test code around CPPCompiler * Test using 'callable' with pass-through * Small cpu doc improvements * Improvements to Clang output parsing. * Remove temporary file (base filename) . * Improve handling of external errors - handle severity. * On error dumping out to 'actual' file for runCPPCompilerCompile. * Small fixes. Set the source language type correctly for pass thru. * Remove warning for test for clang backend c * Preliminary work around making render-test compute potentiall work with CPU. Made ShaderCompiler -> a stateless ShaderCompilerUtil. Means we don't require a Renderer interface to do shader compilation. * Refactor such that CPU test can take place in without Window or Renderer. * Hack to look for prelude in source file directory. Fix bug returning the SharedLibrary for HostCallable. * Compute test running on CPU. * Need the prelude currently in same directly as test. * Hack to remove warning - that then produces an error on appveyor build. Disable running render CPU test on non-windows. * Improve handling of disabling CPU tests on linux. * Added bit-cast.slang working on CPU.
Diffstat (limited to 'tools/slang-test/slang-test-main.cpp')
-rw-r--r--tools/slang-test/slang-test-main.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 4a830fd92..63e2456d9 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -690,6 +690,11 @@ static SlangResult _extractRenderTestRequirements(const CommandLine& cmdLine, Te
nativeLanguage = SLANG_SOURCE_LANGUAGE_GLSL;
passThru = SLANG_PASS_THROUGH_GLSLANG;
break;
+ case RenderApiType::CPU:
+ target = SLANG_HOST_CALLABLE;
+ nativeLanguage = SLANG_SOURCE_LANGUAGE_CPP;
+ passThru = SLANG_PASS_THROUGH_GENERIC_C_CPP;
+ break;
}
SlangSourceLanguage sourceLanguage = nativeLanguage;
@@ -780,6 +785,15 @@ static RenderApiFlags _getAvailableRenderApiFlags(TestContext* context)
{
const RenderApiType apiType = RenderApiType(i);
+ if (apiType == RenderApiType::CPU)
+ {
+ // TODO(JS): Only enable CPU on Windows for now
+#if SLANG_WINDOWS_FAMILY
+ availableRenderApiFlags |= RenderApiFlags(1) << int(apiType);
+#endif
+ continue;
+ }
+
// See if it's possible the api is available
if (RenderApiUtil::calcHasApi(apiType))
{
@@ -2656,7 +2670,7 @@ void runTestsOnFile(
const RenderApiFlags availableRenderApiFlags = apiUsedFlags ? _getAvailableRenderApiFlags(context) : 0;
// If synthesized tests are wanted look into adding them
- if (context->options.synthesizedTestApis && availableRenderApiFlags)
+ if (context->options.synthesizedTestApis && availableRenderApiFlags)
{
List<TestDetails> synthesizedTests;