FIAS . Impressum . Privacy

conversion of Vector<double> to Vector<long>

Matthias Kretz [please enable javascript to see the address]
Tue Mar 29 12:31:46 CEST 2016


Hi Kay,

sorry, but long and long long are not yet supported with Vc. 64-bit integers, 
BTW, have really bad SIMD hardware support (at least on the architectures I 
checked). You should really try to live with Vector<int> instead, even if Vc 
had Vector<long>. Why do you need 64-bit integers? If the numeric range of 32 
bits suffices then you should rather consider using `SimdArray<double, 
Vector<int>::size()>`.

Cheers,
  Matthias

On Sunday, March 27, 2016 12:51:32 PM CEST Kay F. Jahnke wrote:
> Hi group!
> 
> I'm trying to convert a Vector<double> to a Vector<long> - or
> Vector<llong>. While casting Vector<float> to Vector<int> works just
> fine, the code for Vector<double> to Vector<long> won't compile.
> 
> I tried both conventional cast and simd_cast, but neither works. Here's
> the code I can't get to compile:
> 
>    Vc::Vector<double> dv ;
>    Vc::Vector<long> lv ( dv ) ;
>    lv = Vc::Vector<long> ( dv ) ;                     // fails
>    lv = Vc::simd_cast < Vc::Vector<long> > ( dv ) ;   // fails as well
> 
> I'm using a core i5 running Kubuntu 14.04.04 with gcc 4.8.4 and Vc
> 1.2.0-dev up-to-date from the repo as per today.
> 
> I'd really like the cast to work, so that I can write generic code
> running both with the int/float and the long/double combinations. The
> sizes of the underlying types match, both are 8 bytes long.
> 
> Am I maybe missing something, like a conversion routine I haven't found
> in the docs?
> 
> with regards
> 
> Kay F. Jahnke
> 
> 
> _______________________________________________
> Vc mailing list
>[please enable javascript to see the address]
> https://compeng.uni-frankfurt.de/mailman/listinfo/vc


-- 
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                                https://kretzfamily.de
 GSI Helmholtzzentrum für Schwerionenforschung             https://gsi.de
 SIMD easy and portable                     https://github.com/VcDevel/Vc
──────────────────────────────────────────────────────────────────────────


More information about the Vc mailing list
FIAS . Impressum . Privacy