summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2022-08-05 13:19:20 -0400
committerGitHub <noreply@github.com>2022-08-05 13:19:20 -0400
commit2db8c15c04f2aade49636e42f0adee636afb3b73 (patch)
tree774758a9f854ddf655f6c46765a3ef8ca1950857 /build
parent12a846e8facf090aaeb68fcabf55867f5eaed747 (diff)
Added a new differential type system and various improvements (#2343)
* Merge slang-ir-diff-jvp.cpp * Added support and tests for other float vector types * Added swizzle test and code to handle it (tests failing currently) * Fixed one test, the other is still pending * Fixed instruction cloning logic to avoid modifying original function * Fixed an issue with custom 'pow_jvp' and added support for vector contructor * Minor update to comments * Fixed support for division * Fixed an issue with uninitialized diagnostic sink * Moved derivative processing to after mandatory inlining. Skip instructions that don't have side-effects and aren't used by anything. * WIP: Handling unconditional control flow and multi-block functions * Support for unconditional multi-block functions * Added a dead code elimination step to the derivative pass * Changed name of 'hasNoSideEffects()' * Refactored variable names * Added initial IR defs for new type system * Added necessary logic for semantic checking * Overhauled type system to use builtin pair types and conform to the IDifferentiable interface * Automatically replace IRDifferentiablePairType to a custom IRStructType * Added generics handling by expanding the conformance context functionality and allowing for type parameters * Minor fix: early return in processPairTypes() * Minor fixes to differentiable resolution on generic types * Added new instructions for differential pairs. Basic tests work now. Looking into generic types. * Adjusted most tests to the new type system. OutType and InOutType are still not properly working. * Updated __jvp to produce both primal and differential output * Moved autodiff related declarations to diff.meta.slang * Refactored variable names * Added initial IR defs for new type system * Added necessary logic for semantic checking * Overhauled type system to use builtin pair types and conform to the IDifferentiable interface * Automatically replace IRDifferentiablePairType to a custom IRStructType * Added generics handling by expanding the conformance context functionality and allowing for type parameters * Minor fix: early return in processPairTypes() * Minor fixes to differentiable resolution on generic types * Added new instructions for differential pairs. Basic tests work now. Looking into generic types. * Adjusted most tests to the new type system. OutType and InOutType are still not properly working. * Updated __jvp to produce both primal and differential output * Moved autodiff related declarations to diff.meta.slang * Removed external changes * Cleanup the transcription logic: each case returns a pair of insts for the primal and differential computation.
Diffstat (limited to 'build')
-rw-r--r--build/visual-studio/run-generators/run-generators.vcxproj17
-rw-r--r--build/visual-studio/run-generators/run-generators.vcxproj.filters3
-rw-r--r--build/visual-studio/slang/slang.vcxproj1
-rw-r--r--build/visual-studio/slang/slang.vcxproj.filters3
4 files changed, 24 insertions, 0 deletions
diff --git a/build/visual-studio/run-generators/run-generators.vcxproj b/build/visual-studio/run-generators/run-generators.vcxproj
index c8a99e931..e95f1ce02 100644
--- a/build/visual-studio/run-generators/run-generators.vcxproj
+++ b/build/visual-studio/run-generators/run-generators.vcxproj
@@ -343,6 +343,23 @@
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../bin/windows-x64/release/slang-generate.exe</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release aarch64|ARM'">../../../bin/windows-x64/release/slang-generate.exe</AdditionalInputs>
</CustomBuild>
+ <CustomBuild Include="..\..\..\source\slang\diff.meta.slang">
+ <FileType>Document</FileType>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"../../../bin/windows-x86/debug/slang-generate" %(Identity)</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"../../../bin/windows-x64/debug/slang-generate" %(Identity)</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug aarch64|ARM'">"$(SolutionDir)/bin/windows-x64/debug/slang-generate" %(Identity)</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"../../../bin/windows-x86/release/slang-generate" %(Identity)</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"../../../bin/windows-x64/release/slang-generate" %(Identity)</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release aarch64|ARM'">"$(SolutionDir)/bin/windows-x64/release/slang-generate" %(Identity)</Command>
+ <Outputs>../../../source/slang/diff.meta.slang.h</Outputs>
+ <Message>slang-generate %(Identity)</Message>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../bin/windows-x86/debug/slang-generate.exe</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../bin/windows-x64/debug/slang-generate.exe</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug aarch64|ARM'">../../../bin/windows-x64/debug/slang-generate.exe</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../bin/windows-x86/release/slang-generate.exe</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../bin/windows-x64/release/slang-generate.exe</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release aarch64|ARM'">../../../bin/windows-x64/release/slang-generate.exe</AdditionalInputs>
+ </CustomBuild>
<CustomBuild Include="..\..\..\source\slang\hlsl.meta.slang">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"../../../bin/windows-x86/debug/slang-generate" %(Identity)</Command>
diff --git a/build/visual-studio/run-generators/run-generators.vcxproj.filters b/build/visual-studio/run-generators/run-generators.vcxproj.filters
index 609af9779..d91507ae6 100644
--- a/build/visual-studio/run-generators/run-generators.vcxproj.filters
+++ b/build/visual-studio/run-generators/run-generators.vcxproj.filters
@@ -40,6 +40,9 @@
<CustomBuild Include="..\..\..\source\slang\core.meta.slang">
<Filter>Source Files</Filter>
</CustomBuild>
+ <CustomBuild Include="..\..\..\source\slang\diff.meta.slang">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
<CustomBuild Include="..\..\..\source\slang\hlsl.meta.slang">
<Filter>Source Files</Filter>
</CustomBuild>
diff --git a/build/visual-studio/slang/slang.vcxproj b/build/visual-studio/slang/slang.vcxproj
index f0cccb341..5f8c0bd2d 100644
--- a/build/visual-studio/slang/slang.vcxproj
+++ b/build/visual-studio/slang/slang.vcxproj
@@ -619,6 +619,7 @@ IF EXIST ..\..\..\external\slang-glslang\bin\windows-aarch64\release\slang-glsla
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\source\slang\core.meta.slang" />
+ <None Include="..\..\..\source\slang\diff.meta.slang" />
<None Include="..\..\..\source\slang\hlsl.meta.slang" />
</ItemGroup>
<ItemGroup>
diff --git a/build/visual-studio/slang/slang.vcxproj.filters b/build/visual-studio/slang/slang.vcxproj.filters
index ea1fd80ea..18bebd332 100644
--- a/build/visual-studio/slang/slang.vcxproj.filters
+++ b/build/visual-studio/slang/slang.vcxproj.filters
@@ -946,6 +946,9 @@
<None Include="..\..\..\source\slang\core.meta.slang">
<Filter>Source Files</Filter>
</None>
+ <None Include="..\..\..\source\slang\diff.meta.slang">
+ <Filter>Source Files</Filter>
+ </None>
<None Include="..\..\..\source\slang\hlsl.meta.slang">
<Filter>Source Files</Filter>
</None>