Re: [eigen] Custom memory allocators with eigen |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Custom memory allocators with eigen
- From: Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Mar 2021 15:52:40 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-bremen.de; s=2019; t=1615992761; i=@uni-bremen.de; bh=FaC4hpYxG+w5cke+sBLAeQi2ibdFJnWHqefZcC/MiY0=; h=To:References:From:Date:In-Reply-To; b=HIQ/vnWLaaT6aUqU2R4shjt6/ToO71UcqGQ2dNPl91AFcewTYdLtVPZjh5fHPE6z4 6tK09LhPJ2qDKtbfPtshw7QPTLYdCf7luo172uApw3yxsSjyid8II+x7sN3SJeCKIb DozdcBN+01l8v54lTOHMqANwOMcZrDCrkqWXqVxSP40aLR70glucU+n141Li6RdnPR 9mI8h0w4Jvbw5nTru7qpdKHV9Z4GHBAEXJv0tynOu33E8irWWyYcDmhkSnbdkC3YAl zm7nTrht3F1/l2AccUKirOo22t6VqkYXN7nLcUeX4RiDNUlyCjkQT8RdtFVgX43U6J 3BTQM1iREBr3A==
I don't think we require alignment for sizes below 16 bytes, so this
should be fine (but I'd need to check to be sure).
Depending on the target architecture, you may however get problems if
memory is not aligned to 32 byte, when allocating 32 bytes or more.
Cheers,
Christoph
On 17/03/2021 14.21, Edward Lam wrote:
On Wed, Mar 17, 2021 at 4:10 AM Alberto Luaces wrote:
FWIW, on a side note, jemalloc required defining
EIGEN_MALLOC_ALREADY_ALIGNED to 0 the last time I tried it because its
allocator didn't guarantee always 16-byte aligned pointers. For really
small allocations, it can return 8-byte aligned pointers.
Thanks for pointing that!. In the case the wrong alignment were used,
would I expect to have a SIGSEV (or similar) or just bogus results?
As far as I recall, I ran into crashes but it wasn't obvious that it was an
alignment issue so it's possible that bogus results are possible. Having
said that, you'd need to have very small matrices to run into this.
-Edward
--
Dr.-Ing. Christoph Hertzberg
Besuchsadresse der Nebengeschäftsstelle:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Postadresse der Hauptgeschäftsstelle Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 1
28359 Bremen, Germany
Tel.: +49 421 178 45-4021
Zentrale: +49 421 178 45-0
E-Mail: christoph.hertzberg@xxxxxxx
Weitere Informationen: http://www.dfki.de/robotik
-------------------------------------------------------------
Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
Trippstadter Straße 122, D-67663 Kaiserslautern, Germany
Geschäftsführung:
Prof. Dr. Antonio Krüger (Vorsitzender)
Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats:
Dr. Gabriël Clemens
Amtsgericht Kaiserslautern, HRB 2313
-------------------------------------------------------------