bukk530
bukk530

Reputation: 1895

Cuda math functions

I'm trying to use the floor() function inside a cuda kernel, but I always get the following error : calling a host function("floor ") from a global function(" ") is not allowed.

I also included the cuda "math_functions.h", so what am I doing wrong?

Upvotes: 3

Views: 10737

Answers (1)

Marco A.
Marco A.

Reputation: 43662

You're probably mismatching the type of the argument and thus calling a host code function as a "fallback mechanism".

Make sure you're using the right type for the function (which is not float, but double: http://docs.nvidia.com/cuda/cuda-math-api/).

Also note the documentation stating

To use these functions you do not need to include any additional header files in your program.

Upvotes: 4

Related Questions