cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

attilagenc
Journeyman III

Reduction Kernels

How to use reduction kernels in ATI CAL

Hi,

Does anybody know how to compile reduction kernels to use in ATI CAL environment?

 

thx

0 Likes
5 Replies
attilagenc
Journeyman III

Originally posted by: attilagenc Hi,

 

Does anybody know how to compile reduction kernels to use in ATI CAL environment?

 

 

 

thx

 

 

Hi all again

 

Can somebody suggest me a sample of reduction kernel usage in ATI CAL?

 

thx

 

0 Likes

maybe using generated code from ati stream kernel analyzer?

0 Likes

Hello.

I've decided to ask here for not to create new topic.

I have a kernel:

reduce void krnl(int input<>, reduce int n<>
{
   n += 1;
}

Let's say input is 1D stream of 160 elements (the number of stream processors on my 4850). What value should I get in first element of n? I was expecting 160, but I'm getting very strange results, 14 in this case. If I change kernel to n += 2 I get 23...

Please excuse my stupid question, I've only started learning Stream, and obviously I don't understand something about reduction kernels, but what's wrong in my example?

Thanks.

0 Likes

I documented that in reduction kernel we only can do these

reduce void reduceGPU(float input<>, reduce float output<>)

{

    //comparison

    //if(output < input)

    //if(output > input)

    //if(output <= input)

    //if(output >= input)

    //if(output == input)

    //if(output < a value for example 1.0f)

    //if(output > a value)

    //if(output <= a value)

    //if(output >= a value)

    //if(output == a value)

 

    if(output < input)

    output += input;

    //output -= input;

    //output *= input;

    //output /= input;

}

 

0 Likes

You mean output += constant_value isn't allowed? That's a surprise, thanks for info.

0 Likes