Status of math intrinsics

Hi all,

I would like to understand what is the status of math functions in CUDA.jl. In particular:

  1. Is it neccesary to write CUDA.sin? It looks to me that this calls are converted automatically when code is executed on the GPU. If one needs to write CUDA.sin explicitly, what is the recommendation to write modules that can be used both on the GPU and on CPU?
  2. I think that the documentation is outdated. It points to the file src/device/cuda/libdevice.jl that does not exist anymore. Instead it seems that this info is in src/device/intrinsics/math.jl
  3. Is there a CUDA version of the intrinsic sincos?

Thanks!

A.

With CUDA.jl 3.x and Julia 1.6/1.7, no, you no longer need to write CUDA.sin; calls to sin and similar math functions are automatically replaced by the compiler as-needed.

Please feel free to send a PR to update the docs!

It doesn’t appear so; maybe it’s because it libdevice’s sincos stores the results into pointers, which would thus require two extra stack allocations?