summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2023-04-14Bugfix: compiler will run forever to eliminate dead code (#2809)winmad
* Add a test case that the compile will run forever * Fix. * fix. --------- Co-authored-by: Lifan Wu <lifanw@nvidia.com> Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-14Diagnose on using uninitialized `out` param. (#2803)Yong He
* Diagnose on using uninitialized `out` param. * Hack to allow `out Vertices<T>`. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-14Some small fixes with Windows/DX usage (#2797)Ellie Hermaszewska
* Correct case of windows.h includes * Use Slang::SharedLibrary to load directx dlls * s/max/std::max/ * Factor common OS code in calcHasApi * Add DXIL test for compute/simple * s/false/FALSE for calls to WinAPI functions * Factor common OS code in gfxGetAdapters * 2 missing headers d3d12sdklayers for ID3DDebug climits for UINT_MAX * Define out unused function on Linux * Only try to load Vulkan and CUDA on Windows or Linux * simplify D3DUtil::getDxgiModule * Remove WIN32_LEAN_AND_MEAN &co from source files Add a global define * Set WIN32_LEAN_AND_MEAN &friends in headers Restore previous state also * regenerate vs projects
2023-04-14Enable SLANG_ENABLE_DXIL_SUPPORT on non-Windows platforms (#2750)Ellie Hermaszewska
* Enable SLANG_ENABLE_DXIL_SUPPORT on non-Windows platforms This currently grabs the DXC headers from the system, rather than from external/dxc We should make this consistent by either pulling in the Windows adapter from DXC into external/dxc or by making the Windows builds use <dxc/dxcapi.h> * Update dxcapi and add DXC's WinAdapter * Use our copy of dxcapi.h for non-windows DXC usage * Only set -fms-extensions where necessary * Work around dxc dlclose bug * Neaten and comment dxc-compiler.cpp
2023-04-13Warn on float-to-double coercion for arguments. (#2802)Yong He
* Warn on float-to-double coercion for arguments. * Fix test. * Rename. * Fixup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-13Fix scalar swizzle write. (#2801)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-13Set sharedMem argument to 0 when launching cuda kernel. (#2799)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-13Fix stack overflow in lookupWitness lowering pass. (#2798)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-14Set the executable bit on Executable artifact files (#2796)Ellie Hermaszewska
* Set the executable bit on Executable artifact files * Don't zero out other permission bits in makeExecutable
2023-04-13Matrix swizzle writes (#2713)Ellie Hermaszewska
* Add a bunch of builder emit wrappers for constant indices To avoid cluttering any calling code with int instruction construction * Matrix swizzle stores Closes https://github.com/shader-slang/slang/issues/2512 * Matrix swizzle store tests * Squash vs warnings * Select scalar for singular swizzles * Test singular swizzle materialization * Use IRIntegerValue over UInt for IR wrappers * Correct size of swizzle vector type * Remove variable shadowing
2023-04-13Correct http header construction (#2795)Ellie Hermaszewska
Previously we were always setting mimeType as "mimeType"
2023-04-12Combine lookupWitness lowering with specialization. (#2794)Yong He
2023-04-12Reading artifact hierarchy from file system interface (#2787)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP simplifying artifact interface. * Use ContainedKind. * Remove LazyCastableList. Use ContainedKind for find. * Remove ICastableList. * Remove need for ICastableList. * Remove IArtifactContainer. * Small fixes. * Small improvements around Artifact. * Make explicit find is for *representations* that can cast. Fix bug in handling casting in lookup. * Made associated items artifacts too. * Small fixes. * Small improvements around writing a container. * WIP artifact container format. * Make the root a special case. * Special case if the artifact doesn't have children/associated. * First pass handling of interpretting a file system into artifact hierarchy. * Explain the final structure. Make the file system available. * Remove addArtifact from IArtifact interface - means will be compatible with previous version. * Rename function to get compile result as a filesytem.
2023-04-12Artifact Container (#2783)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP simplifying artifact interface. * Use ContainedKind. * Remove LazyCastableList. Use ContainedKind for find. * Remove ICastableList. * Remove need for ICastableList. * Remove IArtifactContainer. * Small fixes. * Small improvements around Artifact. * Make explicit find is for *representations* that can cast. Fix bug in handling casting in lookup. * Made associated items artifacts too. * Small fixes. * Small improvements around writing a container. * WIP artifact container format. * Make the root a special case. * Special case if the artifact doesn't have children/associated.
2023-04-11Fix missing `f` suffix for float lits in CUDA backend. (#2791)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-11Small fixes to TorchTensor. (#2790)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-11Implement FileCheck tests for several test commands (#2747)Ellie Hermaszewska
* Add missing expected.txt for test * Diagnostics -> StdWriters in render test * Allow specifying several test prefixes to run `slang-test -- tests/foo tests/bar` * Squash warnings in some tests * Enable gfx debug layer in gfx test util Makes this issue present consistently: https://github.com/shader-slang/slang/issues/2766 * Allow DebugDevice to return interfaces instantiated by the debugged object * Check that we actaully have a shader cache for shader cache tests * Implement FileCheck tests for several test commands - SIMPLE, SIMPLE_EX - SIMPLE_LINE - REFLECTION, CPU_REFLECTION - CROSS_COMPILE It does not currently support the render tests or the COMPARE_COMPUTE commands It is invoked by adding `(filecheck=MY_FILECHECK_PREFIX)` to the test command, for example TEST:CROSS_COMPILE(filecheck=SPIRV): -target spirv-assembly * Move LLVM FileCheck interface to slang-llvm * Neaten slang-test tests * Refine handling of expected output in slang-test * Add example FileCheck buffer test * Add cuda-kernel-export tests Which were waiting on FileCheck * Bump vs project files * Make createLLVMFileCheck_V1 return a void* rather than specifically an IFileCheck * Remove use of CharSlice from filecheck interface * Bump slang-llvm version --------- Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
2023-04-11Artifact simplification (#2781)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP simplifying artifact interface. * Use ContainedKind. * Remove LazyCastableList. Use ContainedKind for find. * Remove ICastableList. * Remove need for ICastableList. * Remove IArtifactContainer. * Small fixes. * Small improvements around Artifact. * Make explicit find is for *representations* that can cast. Fix bug in handling casting in lookup. * Made associated items artifacts too. * Small fixes. * Small improvements around writing a container.
2023-04-10Fix inlining. (#2786)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-10Cleaner impl of unary stdlib derivative functions. (#2785)Yong He
* Cleaner impl of unary stdlib derivative functions. * fixup * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-07Diagnose on attempt to specialize with interface type. (#2780)Yong He
* Diagnose on attempt to specialize with interface type. Fixes ##1445. * Enable fixed test. * Fix test. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-07Add SLANG_IID_PPV_ARGS (#2784)Ellie Hermaszewska
* Add SLANG_IID_PPV_ARGS To mirror IID_PPV_ARGS from the COM Coding Practices: https://learn.microsoft.com/en-us/windows/win32/LearnWin32/com-coding-practices#the-iid_ppv_args-macro * Make getTypeGuid constexpr --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-04-07Fix crash on overloaded custom derivative function (#2782)Sai Praveen Bangaru
* Fix issue with resolving overloaded custom forward derivative methods. * Add test
2023-04-05Warn on dangling comparison operator. (#2779)Yong He
Fixes #1685 Co-authored-by: Yong He <yhe@nvidia.com>
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>