I was wondering how to declare a volatile pointer to two dimensional shared memory and if this would have the same effect as for one dimensional arrays.
__shared__ float 2d_array[32][32];
// not working: volatile T ** smem = sdata;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note that your “two dimensional” shared memory array is, in fact, only one dimensional. So something like this:
is what you want. The static array
array_2dis stored in row major order and can be accessed as I have shown.