KhronosGroup / KhronosGroup/Vulkan-Docs
request: query capability for fp64 precision on basic ops
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
Applications targeting shaderFloat64 currently have no way to determine whether a device's basic double-precision arithmetic (add/sub/mul/fma) meets any particular accuracy bar. The only text governing 64-bit precision is the general statement that "the precision of double-precision instructions is at least that of single precision,". VK_KHR_shader_float_controls lets an application pin down policy, but don't assert anything about the accuracy of the underlying arithmetic.
After asking about this on discord I was told that mul/add are "probably very close to IEEE in practice", but I would like a device feature or something that can give a guarantee (as long as the device driver is conformant).
OpenCL's cl_khr_fp64 already makes a few guarantees.
> "Addition, subtraction, multiplication, fused multiply-add... are IEEE 754 compliant and are therefore correctly rounded."
I believe we can't retroactively mandate this, but can we add some sort of property, say `shaderBasicOpsIEEECompliantFloat64` that asserts that OpFAdd, OpFSub, OpFMul, and OpFmaKHR on 64-bit floats are correctly rounded per IEEE 754, mirroring the OpenCL clause? I don't know too much about vulkan spec politics but I can't see why this would be difficult to implement
Contributor guide
Assessment
This issue has not been assessed yet.