Overhead of creating a matrix?

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

Moderator: pavanky

Overhead of creating a matrix?

Postby rm9 » Tue May 27, 2014 6:55 am

I have a function that runs a few thousands times, it does something like this pseudocode:
Code: Select all
void f(const array& data) {
  array p(s,1);
  array c(s,1);
  for ... {
    p = sum(data(...));
    c = accum(data(...));
   }
}


Is there any overhead of the p and c declaration? will it be more efficient if I put those variables as member variables in my class?
Thanks.
rm9
 
Posts: 54
Joined: Thu Jan 30, 2014 5:44 am

Re: Overhead of creating a matrix?

Postby pavanky » Tue May 27, 2014 8:48 am

There isn't. But that part is not necessary.
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