gfor and fir usage

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

gfor and fir usage

Postby simonrus » Fri Jul 11, 2014 8:04 am

Hello!

Could you please check why gfor doesn't work proper if I use it on the matrix columns. For-loop works just perfect
Here is example:
Code: Select all
const float FIR_NOMINATOR_COEF[] = {0.5,  0.3};   
static array FIR_NOMINATOR(2, FIR_NOMINATOR_COEF);

void test_parallel_fir() {
    array a = randn(6, 8);
    array b = a; //copy a to b
       
    gfor (array i, a.dims(1)) {
         a(span,i) =  fir(FIR_NOMINATOR, a(span,i)); 
         a.eval();
    }
 
    for (int j = 0; j < b.dims(1);j++) {
        b(span,j) =  fir(FIR_NOMINATOR, b(span,j)); 
    }
   
    print(a);
    print(b);       
}


In the provided example A and B are different. Could you please check what is wrong with this code?

Thank you
simonrus
 
Posts: 3
Joined: Thu Jun 05, 2014 2:40 pm

Re: gfor and fir usage

Postby pavanky » Tue Jul 15, 2014 1:59 pm

Hi,

You can use "convolve" instead of "fir" for this purpose. We are looking internally to see if we should deprecate fir for the future.
Pavan Yalamanchili,
ArrayFire
--
~ If it is not broken, you have not tried hard enough ~
User avatar
pavanky
Site Admin
 
Posts: 1123
Joined: Mon Mar 15, 2010 7:39 pm
Location: Atlanta, GA


Return to [archive-commercial] Programming & Development with ArrayFire

cron