https://github.com/shader-slang/slang
Revision 45ef0ce906c93c16495755fec2e597573e8631c4 authored by Sai Praveen Bangaru on 10 July 2024, 20:49:41 UTC, committed by GitHub on 10 July 2024, 20:49:41 UTC
* Treat global variables and parameters as non-differentiable when checking derivative data-flow

Global parameters are by-default not differentiable (even if they are of a differentiable type), because our auto-diff passes do not touch anything outside of function bodies.

The solution is to use wrapper objects with differentiable getter/setter methods (and we should provide a few such objects in the stdlib).

Fixes: #3289

This is a potentially breaking change: User code that was previously working with global variables of a differentiable type will now throw an error (previously the gradient would be dropped without warning). The solution is to use `detach()` to keep same behavior as before or rewrite the access using differentiable getter/setter methods.

* Fix issues with lookup witness lowering

* Update slang-ir-lower-witness-lookup.cpp

* Add tests

* Update slang-ir-lower-witness-lookup.cpp

* Cleanup

* Update nested-assoc-types.slang

---------

Co-authored-by: Yong He <yonghe@outlook.com>
1 parent 16a4781
History
Tip revision: 45ef0ce906c93c16495755fec2e597573e8631c4 authored by Sai Praveen Bangaru on 10 July 2024, 20:49:41 UTC
Fix lowering of associated types and synthesis of dispatch functions. (#4568)
Tip revision: 45ef0ce
File Mode Size
.github
cmake
docs
examples
external
extras
prelude
source
tests
tools
.editorconfig -rw-r--r-- 984 bytes
.gitattributes -rw-r--r-- 95 bytes
.gitignore -rw-r--r-- 1.6 KB
.gitmodules -rw-r--r-- 1.3 KB
.mailmap -rw-r--r-- 84 bytes
CMakeLists.txt -rw-r--r-- 23.9 KB
CMakePresets.json -rw-r--r-- 3.9 KB
CODE_OF_CONDUCT.md -rw-r--r-- 3.1 KB
CONTRIBUTION.md -rw-r--r-- 10.2 KB
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 8.5 KB
github_build.sh -rw-r--r-- 1.6 KB
github_macos_build.sh -rw-r--r-- 1.3 KB
slang-com-helper.h -rw-r--r-- 4.9 KB
slang-com-ptr.h -rw-r--r-- 5.0 KB
slang-gfx.h -rw-r--r-- 88.8 KB
slang-tag-version.h -rw-r--r-- 36 bytes
slang.h -rw-r--r-- 211.5 KB

README.md

back to top