Array of pointers inside a __device__ function MMU fault
Hello everybody.

As title say i need to access items of two arrays from the pointers stored into another array:

unsigned long elements[2][4], *pointers[2];

pointers[0]=elements[0];
pointers[1]=elements[1];

These declaration and assignement are inside a __device__ function.
But when i try to access items inside elements[] from pointers[] (for example with pointers[0][2]) i get an MMU fault.
Everything works fine if i try to access items inside elements[] from A and B declared in this way:

unsigned long elements[2][10], *A, *B;

A=elements[0];
B=elements[1];

but of course i don't need this :-/

Am i missing something ?

Thank you for answers.

P.S.: if it could help, code is compiled on win7 x64 with vs2008 and executed on a GTX460.
Hello everybody.



As title say i need to access items of two arrays from the pointers stored into another array:



unsigned long elements[2][4], *pointers[2];



pointers[0]=elements[0];

pointers[1]=elements[1];



These declaration and assignement are inside a __device__ function.

But when i try to access items inside elements[] from pointers[] (for example with pointers[0][2]) i get an MMU fault.

Everything works fine if i try to access items inside elements[] from A and B declared in this way:



unsigned long elements[2][10], *A, *B;



A=elements[0];

B=elements[1];



but of course i don't need this :-/



Am i missing something ?



Thank you for answers.



P.S.: if it could help, code is compiled on win7 x64 with vs2008 and executed on a GTX460.

#1
Posted 04/10/2012 11:10 AM   
Solved.

Thanks.
Solved.



Thanks.

#2
Posted 04/11/2012 02:11 PM   
Scroll To Top