问题
How do I find logarithm in cuda? I'm looking for a device function.
Thanks
回答1:
You can use:
logf(x)
__logf(x)
log2f(x)
__log2f(x)
log10f(x)
__log10f(x)
Taken from the CUDA Programming Guide (Appendix D).
回答2:
As Ade says log* functions. Keep in mind that __log* might be fast but not accurate.
来源:https://stackoverflow.com/questions/5355557/find-logarithm-in-cuda