summaryrefslogtreecommitdiffstats
path: root/tests/cross-compile
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-01-23 06:59:25 -0800
committerGitHub <noreply@github.com>2023-01-23 06:59:25 -0800
commit46a4d98baa1d43b33717b4377aefeeaf46b9c2ff (patch)
treec89f3a1c416330f859887d00f896b18bcc7488a5 /tests/cross-compile
parent263ca18ea516cfce43fda703c0a411aaf1938e42 (diff)
Full address insts elimination for backward autodiff. (#2604)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/cross-compile')
-rw-r--r--tests/cross-compile/precise-keyword.slang.glsl9
-rw-r--r--tests/cross-compile/precise-keyword.slang.hlsl8
2 files changed, 11 insertions, 6 deletions
diff --git a/tests/cross-compile/precise-keyword.slang.glsl b/tests/cross-compile/precise-keyword.slang.glsl
index 17fed739e..027a8eb3b 100644
--- a/tests/cross-compile/precise-keyword.slang.glsl
+++ b/tests/cross-compile/precise-keyword.slang.glsl
@@ -11,15 +11,18 @@ in vec2 _S2;
void main()
{
+ float _S3 = _S2.x;
+
precise float z_0;
- if(_S2.x > float(0))
+ if(_S3 > 0.00000000000000000000)
{
- z_0 = _S2.x * _S2.y + _S2.x;
+ z_0 = _S3 * _S2.y + _S3;
}
else
{
- z_0 = _S2.y * _S2.x + _S2.y;
+ float _S4 = _S2.y;
+ z_0 = _S4 * _S3 + _S4;
}
_S1 = vec4(z_0);
return;
diff --git a/tests/cross-compile/precise-keyword.slang.hlsl b/tests/cross-compile/precise-keyword.slang.hlsl
index 54017868b..7a07fdc5e 100644
--- a/tests/cross-compile/precise-keyword.slang.hlsl
+++ b/tests/cross-compile/precise-keyword.slang.hlsl
@@ -3,15 +3,17 @@
float4 main(float2 v_0 : V) : SV_TARGET
{
+ float _S1 = v_0.x;
precise float z_0;
- if(v_0.x > (float) 0)
+ if (_S1 > 0.00000000000000000000)
{
- z_0 = v_0.x * v_0.y + v_0.x;
+ z_0 = _S1 * v_0.y + _S1;
}
else
{
- z_0 = v_0.y * v_0.x + v_0.y;
+ float _S2 = v_0.y;
+ z_0 = _S2 * _S1 + _S2;
}
return (float4) z_0;