multi-d array mapping onto grid/block/thread

This may be a simple question, but I cannot find answer.

is there some library to map multi-d array to the CUDA grid/block/thread hierarchy, so developer can manipulate the the array index with little efforts (not the blockIdx/threadIdx/… computation each time)? something like in MPI_Cart_create. If no, how good and beneficial for developers to have such library for CUDA?

also another simpler one, can I create a multi-d array (like int myarray [10][10][10]) in device code?

thanks very much!

Any multi-d array can be mapped to one dimentional

[10][10][10]-> [X+10Y+100Y]

or two as you wish