summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2022-12-02Move `performanceStringInlining` to after `finalizeAutoDiffPass`. (#2550)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-12-02Cleanup crypto utilities (#2549)skallweitNV
* Consolidate crypto functions into single module * Migrate rest of code to new crypto module * Fix name conflict
2022-12-02Inline functions with string param/return for GPU targets (#2544)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP inlining of functions that take or return string related types on GPU targets. * Small fixes. * Added a test. * Add checking for any getStringHash insts are valid. * Support getStringHash on CUDA. * Tweak diagnostic.
2022-12-02Add helper functions to update DifferentialPair (#2547)winmad
2022-12-01Cleanup creation of `IDifferentiableType` in semantics checking. (#2548)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-12-01Allow `no_diff` on `this` parameter. (#2543)Yong He
2022-11-30Fix missing semantic highlighting in attributes and ↵Yong He
ExtractExitentialValueExpr. (#2541) * Fix missing semantic highlighting in attributes and ExtractExitentialValueExpr. * Fix regression on partially specialized generic expr highlighting. * Add regression test. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-30Cleanup DigestBuilder and MD5HashGen (#2539)skallweitNV
* Cleanup DigestBuilder and MD5HashGen * Fix templates Co-authored-by: Yong He <yonghe@outlook.com>
2022-11-30Support `no_diff` on existential typed params. (#2540)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-29Allow `no_diff` modifier on parameters (#2538)Yong He
2022-11-29Refactored reverse-mode implementation to use 4 separate passes. (#2531)Sai Praveen Bangaru
* Added partial implementation for reverse-mode * Fixing several compile and runtime errors. * Fixed several issues with reverse-mode passes. * Fixed more issues. Basic reverse-mode tests passing Co-authored-by: Edward Liu <shiqiu1105@gmail.com>
2022-11-29Complete removal of DifferentialBottom type. (#2537)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-29FileStream-based implementation for updating cache index file (#2485)lucy96chen
* Draft FileStream-based implementation for updating cache file * File streams fully integrated into shader cache code paths; Tests will not run unless file system is on disk as file streams do not play nicely with in-memory * Brought old code back as fallback path, but tests need to ensure previous is freed first * Testing structure updated, beginning cleanup work * All tests working * Cleanup changes * Removed an extra tab at the end of a line * Cleanup change * Undo externals change * Removed redundant logic for OS vs memory file system handling of the shader cache; Removed extra helper function left over from old cache implementation * Reverted performance change to generate contents hashes when modules are being loaded as this code path is not always followed; Contents hashing now uses a combination of hashing and checking the last modified time for all file dependencies, only reading in and hashing the contents of all files if the last modified hash does not match * Added handling to Module::updateContentsBasedHash for file dependencies which are not from a physical source file on disk; Added test for above Co-authored-by: Lucy Chen <lucchen@nvidia.com> Co-authored-by: Yong He <yonghe@outlook.com>
2022-11-29Bug fix: partially specialized non-static generic invoke missing `this` ↵Yong He
argument. (#2536) * Fix non-static generic func call issue. * Add test case. * Revert unnecessary change. * Update test comment. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-28Add LockFile helper class (#2535)skallweitNV
* Add LockFile helper class
2022-11-23Make differentiable data-flow pass recognize interface methods. (#2530)Yong He
* Make differentiable data-flow pass recognize interface methods. * Make existing test to work with `[TreatAsDifferentiable]`. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-23Fix issues around dynamic generic function and autodiff. (#2528)Yong He
* Fix issues around dynamic generic function and autodiff. * Fix return type issue. * Fix type unification for generic `inout` parameter. * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-23Autodiff through simple dynamic dispatch. (#2527)Yong He
* Autodiff through simple dynamic dispatch. * Revert changes. * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-22Refactor Auto-diff passes (#2526)Sai Praveen Bangaru
* Initial refactor * Refactor passes tests * Removed Differential Bottom references from the IR side
2022-11-21Improve parser recovery around invalid function definitions. (#2525)Yong He
* Improve parser recovery around invalid function definitions. * Fix. * Clean up. * Clean up. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-21WIP: Fixed inout struct and added testing for calls to non-differentiable ↵Sai Praveen Bangaru
functions (#2505) * Added non-differentiable call test * Extended testing for nondifferentiable calls * Fixed subtle issue with extensions on generic types not applying the correct substitutions, leading to unspecialized generics at the emit stage * More fixes. inout struct params now work fine * Update inout-struct-parameters-jvp.slang * Update slang-ir.cpp * Fixed hoisting lookup_interface_method * Fixed non-diff call return value * Fixed issue with phi nodes * Fixed problem with IRSpecialize preventing hoisitng of DifferentialPairType * Fixed non-diff call test to conform to the new 'no_diff' system
2022-11-18Data flow validation pass for diagnosing derivative loss. (#2523)Yong He
2022-11-18Small fixes around SER on VK (#2522)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Fixes for Shader Execution Reordering for VK based on testing via GLSLANG with SER support. * Update test results with SER VK fixes.
2022-11-16Language server improvements for auto-diff. (#2521)Yong He
2022-11-16Clean up type checking of higher order expressions. (#2519)Yong He
* Clean up type checking of higher order expressions. * Replace `goto` with `break` to pacify clang. * Fix. * Fixes. * Fix more tests. * Fix lowerWitnessTable parameter error. * Exclude attributes from ast printing. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-16Squash warnings (#2515)Ellie Hermaszewska
* Don't use uname -p It's not portable (doesn't work on my machine) * Disable maybe-uninitialized warning on gcc Only false positives at the moment * Squash warning in miniz Allow it to use 64 bit file handing functions with gcc * Use noreturn c++11 attribute in SLANG_RETURN_NEVER * Squash uninitialized variable warnings * Squash const char/char conversion warnings Co-authored-by: Yong He <yonghe@outlook.com>
2022-11-16Mesh shader support (#2464)Ellie Hermaszewska
* Add gdb generated files to .gitignore * Switch to c++17 TODO: Ellie update coding style doc * WIP mesh shaders * Add MeshOutputType and mesh output decorations * Lift array type layout creation out of _createTypeLayout in preparation for sharing it elsewhere * Initial pass at GLSL legalization for mesh shaders * Create output types for builtin mesh outputs This should be rendered as an out paramter block * Handle writes to member fields in mesh shader output * Per primitive output from mesh shaders * Add mesh shader tests * Redeclare mesh output builtins * Remove unused instruction * Emit explicit mesh output max max size * Add unimplemented warning for array members in mesh output * Implement mesh output splitting for GLSL in terms of getSubscriptVal * Allow HLSL syntax for mesh output modifiers * Improve error messages for mesh output * Add test for HLSL style mesh output syntax * Emit explicit mesh output indices max size * HLSL generation support for mesh shaders * Better errors for mesh shader misuse * Neaten comments * Regenerate vs2019 project files * Fix build on vs2019 * Retreat on c++17 Will make the change in a separate PR * slang-glslang binary dep 11.10.0 -> 11.12.0-32 * Fixes for msvc compiler * Update msvc project
2022-11-15Shader Execution Reordering for VK (#2491)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Fixes around MakeMiss. * Add preliminary support for HitObject::MakeHit. * Make Nop. * Add HitObject::TraceRay. * HitObject::Invoke for VK. * Remove line numbers from SER GLSL output. * Add support for HitObjectAttributes Add support for GLSL HitObject.GetAttributes<T>() Simplified code around getting locations. * Be more explicit about requiring GL_EXT_ray_tracing in SER. * Split out LocationTracker from CLikeEmitter. * Small doc improvements. * Add motion ray support. * Use inlining to get correct GLSL behavior around hitObjectNV. * Add assignment HitObject test. * Add a HitObject array test. Shows doesn't work correctly for VK/GLSL. * Add call to `hitObjectGetAttributesNV` before getting attributes.
2022-11-15Specify downstream compiler include paths (#2517)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP around testing with NVAPI. * Make -I work for downstream compilers. Update docs. * Small improvement around ignoring tests.
2022-11-15Add mesh and amplification shaders to slang-glslang (#2516)Ellie Hermaszewska
2022-11-14Adding some math functions and their derivatives (#2497)winmad
2022-11-14Minimum binary arithmetic reverse autodiff working. (#2514)Edward Liu
* Initial plumbing of backward autodiff in the frontend. * More plumbing. * Initial reverse autodiff working. * Bug fixes. * Misc. * Remove redundant code. * More clean up. * Misc. * Rebase and add backward diff test. * Disable test. * Clean up. * Minor fix. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-14glslang: 11.10.0-16-g42398c93 -> 11.12.0-32-gf74f37c5 (#2507)Ellie Hermaszewska
2022-11-10Improvements to NVRTC diagnostic parsing (#2504)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Float16 support for C++/CPU based targets with f16tof32 and f32tof16. * Small correction around INF/NAN handling for f32tof16 * Small improvement to f16tof32 * Disable CUDA test for now. * Improvements to NVRTC diagnostic parsing. Handle compilerSpecificArgs. Fix issue with terminating nul ending up in diagnostic string. * Improved NVRTC error parsing. f32tof16 and f16tof32 work in principal on CUDA. * Small update to test, although they remain disabled. * Work around SLANG_E_NOT_AVAILABLE being turned into ignored, when a legitimate error is found * A more tightly constrained fallback NVRTC diagnostic parsing. * Remove CharUtil, as not neeed. Co-authored-by: Yong He <yonghe@outlook.com>
2022-11-10Fix inlining pass. (#2506)Yong He
* Fix inlining pass. * Add more check against corner cases. * Revise comments. * Fixes. * Fix premake script. * Fixes. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-09Add `[ForwardDerivativeOf]` attribute. (#2501)Yong He
* Add [ForwardDerivativeOf] attribute. * Fix handling around phi nodes. * Fixes. * Remove IR opcode for ForwardDerivativeOfDecoration. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-08Make `__BuiltinFloatingPointType` conform to `IDifferentiable`. (#2499)Yong He
2022-11-07Small cleanups on forward differentiation. (#2498)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-04Use property for `DifferentialPair` accessors. (#2493)Yong He
2022-11-04Higher order differentiation. (#2487)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-03Shader Execution Reordering without HLSL2021 (#2489)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Disable SER tests and enabling HLSL2021 by default. * Small typos fix. Improve SER coverage in testing. * Fix typo.
2022-11-03Disable HLSL2021 by default (#2488)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Disable SER tests and enabling HLSL2021 by default.
2022-11-02Rework differential conformance dictionary checking. (#2483)Yong He
* Rework differential conformance dictionary checking. * Revert space changes. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-02Shader Execution Reordering (via NVAPI) (#2484)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Preliminary SER NVAPI support. * Set the DXC compiler version. Fix typo in premake5.lua * Improve DXC version detection. Enable HLSL2021 on late enough version of DXC. * Fix typo. * Fix launch. * Test via DXIL output. * Update dxc-error output.
2022-11-01Added a vector intrinsic definition for exp (to serve as template for other ↵Sai Praveen Bangaru
vector intrinsics) (#2481) * Added vector exp definition * Naming
2022-11-01Make `DifferentialPair` able to nest. (#2477)Yong He
2022-10-29Shader cache bugfixes and test additions (#2467)lucy96chen
* Preliminary graphics shader test * Added test checking that a graphics shader is correctly split into two different entries * Removed testing only addition * Changed RequirementDictionary to an OrderedDictionary and added SerialTypeInfo for OrderedDictionary; Added entry point mangled name to the dependency hash * Added test covering failure case discovered as part of Falcor integration * Changed DifferentiableTypeSemanticContext::m_mapTypeToIDifferentiableWitness to an OrderedDictionary * Added serializedAST field to Module in order to save serialized ASTs to avoid reserialization as much as possible; Added classes field to Session in order to save the output of SerialClassesUtil::create to avoid recreating as much as possible * Changed AST hashing to hash the contents of a Module's file dependencies; Renamed all references to AST hashing to contents hashing * Further cleanup * Moved contents hash computation up to Linkage::loadModule and added field to Module to save the computed contents digest * Changed PreprocessorHandler::handleFileDependency to optionally take an ISlangBlob* containing file contents and changed FrontEndPreprocessorHandler::handleFileDependency to add the source code for an included file to the module's contents digest * Removed extraneous addToDigest call * Fixed accidental removal of source code hash for module being loaded
2022-10-28Fix language server crash on incomplete higher order invoke expr. (#2476)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-27More renaming in jvp pass. (#2475)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-27Rename 'IDifferentiable.zero' -> `IDifferentiable.dzero`. (#2474)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>