|[eigen] Custom memory allocation for SparseMatrix?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] Custom memory allocation for SparseMatrix?
- From: Ola Røer Thorsen <ola@xxxxxxxxxxxxxx>
- Date: Fri, 15 Apr 2016 13:22:18 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silentwings-no.20150623.gappssmtp.com; s=20150623; h=mime-version:date:message-id:subject:from:to; bh=nXAsurKTkTFkOBJ60Utk1JjWlfwPn0wWzbC9s48hYu0=; b=R2Vuk0UiJ6jfxcgl/3GKW8MpYVC7X/w5vNYTnsu7N00AQkw9zvMYe3zAvv/0QV6j+Q D8lCUNzqgwXRnMtFv9/kq1S9vS/VLmpVAWYHNBaOmLmfJEJ3ct+mCuaiJYoiJodLs6cF PEJFJqhd7++hvTYvzLeVvQ4Twk9rE8xY8S1d0EejH2EL0dJQHrThyL2afGooQQ6lDZ4/ hVItTn9LXIeoSHeZmSv03m3untyUf+n/FafHaaBOaD+dWJAviE9vFzARQKjTdU/3F6G3 EylUQ6kCxPXO3GiyHIFeBw1KPlLUPYeRsDNQBSAPzg7lMCbyZcGhIF29pqcNE1/Ld5PD gfyA==
I'm using Eigen 3.2 on a STM32F7 arm mcu. Quite successfully so far!
The memory on this device is separated into two parts, where there is some Tightly-Coupled Memory (64k) that we use for the stack and statically initialized variables. This memory is significantly faster to use compared with the normal memory.
I want to use a sparse matrix for a calculation. As far as I can see SparseMatrix uses regular memory allocation from the heap (new/delete). In my case, this uses the regular "slow" memory. It runs ok, but I know there is much gain in using the DTCM memory..
Is there some trivial way to make SparseMatrix use a custom allocator? I guess one alternative is to modify my version of Eigen so that the CompressedStorage class does something else than normal, but it would be nice not having to modify Eigen itself.
Ola Røer Thorsen