upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/run_gpu_tests.py
diff options
context:
space:
mode:
authorubiquitarianism <283527159+ubiquitarianism@users.noreply.github.com>2026-11-24 10:50:14 -0500
committerGitHub <noreply@github.com>2026-11-24 10:50:14 -0500
commitd4b3a001d2214d834fba153a0f8d8c9fdc90d691 (patch)
tree417a6618a44eae8c13adcee7497fd9f581ca39b9 /scripts/run_gpu_tests.py
parenta28927849adb4e40dfdec8c32fb6758dcd205a37 (diff)
parent10b0052e570cc6786681bbcf36b61d85b20fc5a8 (diff)
Merge pull request #572 from DeSunShine/fma64-rt
rdna2spirv, docs: NVIDIA splits a binary64 Fma only when folding an all-constant one; add cs_div_fmas_f64_rt (FMA64-RT)
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 80b380d9e..46fa6faa6 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -264,6 +264,8 @@ def read_raw_u32(path: str) -> list[tuple[int, int, int, int]]:
264 return [struct.unpack_from("<4I", data, 16 * i) for i in range(n)] 264 return [struct.unpack_from("<4I", data, 16 * i) for i in range(n)]
265 265
266 266
267# cs_div_fmas_f64_rt's operands a = 1 + 2^-30, c = -(1 + 2^-29) as s4..s7 (low word first).
268DIV_FMAS_F64_SGPRS = "0x00400000,0x3ff00000,0x00800000,0xbff00000"
267UNSUPPORTED = 77 # vk_harness: the device lacks a stage the test draws with (geometry or mesh shaders) 269UNSUPPORTED = 77 # vk_harness: the device lacks a stage the test draws with (geometry or mesh shaders)
268 270
269 271
@@ -1102,10 +1104,12 @@ def run_suite(a, work: str) -> int:
1102 ok, detail = judge_cs_dump(rc, msg, [0, 0x40040000], wave64=False, partial=False, emulated=False, 1104 ok, detail = judge_cs_dump(rc, msg, [0, 0x40040000], wave64=False, partial=False, emulated=False,
1103 hexwords=True) 1105 hexwords=True)
1104 results.append((name, ok, detail)) 1106 results.append((name, ok, detail))
1105 elif name == "cs_div_fmas_f64": 1107 elif name in ("cs_div_fmas_f64", "cs_div_fmas_f64_rt"):
1106 # One-rounding binary64 FMA: strict where the translator emitted OpFmaKHR on doubles (shaderFmaFloat64, 1108 # One-rounding binary64 FMA: strict where the translator emitted OpFmaKHR on doubles (shaderFmaFloat64,
1107 # --fma khr); under the default GLSL Fma the split result (0) is allowed, as cs_fma_fused allows it. 1109 # --fma khr); under the default GLSL Fma the split result (0) is allowed, as cs_fma_fused allows it.
1108 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=cs_env) 1110 # The _rt fixture reads the same operands from s4..s7, so the driver cannot fold the Fma at compile time.
1111 env = dict(cs_env or os.environ, VKC_SGPRS=DIV_FMAS_F64_SGPRS) if name.endswith("_rt") else cs_env
1112 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=env)
1109 if rc == UNSUPPORTED: # no shaderFloat64, or (--fma khr) no shaderFmaFloat64 1113 if rc == UNSUPPORTED: # no shaderFloat64, or (--fma khr) no shaderFmaFloat64
1110 results.append((name, None, unsupported_skip(msg))) 1114 results.append((name, None, unsupported_skip(msg)))
1111 else: 1115 else:
@@ -1115,7 +1119,8 @@ def run_suite(a, work: str) -> int:
1115 ok = rc == 0 and (words == fused or (not strict and words == split)) 1119 ok = rc == 0 and (words == fused or (not strict and words == split))
1116 detail = " ".join(hex(x) for x in words) if words else msg 1120 detail = " ".join(hex(x) for x in words) if words else msg
1117 if ok and words == split: 1121 if ok and words == split:
1118 detail += " (split: the driver rounds GLSL Fma on doubles twice; --fma khr fixes it)" 1122 detail += (" (split: the driver rounded GLSL Fma on doubles twice%s; --fma khr fixes it)"
1123 % ("" if name.endswith("_rt") else " when folding the constants"))
1119 results.append((name, ok, detail)) 1124 results.append((name, ok, detail))
1120 elif name == "cs_cvt_f32_sat": 1125 elif name == "cs_cvt_f32_sat":
1121 # #300's saturating float -> int conversions: one dispatch per input word in s4 (VKC_SGPRS). 1126 # #300's saturating float -> int conversions: one dispatch per input word in s4 (VKC_SGPRS).