summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2023-09-27Fix a bug in `canInstHaveSideEffectAtAddress`. (#3246)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-27Fix regression on no_diff type transcription. (#3245)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-27Fix `isMovableInst`. (#3243)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-27WIP Mesh shaders for SPIR-V (#3226)Ellie Hermaszewska
* SPIR-V impl for SetMeshOutputCounts and DispatchMesh * Unsightly fix for legalization ordering differences between GLSL and SPIR-V * spelling * Start a new block after terminating one in the OpEmitMeshTasksExt SPIR-V asm block * Emit mesh shader decorations in SPIR-V * Mesh and task shader stages for spir-v * Output explicit gl builtins for spir-v * Be more hygenic when SOAizing mesh outputs * Do not create builtin paramter block for spirv mesh outputs * Pass mesh payloads around by ref * comment * less expected failure * remove unused * Add spirv op * Correct type query for default flat modifier --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-27Avoid make copies of __ref parameters when doing autodiff. (#3242)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-27Various SPIRV fixes. (#3231)Yong He
* Various SPIRV fixes. - Geometry shader support (WIP). - Fix texture get dimension and load. - Fold global GetElement(MakeArray/MakeVector) insts. - Call spvopt to inline all functions. - Translate OpImageSubscript. - Emit struct member names and global variable names. - Fix lowering of OpBitNot -> OpNot, instead of OpBitReverse. * Fix test. * Fix geometry shader. * Fix geometry shader emit. * Add atomic Image access test. * Fix tests. * don't fail if spirv-opt fails. * Update comments. * Fix test. * Cleanups. * indentation --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2023-09-26Handle the case where the parent if-else region's after-block is ↵Sai Praveen Bangaru
unreachable. (#3241) Also added a test for this. Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-26Fix for epoch/ASTBuilder* nullptr issue (#3240)jsmall-nvidia
* Fix issue with failing tests tests/serialization/serialized-module-test.slang tests/serialization/extern/extern-test.slang * Fix issue with session destruction order on Session. * Improve comment.
2023-09-25Add test for vector-element contiguity error (#3235)Sai Praveen Bangaru
2023-09-25Fix for threading issues around global session & epoch ids. (#3232)jsmall-nvidia
* Fix for threading issues around global session & epoch ids. * Make m_epochId atomic for thread visibility.
2023-09-23More `slangpy` features + polishing (#3233)Sai Praveen Bangaru
* Update user-guide with new slangpy features * More polishing of new slangpy docs * Update a1-02-slangpy.md * Only require contiguity for vector element types * Added `loadOnce/storeOnce` and subscript operations * Added docs, `DiffTensorView.dims()` & `DiffTensorView.stride(uint)` * Add constructors, remove storeOnce/loadOnce test * Adjusted intrinsic definitions
2023-09-21Revert inlining change in #3217. (#3229)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-21Various slangpy fixes. (#3227)Yong He
* Make dynamic cast transparent through `IRAttributedType`. * Add [CUDAXxx] variant of attributes. * Support marshaling of vector types. * Wrap cuda kernels in `extern "C"` block. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-21Misc SPIRV fixes. (#3220)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-21Emit loads for array resources correctly (#3214)Ellie Hermaszewska
* Emit loads for array resources correctly * Put arrays of UniformConstant resources in UniformConstant * less expected failure * This code was actually used --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-21move global initializers to entry point for spirv (#3225)Ellie Hermaszewska
* move global initializers to entry point for spirv * less expected failure --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-21Do not move movable insts in fuse-satcoop (#3221)Ellie Hermaszewska
* Do not move movable insts in fuse-satcoop * Add case for IRCall in isMovableInst --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-21fix warnings (#3224)Ellie Hermaszewska
* Remove unused variable * Remove unused variable * Remove unused if bindings
2023-09-20Move force inlining step to before `processAutodiffCalls` (and run in loop) ↵Sai Praveen Bangaru
(#3217) * Move auto-diff force inlining step to before `processAutodiffCalls` * Fix `replaceUsesWith` to handle existing inst defined after current use. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-20Redirect destination-driven lowering logic to regular lowering for ↵Sai Praveen Bangaru
`SelectExpr` (#3219) * Redirect destination-driven lowering logic to regular lowering for select expr * Add test
2023-09-20Fix `atan2` stdlib derivative + add tests. (#3218)Sai Praveen Bangaru
* Fix atan2 stdlib derivative. Add tests for atan2 * Create dstdlib-atan2.slang.expected.txt * Update tests
2023-09-20Direct SPIRV: Rasterization pipeline tests. (#3216)Yong He
* Direct SPIRV: Rasterization pipeline tests. * Fixup. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-19Added `[AutoPyBindCUDA]` for automatic kernel binding + `[PyExport]` for ↵Sai Praveen Bangaru
exporting type information (#3209) * Initial: add a DiffTensor impl * Auto-binding and diff tensor implementations now work * Refactored diff-tensor implementation + added py-export for struct types * Cleanup * Update slang-ir-pytorch-cpp-binding.cpp * Updated test names * Update autodiff-data-flow.slang.expected * Add more versions of load/store & default generic args for DiffTensorView. * Add diagnostic for default generic arg and more tests * Add more `[AutoPyBind]` tests
2023-09-19Handle combined image and samplers in spirv (#3213)Ellie Hermaszewska
* Handle combined image and samplers in spirv * less expected failure --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-19Memoize types in spirv asm blocks (#3215)Ellie Hermaszewska
* Neaten emitInst * Memoize types in spirv asm blocks * less expected failure
2023-09-19Direct SPIRV ParameterBlock fix. (#3212)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-18Use target-dependent pointer size in natural layout. (#3210)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-18Fix loop inversion issue that caused ordinary blocks with multiple ↵Sai Praveen Bangaru
predecessors (#3211) * Add test case for while loop * Fix loop inversion issue that caused ordinary blocks with multiple predecessors The original version can leave the CFG in an invalid state with `e4` not being a break block or merge point, but having multiple predecessors. The updated version creates a separate jump block for each break instruction to avoid this issue. * Fixup tests
2023-09-18Fix highlighting of generic types without argument. (#3208)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-18Use direct spirv in hello-world example. (#3207)Yong He
* Use direct spirv in hello-world example. * Use vulkan 1.1 * Use vulkan 1.2. * fix. * Fix test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-13Add missing RayQuery intrinsics. (#3206)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-13Add all RayQuery SPIRV Intrinsics. (#3204)Yong He
* Add all RayQuery SPIRV Intrinsics. * Fix * Fix. * fix. * Fix. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-12Direct SPIRV for RayTracing Inline. (#3201)Yong He
* Direct SPIRV for RayTracing Inline. * Fix. * Cleanup. * Fix compile error. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-12Correctly identify the number of operands to image sampling operands in ↵Ellie Hermaszewska
SPIR-V (#3200) * Correctly identify the number of operands to image sampling operands in SPIR-V * Neaten imageoperands warning test * Neaten imageoperands warning test
2023-09-11Add Mesh and Task shader support to GFX (#3190)Ellie Hermaszewska
* Bump vulkan headers Also just use vulkan-headers as a submodule * Add drawMeshTasks to gfx graphics pipelines * Add DispatchMesh overload with no payload, with GLSL intrinsic * Require spirv 1.4 for mesh shaders * Add vulkan mesh shader feature discovery * Add mesh shader stage bits to vk-util * Add mesh and task shader support to render-test * Add mesh and task tests * Preserve "payload" specifier in task shaders * Add mesh shader pipeline support to gfx * Add TODO * Add numThreads attribute for amplification stage * Add payload to task shader test * Drop dependency on d3dx12 * Allow passing payloads from task to mesh shaders * regenerate vs projects * check DispatchMesh name correctly * Add mesh shader tests to failing tests * Detect wave-ops feature on vulkan * Add fuse-product to expected failures This fails because the global varaible `count` is not initialized * Add required extension to WaveMaskMatch SPIR-V impl * Remove meshShader member from pipeline desc * Identify mesh shader support on d3d12
2023-09-08Fix attribute highlighting + language server crash. (#3198)Yong He
* Fix attribute highlighting + language server crash. * Fix wave intrinsic. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-08Remove unsupported torch types + add bool type. (#3197)Sai Praveen Bangaru
Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-08Don't inline callees with custom derivative before autodiff. (#3196)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-07Incur l-value conversion cost during overload resolution. (#3195)Yong He
* Incur l-value conversion cost during overload resolution. * Fix compile error. * cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-07Lower LValue implicit cast before autodiff. (#3194)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-07Fix compiler crashing when `[BackwardDerivativeOf(fn)]` refers to an ↵Sai Praveen Bangaru
unresolved `fn` (#3191) * Fix compiler crashing on unresolved decl-ref * Update autodiff-custom-diff-unresolved.slang --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-07Fix GLSL output for `gl_ClipDistance` input builtin. (#3193)Yong He
* Fix GLSL output for `gl_ClipDistance` input builtin. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-07Fix erroneous diagnostic when checking a generic differentiable mutable ↵winmad
method. (#3192) * Add a unit test * Fix. --------- Co-authored-by: Lifan Wu <lifanw@nvidia.com> Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-07Add -repro-fallback-directory (#3188)jsmall-nvidia
Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-06Update prebuilt glslang binaries (#3189)Yong He
* Update prebuilt glslang binaries * Add test for GL_EXT_texture_shadow_lod functions. * fix --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-06Make a warning if a [mutating] method is called on an in param. (#3184)jsmall-nvidia
* Make a warning if a [mutating] method is passed as an in param. * Kick CI. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-09-06Global values are automatically assigned null derivative (#3186)Sai Praveen Bangaru
2023-09-05Fix HLSL SER Intrinsics. (#3183)Yong He
* Fix HLSL SER Intrinsics. * Fix GFX Vulkan shader creation bug. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-09-05SPIR-V image operations (#3163)Ellie Hermaszewska
* Add __truncate and __sampledType for spirv_asm Allows some texture tests to start passing * add __isVector Currently unused * Add 1-vector legalization pass (WIP) * Add capabilities for image types * neaten instruction dumping * add 1-vector test * Add a couple of cases to vec1 legalization * Remove texture tests from expected failures * comment * regenerate vs projects * Remove redundant define form synchapi emulation * refactoring image methods * All sample functions refactored * Remove incorrect glsl intrinsics Partially addresses https://github.com/shader-slang/slang/issues/3174 * __subscript image ops via writing funcs * Extract texture struct writing from core.meta.slang * Abstract out cuda intrinsic * Remvoe erroneous call to opDecorateIndex * spirv asm IR utils * Correct position of loads for SPIR-V asm inst operands * Raise constructors to global scope during spir-v legalization * Correct snippet output * Implement most texture sampling ops for SPIR-V * Legalize 1-vectors for glsl too * Make SPIR-V inst operands non-hoistable * Better 1-vector legalization * Put textures in ptrs for spirv * insert missing break * Add vec1 legalization test * Add some missing pieces to slang-ir-insts * Greatly neaten vec1 legalization * a * Neaten vec1 legalization * Add image read and write intrinsics for spir-v * Squash warnings * regenerate vs projects * Drop redundant guards * Drop 5 tests from expected failure list * Inst numbering changes to cross compile tests * vec1 legalization tests only on vk * Correct location of asm op emit * Inline constant in spirv-asm * Correct signedness for lane in wave intrinsics * Extract element from float1 for cuda * squash warnings * Neaten spirv-emit * dedupe more capabilities * warnings * neaten assert * comments * comments
2023-09-03Loop inversion: Handle case where loop can have additional inner breaks (#3178)Sai Praveen Bangaru
* Loop inversion: Handle case where loop can have additional inner breaks - We now have another critical-edge-breaking block `e4` that is the target of inner breaks. - Both `e4` and `e1` (the break branch from the loop condition) branch to the loop's ne break block `b2`. - `b2` is a clone of the old break block `b`, and it simply branches to the old break block. This fixes an IR validation issue in `tests/autodiff/reverse-while-loop-2.slang` * Delete region-wave-masks.slang --------- Co-authored-by: Yong He <yonghe@outlook.com>