Re: [eigen] Small dynamic matrix optimization |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Small dynamic matrix optimization
- From: Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 21 Oct 2019 16:15:22 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-bremen.de; s=2019; t=1571667323; i=@uni-bremen.de; bh=WokAcabSneoNy8kUMV46QEo13JtN9lJKDR4JP17cpfc=; h=To:References:From:Date:In-Reply-To; b=qbuklPU3z6+bEDH8tKOkMbto9hUKkNgekF08GxCBkFfcG1ruEA0MqHoZSqSw5ycJ7 iL3A6OKxGc6cqa/G+PxqLC6w5lXpodHIsKOAkln1BYSFqHNv+ydvuQNi9S9SL3a51/ +U4UYT4NZMN2fo8Xgqpb7lSAzGo3hcHi2krzry/HRBPXYysw7sm8/XQWRNgVqz2n+P obEsxljZTPMMeZMUhpzKCUsq5BtQXLYi3NlCWZeSTTSiqVV6vwhTMZkOhrz6gRvHj6 uxwHGCPjKTzWPuILj4aIquizeXOxVKyOyY95eh6opKCp0MkW44tKL2Rq/WjcFzm5mV PVOHdZ9LUd/Pg==
This is already done for some temporaries (like blocks in
cache-optimized GEMM). Doing that for custom types would be interesting,
but not trivial (e.g., move-behavior is completely different, if you
want to move the data to an object higher in the stack).
If you are ok with managing data yourself, you can manually achieve this
by alloca/allocate-ing data yourself and use an Eigen::Map to refer to
the data.
If you have a proof-of-concept how this could be integrated into the
Eigen API, we are open for suggestions!
Another idea would be to allow custom allocators for matrices -- in that
case the custom allocator could very easily be a stack-allocator (which
would not even need to use the "main" stack). But that's also not too
easy to integrate without breaking the current API (adding a new type
would of course be an option for that).
Cheers,
Christoph
On 21/10/2019 15.39, Rob Conde wrote:
I'm wondering if a small dynamic matrix optimization has been considered. In other words, allowing a stack allocation for matrices of unknown size up to a certain limit and using a heap allocation beyond that?
Rob Conde
--
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 Strasse 122, D-67663 Kaiserslautern, Germany
Geschäftsführung:
Prof. Dr. Jana Koehler (Vorsitzende)
Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats:
Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
-------------------------------------------------------------