Rounded subtraction double precision intrinsic possible missing from libdevice

I noticed that the CUDA math API contains rounded single and double precision intrinsics for all the basic mathematic operations (add, sub, mul, div). Libdevice contains all the same intrinsics except for double precision subtraction for some reason (although it has single precision subtraction). Is it’s exclusion an oversight (and should a bug report be submitted) or was this intentional?

I believe all the functions are here. I doubt its an oversight, but I don’t know if there is a specific reason for “exclusion”. Probably best to just file a bug requesting whatever it is you desire. In the meantime, is a possible WAR to use dadd?

I guess I can just negate one of the inputs and do a dadd. Seems kind of obvious now that I think about it (and maybe that’s why it wasn’t included). I’ll look into filing a bug request, thanks!

If I recall correctly, when I first added these device functions intrinsics to CUDA, I did not include the dsub variants, only the dadd ones as it is really all the same at the machine instruction level. But because this is non-intuitive and potentially confusing for programmers, leading to questions such as the one in this thread, the dsub variants were added shortly thereafter.

Based on that, I think filing an RFE (request for enhancement) via NVIDIA’s bug reporting mechanism makes sense and is appropriate, even if these are just convenience functions. Other engineers may consider them redundant, though.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.