I have the following example code
It is called on a block of 1 with 4 thread as an example.
The contents of a always seem to be zero. From an automatic variable in local space, can you call a
a device with one of the parameters being the address of a local variable?
Thanks in advance and see code below for example.
RalphB
device uint32_t calculate(int *a)
{
printf(“address of a=%d\n”,*a);
return 0;
}
global void loop1(unsigned int a)
{
int a[16];
int i;
int threadidx= threadIdx.x
for (i=0;i<16;i++)
{
a[i]=i+threadidx;
}
printf("threadidx=%d\n",threadidx);
calculate(a[threadidx]);
}