Reputation: 61
How do I find logarithm in cuda? I'm looking for a device function.
Thanks
Upvotes: 5
Views: 7074
Reputation: 13733
You can use:
logf(x)
__logf(x)
log2f(x)
__log2f(x)
log10f(x)
__log10f(x)
Taken from the CUDA Programming Guide (Appendix D).
Upvotes: 8
Reputation: 48330
As Ade says log* functions. Keep in mind that __log* might be fast but not accurate.
Upvotes: 0