listhelper-moderate
[Top][All Lists]
Advanced

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

help-gplusplus post from address@hidden requires approval


From: help-gplusplus-owner
Subject: help-gplusplus post from address@hidden requires approval
Date: Wed, 04 Jul 2007 02:40:14 -0400

As list administrator, your authorization is requested for the
following mailing list posting:

    List:    address@hidden
    From:    address@hidden
    Subject: Re: Vectorization in gcc 4.1.1
    Reason:  Post by non-member to a members-only list

At your convenience, visit:

    http://lists.gnu.org/mailman/admindb/help-gplusplus
        
to approve or deny the request.
--- Begin Message --- Subject: Re: Vectorization in gcc 4.1.1 Date: Wed, 04 Jul 2007 05:51:59 GMT
rameshk <address@hidden> wrote in message...
> Hi,
> I was trying to get gcc to vectorize a simple loop:
>
> #include <vector>
// > int test(double *x , int size);
>
> int test(double *x, int size){
>         int ret = 1;
>         std::vector<double>     v;
>         v.resize(size);
>         double  *a = &v[0];

   std::cout<<"sizeof(double)="<<sizeof(double)<<std::endl;
   std::vector<double> vD( 10 );
   std::cout<<"sizeof(vD)="<<sizeof(vD)<<std::endl;
/* - out -
sizeof(double)=8
sizeof(vD)=12
*/

>         for(int i = 0;i < size; ++i )
>         {
>                 a[i ] = 1/x[i];      // ka-boom
>         }
>
> }

int test( double *x, int size ){
     int ret = 1;
     // std::vector<double> v( size );
     // for( std::size_t a(0); a < v.size(); ++a ){  v.at( i ) = 1/x[i]; }
// for(a)

     std::vector<double> v( x, x + size );

     // .... do something with 'v'
     return ret;
     }

--
Bob R
POVrookie



--- End Message ---
--- Begin Message --- Subject: confirm f4976f2c5dbb669c560603de53c8d6facf891f8c
If you reply to this message, keeping the Subject: header intact,
Mailman will discard the held message.  Do this if the message is
spam.  If you reply to this message and include an Approved: header
with the list password in it, the message will be approved for posting
to the list.  The Approved: header can also appear in the first line
of the body of the reply.

--- End Message ---

reply via email to

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