how to allocate a 2d array in cudamalloc?

in my other post that you answered (and thank you so much) I present the calculations…i think it doesn’t work because it has to do with allocation of the 2d array or misuse of the pointer or I don’t know what is wrong.
Unfortunately I don’t have access to a pc with a GPU card to tell you what is exactly the compilation error. I will do it tomorrow night for sure…