2 Replies Latest reply on Mar 24, 2010 10:53 AM by notyou

    2D arrays possible?

    notyou

      Hello everyone,

      I've been browsing the web for an answer to this for a while and I wasn't able to find an exact answer. In something like matrix multiplication, can we do something like:

      for(a=0 -> X)

      for(j = 0 -> Y)

      Matrix[a][j] = ...

      or do we need to flatten the array into a 1D array and then use our global/local address + an offset to get the actual element to work on?

      If we can't do a 2D array, can we access data structures, such as a struct containing all relevant matrix information?

      Thanks for the help.

        • 2D arrays possible?
          nou

          you need flatten array.

          and you can pass struct as kernel parameter. you can look at MonteCarloAsian example from ATI Stream SDK.

            • 2D arrays possible?
              notyou

               

              Originally posted by: nou you need flatten array.

               

              and you can pass struct as kernel parameter. you can look at MonteCarloAsian example from ATI Stream SDK.

               

              Thanks for the info. I will definitely look into the Monte Carlo example to see how to pass a struct. Thanks again.