summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2023-04-05Fix linking issue in slangpy + no mask param for kernels. (#2778)Yong He
* Fix linking issue in slangpy + no mask param for kernels. * add cuda header changes * fix * More correct change of active mask insertion. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-05Register `IDifferentiable` witnesses for the differential associated types ↵Sai Praveen Bangaru
of registered types. (#2777) * Create high-order-forward-diff-struct.slang * Add a small pass to register differentials for differentials of registered types * Remove type reg pass and apply logic in differentiable type loading instead * Update slang-ir-autodiff.cpp * Fix comments. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-04-04Diagnose on using assignment as predicate expr. (#2774)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-04Preliminary support for realtime clock (#2772)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Initial support for realtime clock. * Add realtime-clock render feature where seems appropriate. * Fixes to make NVAPI compile properly. Change realtime-clock.slang check to use maths that can't overflow.
2023-04-04Simplification around ArtifactRepresentation and unique identity (#2771)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP in handling artifacts/SourceFiles. * Add getUniqueIdentity to IPathArtifactRepresentation * Simplification because around using the representation to provide the uniqueIdentity.
2023-04-04Fix crash on encountering undefined identifier when checking derivative ↵Sai Praveen Bangaru
attributes (#2773) * Fix compiler crash if referencing undefined method in the deriavative decorator * Delete sample.comp --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-04-03Emit simpler vector element access code. (#2770)Yong He
* Emit simpler vector element access code * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-02Squash some warnings (#2765)Ellie Hermaszewska
Co-authored-by: Yong He <yonghe@outlook.com>
2023-04-02Fix type legalization pass. (#2768)Yong He
2023-03-30Detect when calls to execv fail (#2751)Ellie Hermaszewska
* Detect when calls to execv fail * Use pipe+fcntl instead of pipe2 pipe2 is not available on macOS * remove outdated comment * Use _exit in child if execv fails * Prevent Process::create leaks on some failures, and more robust in setting std streams for child --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-30Fix stdlib definitions for tensor interlocked methods. (#2761)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-30More builtin library support in torch backend. (#2760)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-30Enable CUDA render api on unix (#2757)Ellie Hermaszewska
* Remove extra qualification in cuda device impl Only MSVC accepts this illegal code * Enable CUDA render api on unix --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-30Fix mismatched malloc/delete[] in toWString (#2758)Ellie Hermaszewska
Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-30Fix autodiff pass duplicates exported functions. (#2759)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-29Convert tensor types in `make_tensor_view`. (#2755)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-29Fix IRArrayType emit logic. (#2754)Yong He
* Fix IRArrayType emit logic. * Fix test. * Fix ast constant folding. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-29Update checkpoint policy to make obvious recompute decisions. (#2753)Yong He
* Update checkpoint policy to make obvious recompute decisions. Also adds an optimization to fold updateElement chains on the same array or struct into a single makeArray or makeStruct. * Bug fixes around array types with different int typed count. * change test. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-29Add missing initializer in json source map decoding (#2752)Ellie Hermaszewska
2023-03-28Add slangpy doc, fix cuda prelude. (#2748)Yong He
* Add slangpy doc, fix cuda prelude. * more bug fix. * fix. * fix. * More fix. * fix. * f * fix prelude. * update prelude. * update doc * Update prelude. * add zeros_like * update doc. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-28AD: Warped-Area-Sampling test works now. (#2742)Sai Praveen Bangaru
* Create render.slang * Added higher-order differentiability decorators for built-ins + preliminary tests * Update diff.meta.slang * Copy over conformance synthesis code to `DifferentiableTypeConformanceContext` * Update render.slang * Fixed 1D warped-area sampling test * Update warped-sampling-1d.slang * Remove commented line. * Change WAS test to use fixed point * Replaced InterlockedCmpExchange with InterlockedAdd * Increase fixed point precision * Reduce floating-point precision by 2 digits to avoid platform-specific problems * Dropped another digit (just to be safe) --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-28Small fixes and cleanups on CUDA/CPP codegen. (#2746)Yong He
* Small fixes and cleanups on CUDA/CPP codegen. * Disable `legalizeEmptyTypes` for now. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-27Translate all composed types into tuple types in pyBind. (#2744)Yong He
* Translate all composed types into tuple types in pyBind. * Delete temp file. * Fix get tuple element code emit logic. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-27Upgrade `slang-llvm` (#2741)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Fix SlangCompileTarget to keep ordering. * Add test. Remove V2 version of interface to access IDownstreamCompiler Update to slang-llvm which has _chkstk support. * Update slang.h Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al> --------- Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al>
2023-03-27Apply IR simplifcation immediately after specialization to avoid duplicates. ↵Yong He
(#2739) * Apply IR simplifcation immediately after specialization to avoid duplicates. * Update source/slang/slang-ir-specialize.cpp Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al> --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al>
2023-03-28Don't touch output file if content did not change. (#2738)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-27Using SourceMap for location output (#2736)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP using SourceMap with SourceManager. * Add a test to check obfuscation map is working. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-27Fix lowering crash in [BackwardDerivativeOf]. (#2737)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-27Use c++17 standard (#2686)Ellie Hermaszewska
* Use c++17 standard * regenerate VS projects * Switch to using std::invoke
2023-03-26Update slang-llvm (#2735)Yong He
2023-03-26Add PyTorch C++ binding generation. (#2734)Yong He
* Add PyTorch C++ binding generation. * fix --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-24Switch to short circuiting semantics for scalar `?:` operator. (#2733)Yong He
2023-03-24Added `[BackwardDifferentiable]` tags for intrinsic + builtin methods (#2732)Sai Praveen Bangaru
* Added higher-order differentiability decorators for built-ins + preliminary tests * Update diff.meta.slang
2023-03-24Obfuscated source map writing (#2727)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP produce obfuscated source map and write when container is specified. * Make the sourcemap generated name stable.
2023-03-24Fix nested bwdContextType lowering. (#2731)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-23Fix various autodiff crashes related to interface usage. (#2730)Yong He
* Fix crash. * Fix `[ForwradDerivative]` on member functions. * Update comments. * Fix crash when [BackwardDerivative] is provided but not [ForwardDerivative]. * Allow calling dynamic dispatched generic method from differentiable func. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-23AD: Fix type checking for higher-order custom derivatives definitions (#2729)Sai Praveen Bangaru
* Fixed type coercion issue with higher-order user defined methods * Placed associated type lookup method in a loop * Update high-order-user-defined-derivative.slang * Revert changes to associated type lookup method
2023-03-23Hack handling of primal insts that has a function type. (#2728)Yong He
* Update diff-bwd material test * Minor update * Hack handling of primal insts that has a function type. --------- Co-authored-by: winmad <winmad.wlf@gmail.com> Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-23Fix optimization pass not converging. (#2725)Yong He
* Fix optimization pass not converging. * Fix. * Fix tests. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-23Fix scope fixing for address insts. (#2724)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-22Fix generic lowering regression due to IR deduplication. (#2723)Yong He
* Fix generic lowering. * Fix generic lowering regression due to IR deduplication. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-22Type legalization and autodiff bug fixes. (#2722)Yong He
* Bug fixes. * Fix. * Only perform autodiff for functions whose derivative is actually used. * Fix loop optimize bug. * Fix high order diff. * Fix trivial diff func generation. * Fixes. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-22Source map obfuscation (#2717)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP source map. * Split out handling of RttiTypeFuncs to a map type. * Make RttiTypeFuncsMap hold default impls. * Slightly more sophisticated RttiTypeFuncsMap * Source map decoding. * Fix tabs. * Fix asserts due to negative values. * Use less obscure mechanisms in SourceMap. * Source map decoding. Simplifying SourceMap usage. * First attempt at ouputting a source map as part of emit. * Added support for -source-map option. SourceMap is added to the artifact. * Small improvements around column calculation in SourceWriter. * Source Loc obuscation WIP. * Fix some issues around SourceMap obfuscation. * Split out obfuscation into its own file. * Keep obfuscated SourceMap even through serialization bottleneck.
2023-03-21[TreatAsDifferentiable] functions. (#2720)Yong He
2023-03-21Fix associated type resolution bug. (#2719)Yong He
* Fix associated type resolution bug. * Fix. * Fix language server hinting messed up by breadcrumb nodes. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-21Fix IntVal type check. (#2718)Yong He
* Fix IntVal type check. * add test case result. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-21Add texture tri-linear autodiff example. (#2715)Yong He
* Add quad texture example. * delete output image * remove irrelavent files * update project files * fix * Update example. * Fix. * remove out-texture --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-17Add support for emitting cuda kernel and host functions. (#2712)Yong He
* Add support for emitting cuda kernel and host functions. * Update test. * Fix cuda preamble emit. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-17Rework differentiability dataflow check. (#2711)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-17Support for producing SourceMap on emit (#2707)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP source map. * Split out handling of RttiTypeFuncs to a map type. * Make RttiTypeFuncsMap hold default impls. * Slightly more sophisticated RttiTypeFuncsMap * Source map decoding. * Fix tabs. * Fix asserts due to negative values. * Use less obscure mechanisms in SourceMap. * Source map decoding. Simplifying SourceMap usage. * First attempt at ouputting a source map as part of emit. * Added support for -source-map option. SourceMap is added to the artifact.