2d array and recursive functions in cuda

Hi
I need help how to use the following things

  1. How 2d array dynamically allocating in CUDA
    2)if this 2d array is an element of structure and how to use it
  2. how implement functions equivalent to recursive functions
    I request to one and all to reply for the same with suitable examples
  1. Don’t use 2D arrays unless you really have to. Flatten them as 1D: [url]c - 2D array on CUDA - Stack Overflow

  2. This also is not ideal: [url]c++ - How to perform deep copying of struct with CUDA? - Stack Overflow

  3. You can do recursion via C++ templates like so: [url]http://users.softlab.ntua.gr/~ttsiod/cudarenderer-BVH.html[/url]
    or via dynamic parallelism (requires Compute Capability 3.5+ device:
    [url]http://developer.download.nvidia.com/assets/cuda/files/CUDADownloads/TechBrief_Dynamic_Parallelism_in_CUDA.pdf[/url]