freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pooma-dev] How Write Data Parallel Statement?


From: Jeffrey Oldham
Subject: Re: [pooma-dev] How Write Data Parallel Statement?
Date: Thu, 12 Apr 2001 13:34:04 -0700
User-agent: Mutt/1.2.5i

On Thu, Apr 12, 2001 at 01:23:51PM -0700, Jeffrey Oldham wrote:
> On Thu, Apr 12, 2001 at 09:11:10AM -0700, Stephen Smith wrote:
> > There's a function that provides indices called Iota
> > that can be used for this:
> > 
> >     #include <cmath>
> >     #include "Pooma/NewFields.h"
> > 
> >     int main(int argc, char *argv[])
> >     {
> >       Pooma::initialize(argc,argv);
> > 
> >       Array<2,Vector<2> > c(5,4);
> >     Iota<2>::Iota_t ij(c.domain());
> > 
> >     c.comp(0) = ij.comp(0) * cos(ij.comp(1));
> >     c.comp(1) = ij.comp(0) * sin(ij.comp(1));
> > 
> >       // How do I write a data-parallel statement equivalent to?
> >       for (unsigned i = all values in c's domain's first component)
> >     for (unsigned j = all values in c's domain's second component)
> >       c(i,j) = Vector<2>(i * cos (j), i * sin (j));
> > 
> >       Pooma::finalize();
> >       return 0;
> >     }
> 
> Compiling the attached program, basically the same as you suggested,
> using gcc 3.1 causes numerous compilation errors.  Do you also see
> these errors?  I will now look into their sources.

The problem was that I was passing an `int' argument to cos() so it
was returning an `int' and then bitterly complaining.

Oops,
Jeffrey D. Oldham
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]