math - How do I copy a 1d linear array into a 3d array without conflicts? (CUDA) -


this isn't cuda specific.

basically, on gpu have 1d array, in c code, have 3d array. need copy array , forth, , need able linear-ize indices properly. means have pick correct numbering scheme, in (1, 0, 0) linear-ized 1, or (0, 1, 0), or (0, 0, 1), in form (x, y, z)?

the 3d arrays declared array[x][y][z]. when copy 3d array equal sized 1d array, how computer naturally number it? computer collapses down 3d array, need exact same when try convert between two. hope making clear want say, if have questions, please ask. thank you.

arrays in c kept in row-major order, see this more details.

so first element array[0][0][0], second array[0][0][1], , etc.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -