Extend host function to device function

I want to use functions in complex.h like cabs() on device, but those functions are defined to be host functions, how can I extend them so that I can use them on GPU.

There isn’t any way really.

You could write your own version, or for complex functions you could look to see if there is something similar in cuComplex.h or else do you work by including thrust::complex