summaryrefslogtreecommitdiffstats
path: root/source/core/slang-test-tool-util.h
Commit message (Collapse)AuthorAge
* formatEllie Hermaszewska2024-10-29
| | | | | | | * format * Minor test fixes * enable checking cpp format in ci
* Replace stdlib on Slang API with CoreModule (#5405)Jay Kwak2024-10-25
| | | | | | | | | | | | | | | | | | This is a breaking change in a way that the Slang API function names are changed. All of them are commented as "experimental" and we wouldn't provide a back-ward compatibility for them. Following functions are renamed: compileStdLib() -> compileCoreModule() loadStdLib() -> loadCoreModule() saveStdLib() -> saveCoreModule() slang_createGlobalSessionWithoutStdLib() -> slang_createGlobalSessionWithoutCoreModule() slang_getEmbeddedStdLib() -> slang_getEmbeddedCoreModule() hasDeferredStdLib() -> hasDeferredCoreModule() Following command-line arguments are renamed: "-load-stdlib" -> "-load-core-module" "-save-stdlib" -> "-save-core-module" "-save-stdlib-bin-source" -> "-save-core-module-bin-source" "-compile-stdlib" -> "-compile-core-module"
* Feature/record unit test (#4910)kaizhangNV2024-08-26
| | | | | | | | | | | | | | | | | | | | | | | | * Fix the slang-test bug Since we reorganize the build directory, now the libraries are located at different directory with executables in non-Windows platform, we have to change the code on how to find the dll directory. * Integrate the record/replay test into slang-unit-test We create a unit-test-record-replay.cpp to run the converted slang examples in child process as our tests for the record-replay layer. * Disable the test on Apple Due to the limitation of current examples, we temporarily disable them on apples. Change the ci to make this test only be run on the gpu-equipped runners, for other runners we add a white-list file "expected-failure-record-replay-tests.txt". * Remove 'hello-world' example from unit test "hello-world" doesn't use gfx abstract library, instead it uses vk directly, it's not a preferable way. So we will drop this test, instead, we will use cpu-hello-world example.
* Fix warnings for gcc 12.3 (#3286)Ellie Hermaszewska2023-10-25
| | | | | | | | | | | | | | | | | | | * Silence a few gcc out of bounds warnings * Search upwards from executable for prelude directory instead of assuming depth * comment wording * Check return values of read and write * Correct path to vulkan headers in gfx * Correct diagnostic on missing file in slang-embed * Do not use absolute path to libraries in test-context.cpp --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Test for serializing out and reading back Stdlib (#1605)jsmall-nvidia2020-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Mangling/module name extraction for GenericDecl * Add comment on SerialFilter to explain re-enabling Stmt. * Support setting up SyntaxDecl when reconstructed after deserialization. * Improvements to setup SyntaxDecl. * Fix typo so can read compressed SourceLocs. * Fix issue with SourceManger. * Simple test for serializing out stdlib and reading back in. * Fix calling convention. * Add override to StdLib impls. * Fix typo. * Apply testing to an actual compute test when using load-stdlib Make -load/compile-stdlib processable by Slang Move out testing into util into TestToolUtil so can be shared. * Slightly more concise setup of session. * Fix some errors introduced with session handling. * Made setup for compile same across slangc and slangc-tool.
* Vulkan update/NVAPI support (#1511)jsmall-nvidia2020-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First pass at incorporating nvapi into test harness. * D3d12 Atomic Float Add via NVAPI working * Dx12 atomic float appears to work. * Atomic float add on Dx12. * Added atomic64 feature addition to vk. Fix correct output for atomic-float-byte-address.slang * Disable atomic float failing tests. * Upgraded VK headers. * Detect atomic float availability on VK. * Try to get test working for in64 atomic. * Made HLSL prelude controlled via the render-test requirements. * Added -enable-nvapi to premake. * Fix D3D12Renderer when NVAPI is not available. * Small improvements to VKRenderer. * Improve atomic documentation in target-compatibility.md.
* Remove IncludeHandler. (#1505)jsmall-nvidia2020-08-19
| | | | | | | | nvAPI -> NVAPI nvAPIPath -> nvapiPath DxcIncludeHandler don't reference count. nv-api-path -> nvapi-path Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
* Support for float atomics on RWByteAddressBuffer (#1502)jsmall-nvidia2020-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix premake5.lua so it uses the new path needed for OpenCLDebugInfo100.h * Keep including the includes directory. * Added the spirv-tools-generated files. * We don't need to include the spirv/unified1 path because the files needed are actually in the spirv-tools-generated folder. * Put the build_info.h glslang generated files in external/glslang-generated. Alter premake5.lua to pick up that header. * First pass at documenting how to build glslang and spirv-tools. * Improved glsl/spir-v tools README.md * Added revision.h * Change how gResources is calculated. Update about revision.h * Update docs a little. * Split out spirv-tools into a separate project for building glslang. This was not necessary on linux, but *is* necessary on windows, because there is a file disassemble.cpp in spirv-tools and in glslang, and this leads to VS choosing only one. With the separate library, the problem is resolved. * Fix direct-spirv-emit output. * Update to latest version of spirv headers and spirv-tools. * Upgrade submodule version of glslang in external. * Add fPIC to build options of slang-spirv-tools * WIP adding support for InterlockedAddFp32 * Upgrade slang-binaries to have new glslang. * Fix issues with Windows slang-glslang binaries, via update of slang-binaries used. * WIP - atomicAdd. This solution can't work as we can't do (float*) in glsl. * WIP on atomic float ops. * Added checking for multiple decls that takes into account __target_intrinsic and __specialized_for_target. First pass impl of atomic add on float for glsl. * Split __atomicAdd so extensions are applied appropriately. * Made Dxc/Fxc support includes. Use HLSL prelude to pass the path to nvapi Added -nv-api-path * Refactor around IncludeHandler and impl of IncludeSystem * slang-include-handler -> slang-include-system Have IncludeHandler/Impl defined in slang-preprocessor * Small comment improvements. * Document atomic float add addition in target-compatibility.md. * CUDA float atomic support on RWByteAddressBuffer. * Add atomic-float-byte-address-buffer-cross.slang * Removed inappropriate-once.slang - the test is no longer valid when a file is loaded and has a unique identity by default. A test could be made, but would require an API call to create the file (so no unique id). Improved handling of loadFile - uses uniqueId if has one. * Work around for testing target overlaps - to avoid exceptions on adding targets. Simplify PathInfo setup. Modify single-target-intrinsic.slang - it no longer failed because there were no longer multiple definitions for the same target. Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
* User defined downstream compiler prelude (#1028)jsmall-nvidia2019-08-20
| | | | | | | | | | | | | | | | | * Added setDownstreamCompilerPrelude Renamed setPassThroughPath to setDownstreamCompilerPath. Fixed tests. Added prelude directory & code to TestToolUtil to setup default preludes for testing/command line apis. * Fix merge problem * Remove hacks to make prelude work by adding a search path as no longer needed with 'user prelude'. * Split up prelude into scalar intrinsics, and types. Use slang.h for main header. slang-cpp-prelude.h can now just include what it needs (relative to prelude directory) and define the few remaining things/work arounds. * Fix typo.
* Use slang- prefix on slang compiler and core source (#973)jsmall-nvidia2019-05-31
| | | | | | | | | | | | * Prefixing source files in source/slang with slang- * Prefix source in source/slang with slang- prefix. * Rename core source files with slang- prefix. * Update project files. * Fix problems from automatic merge.
* * Added ToolReturnCode to be more rigerous about how a return code is passed ↵jsmall-nvidia2019-03-18
| | | | | | | back from a tool (#911) * Added support for a tool being able to pass back an 'ignored' result. * Used enum codes to indicate meanings * Made spawnAndWait return a ToolReturnCode
* Feature/remove app context (#765)jsmall-nvidia2018-12-21
* Remove AppContext. Use StdChannels to hold writers, and TestToolUtil to hold test tool specific functionality. * StdChannels -> StdWriters * getStdOut -> getOut, getStdError -> getError