Dear Sirs,
I need a device version of the following
host code:
double (**func)(double x);
double func1(double x)
{
return x+1.;
}
double func2(double x)
{
return x+2.;
}
double func3(double x)
{
return x+3.;
}
void test(void)
{
double x;
for(int i=0;i<3;++i){
x=func[i](2.0);
printf("%g\n",x);
}
}
int main(void)
{
func=(double (**)(double))malloc(10*sizeof(double (*)(double)));
test();
return 0;
}
where func1, func2, func3
have to be device functions
and “test”
has to be a (suitably modified) global kernel.
I have a NVIDIA GeForce GTS 450 (compute capability 2.1)
Thank you in advance
Michele