FIAS . Impressum . Privacy

Gather with class member arrays

Matthias Kretz [please enable javascript to see the address]
Wed Nov 27 11:52:28 CET 2013


On Tuesday 26 November 2013 15:44:09 Kulakov, Igor wrote:
> Hi Matthias,
> 
> is it possible to gather a[3]  from an dataArray like this one:
> 
> 
> struct TData {
>   float a[5];
> };
> 
> struct TData2 {
> 
>   TData a2;
> };
> 
> TData2 dataArray[N];
> 
> ?

No, the API is not generic enough at this point. I hope this can change in the 
future.
This would work:
struct TData2 {
  struct TData {
    float a, b, c, d, e;
  } a2;
} dataArray[N];

float_v x(dataArray, &TData2::a2, &TData2::TData::b, indexes);

Also this is supported:
struct TData {
  float a[5];
} dataArray[N];
float_v x(dataArray, &TData::a, outerIndexes, innerIndexes);

Cheers,
Matthias
-- 
─────────────────────────────────────────────────────────────
 Dipl.-Phys. Matthias Kretz

 Phone: +49 69 798 44110
 Web:   http://compeng.uni-frankfurt.de/?mkretz

 SIMD easy and portable: http://compeng.uni-frankfurt.de/?vc
─────────────────────────────────────────────────────────────
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://compeng.uni-frankfurt.de/pipermail/vc/attachments/20131127/d8c3b172/attachment.pgp>


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