Open kpet opened 5 years ago
add support for double to the built-in functions
Do they need to be emulated?
Currently some are mapped to ExtInst
s (like here) which are not specified for fp64:
https://www.khronos.org/registry/spir-v/specs/unified1/GLSL.std.450.html#_extended_instructions
add support for double to the built-in functions
Do they need to be emulated? Currently some are mapped to
ExtInst
s (like here) which are not specified for fp64: https://www.khronos.org/registry/spir-v/specs/unified1/GLSL.std.450.html#_extended_instructions
I know this is years late, but my understanding is that none of the current desktop GPU makers have hardware accelerated double precision trigonometry (ie they don't have special function units for). Nvidia appears to only have single precision SFU, even on their server GPUs.
https://forums.developer.nvidia.com/t/sfu-performance-in-a100/197699/12
https://docs.nvidia.com/cuda/pdf/CUDA_C_Programming_Guide.pdf see "Maximize Instruction Throughput"
This means "emulated" double precision functions are literally how special functions are handled on Nvidia cards (aside from basic arithmetic operations). Note not all double precision functions need to be "emulated" https://registry.khronos.org/SPIR-V/specs/unified1/GLSL.std.450.html#_introduction
For GLSL functions, this means Trig, Log, Pow, and Exp functions all required to be "emulated", for OpenCL, additional functions would need to be emulated (like gamma etc...).
clspv generally doesn't have support for double-precision floating point. The following at least are missing: