cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ttho
Journeyman III

How can I iterate through shortarrays?

Hi,

how can I iterate with a while or for loop through shortarrays?

I image something like this:

int[3];

for(i = 0; i < 3; i++)

{

int= something;

}

Is this possible with shortarrays inside kernels? How?

 

Thanks

0 Likes
3 Replies
Methylene
Journeyman III

Might this be a scenario that branching would help?

You can call kernels from kernels.  There's info on it in the SDK docs.  There's penalties for this, as from what I understand each time a branch is encountered, it stops all other threads and works to finish the branch... I think that's what they meant anyhow...  Thus branches cause a sort of exponential increase in calculations.

0 Likes

I think not so, or I doesnt understand correctly whar you mean.

I have to use shortarrays because of local streams are not supported. =(

Otherwhise i have to unroll the loop which ends in tricky, bad readable & long code. I doesnt want to go this way, so I am searching for an alternative.....

 

0 Likes

ttho,
Local array support is currently not in brook+. In order to use local arrays you need to access AMD HLSL or CAL IL.
0 Likes