summaryrefslogtreecommitdiffstats
path: root/tests/autodiff/reverse-control-flow-3.slang
diff options
context:
space:
mode:
authorvenkataram-nv <vedavamadath@nvidia.com>2024-09-18 20:42:07 -0700
committerGitHub <noreply@github.com>2024-09-18 20:42:07 -0700
commitb808aa4df50d46eaa569561f7e464c55c1c2d72a (patch)
tree5483a3f9e73a401ff82d66fd1ac3729a9a84a97c /tests/autodiff/reverse-control-flow-3.slang
parent3240799c00488858afc7eeac9d1dc479609a1040 (diff)
Report AD checkpoint contexts (#5058)
* Transferring source locations when creating phi instructions * Tracking for simple variables * Deriving source locations for loop counters * Printing checkpoint structure breakdown * More readable output format * Special behavior for loop counters * Writing report to file * Add slangc option to enable checkpoint reports * Display types of checkpointed fields * Message in case there are no checkpointing contexts * Catch source locations for function calls * Source cleanup * Fix compilation warnings * Remove stray dump() * Provide the report through diagnostic notes * Add missing path for sourceLoc during unzip pass * Add tests for reporting intermediates * Include more transfer cases for source locations * Fix ordering in address elimination * Fill in more holes with source location transfer * Remove debugging line * Reverting changes to diagnostic sink * Simplify address elimination using source location RAII contexts * Eliminating manual source loc transfers in forward transcription * Fix local var adaptation to use RAII location setter * Simplify primal hoisting logic for source location transfer * Simplify unzipping with RAII location scopes * Simplify transpose logic * Cleaning up for rev.cpp * Reverting spacing changes * Fix mistake with source loc RAII instantiation * Fix formatting issues
Diffstat (limited to 'tests/autodiff/reverse-control-flow-3.slang')
-rw-r--r--tests/autodiff/reverse-control-flow-3.slang11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/autodiff/reverse-control-flow-3.slang b/tests/autodiff/reverse-control-flow-3.slang
index 01b533279..b4fa68e3a 100644
--- a/tests/autodiff/reverse-control-flow-3.slang
+++ b/tests/autodiff/reverse-control-flow-3.slang
@@ -1,4 +1,5 @@
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
+//TEST:SIMPLE(filecheck=CHK):-target glsl -stage compute -entry computeMain -report-checkpoint-intermediates
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
@@ -75,7 +76,8 @@ void d_getParam(uint id, MaterialParam.Differential diff)
outputBuffer[id] += diff.roughness;
}
-
+//CHK-DAG: note: checkpointing context of 8 bytes associated with function: 'updatePathThroughput'
+//CHK-DAG: note: 8 bytes (PathResult_0) used to checkpoint the following item:
[BackwardDifferentiable]
void updatePathThroughput(inout PathResult path, const float weight)
{
@@ -122,9 +124,13 @@ bool generateScatterRay(const BSDFSample bs, const MaterialParam bsdfParams, ino
\param[in,out] path The path state.
\return True if a ray was generated, false otherwise.
*/
+
+//CHK-DAG: note: checkpointing context of 16 bytes associated with function: 'generateScatterRay'
[BackwardDifferentiable]
bool generateScatterRay(const BSDFSample bs, const MaterialParam bsdfParams, inout PathState path, inout PathResult pathRes)
{
+ //CHK-DAG: note: 8 bytes (s_bwd_prop_updatePathThroughput_Intermediates_0) used to checkpoint the following item:
+ //CHK-DAG: note: 8 bytes (PathResult_0) used to checkpoint the following item:
updatePathThroughput(pathRes, bs.val);
return true;
}
@@ -215,5 +221,6 @@ void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
var dpx = diffPair(pathRes, pathResD);
__bwd_diff(tracePath)(1, dpx); // Expect: 5.0 in outputBuffer[3]
}
-
}
+
+//CHK-NOT: note \ No newline at end of file