Mixed-mode floating-point arithmetic (MMFPA) is a requirement of modern numerical computing. The need arises, for instance, when computations entail execution on graphics processing units (GPUs) interleaved with execution on general-purpose (GP) central processing units (CPUs). This paper starts with a comparative survey of CPFloat pitted against a dozen other libraries intended to facilitate such tasks, and proceeds with the unique contributions of CPFloat, inclusive of technical background and minimalistic how-to documentation.
CPFloat is meant for low-precision (as opposed to arbitrary precision) format interchange. It belongs to the family of MMFPA libraries that translate to and from a GP IEEE standard (limited to 32-bit or 64-bit floats for CPFloat), run the arithmetic on native GP hardware, and interface with low-precision GPU representations by simple conversion.
Its contribution is twofold. First, as a plethora of original algorithms needed to support rounding between representations in different precision. Techniques in CPFloat encompass a wide gamut spanning standard modes and novel modes (for example, stochastic rounding). It comprises a formal treatment of subnormal quantities somewhat obscure on first impression (it would have benefited from examples) but relevant. Other discussions of theoretical foundations also suffer from inhomogeneous levels of clarity.
Its second contribution is an efficient implementation strategy and a description of its coding, including validation for correctness. The proven performance is remarkable.
A missing validation is the relative comparison of precision and accuracy of extensive iterative computation. In fact, the accumulation of rounding errors in CPFloat remains unaddressed.
A must-read paper that presents technical background and minimalistic how-to documentation for the homonymous open-source code available from GitHub.