sizeof VC object
Matthias Kretz
[please enable javascript to see the address]
Wed Oct 5 15:43:28 CEST 2016
[please enable javascript to see the address] wrote:
> A code example is below. Can someone explain where to research
> code that makes sizeof return these values?
I'm not sure I understand your question. Are you asking why sizeof returns the
values it returns?
In any case, sizeof(Vector<T>)/sizeof(T) is not guaranteed to be equal to
Vector<T>::size().
Cheers,
Matthias
> I am researching because this
> approach does not work with UMESimd.
>
> I uploaded my extraction from VecGeom to
> https://github.com/nicholasferguson/Portable_SIMD
>
> for code below, preprocessor is VECCORE_ENABLE_VC
>
> ==================== code for file backend.cpp ===================
>
> #include <VecCore/VecCore>
>
> int main(int argc, char *argv[])
> {
> using T = Vc_1::Vector<float, struct Vc_1::VectorAbi::Avx>;
> size_t c = sizeof(T); // c is 32
> size_t t = sizeof(vecCore::Scalar<T>); // t is 4
> size_t VectorSize = c / t; // VectorSize is 8
>
> return 0;
> }
> ==================== code ===================
>
>
>
> _______________________________________________
> 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