cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

notyou
Adept III

2D arrays possible?

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 = ...

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.

0 Likes
2 Replies
nou
Exemplar

you need flatten array.

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

0 Likes

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.

0 Likes