OpenGL textures and cudaArray size

Hello.

I’m using OpenGL interop and trying to map an OpenGL texture to be used (written to) with CUDA.
Then I do a cudaGraphicsSubResourceGetMappedArray , in order to have that texture as a cudaArray
Then I’m willing to do a cudaMemcpyFromArray , so I can write to that texture.

So here I need some light:
cudaMemcpyFromArray needs to know the size of the array. How can I figure that from within the texture AS a mapped resource? Or should I know it previously?

Please shed lumens. Thanks!

Yes, you need to know the size of the texture, you could query this from OpenGL.

Yes, you need to know the size of the texture, you could query this from OpenGL.