math functions

Any references anywhere for the math functions on the gpu? The programming guide only says a little bit, and that’s mostly just precision information. I’ve also looked around in the cuda header files with no success. Any place I’m missing?

All the math functions are in the include files math_functions_dbl_ptx*.h

Ah ha. math_functions_dbl_ptx3.h seems to have host versions of the device math functions? Which I guess I can parse to get some sense of what the functions actually are doing? Seems like a complicated way of say, figuring out what in the world ldexp does, but its better than no information at all. Although higher level explanations would be nice.

Oh wait. I just noticed that that is device code. Is this actually the code that executes the math functions on the gpu in terms of the gpu’s atomic math functions? Why is it in a header file?

These are all standard C math functions, so the easiest way to figure out their usage is to either use Google, or if you are on a Linux system, you can type “man [funcname]” and see a description.

As for why the header file?: Device functions are generally inlined, so a header file is a reasonable way to get the function definition to the compiler. Plus, it lets you see how the function is actually implemented on the device.

Excellent, thanks alot. I think i’d overspecified and searched for “$function cuda” in Google, not knowing at all that they were standard c/c++ functions.