I need to use some functions from math.h in my device code. From my reading of recent documents etc this is possible with Version 4.0, which I have.

My example code is

#include <math.h>

**global** void kernel(void)

{

exp(1);

}

int main(void)

{

kernel<<<1,1>>>();

return 0;

}

I run nvcc and it gives me

simple_kernel.cu(4): error: calling a host function("std::exp ") from a **device**/**global** function(“kernel”) is not allowed

How can I get the device side version of my math functions in the device side code.

Sorry if this is awfully simple, Im rather a newbie at this.

Thanks for your time.

Thanks for your time