|[eigen] platform detection for aligned malloc|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] platform detection for aligned malloc
- From: "Benoit Jacob" <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 9 Jan 2009 00:01:41 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=DU9Fl3F2mIzsqHF5RFay4rW9tU8L5IyC/lZ8AEJhztU=; b=PAjCSTQD9DRjfGZmH/x29C5/l5I2WtdiTSsGwhrsWWuKWBEqLBaQrccc7LOmH+Qukx HhUTDTtss9JrVA6OlJuqOJcl99ulHNFSk58PdN2lRDc8oDNJgLY8nBD3D8Ls30rguvNa 0PeYohFtMPeXY56dLfMbTHsE8SpwdtkuwVRyw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=cU2J2i9pN5n8FWHpHtaM4QMtH/BZ4CAcpYmb4NjLH6oF7q4T1qxhQFUMRWZXscLf71 tLTxWBJ8UXZA7f//N3oz3B+hoPHO7mpXYf837SQZtYWKy7P6ImGCUbPAiaxD8EtK5s2n xtApbHPHErjWiB491PyZlPZw74xs5hXDHEke8=
I'm reworking the platform detection for aligned malloc.
One recent change is that we now need aligned malloc even if
vectorization is not used. So if we want to use _mm_malloc we need to
use it from another header than emmintrin.h. I heard there's a
mm_malloc.h on some platforms but i'm not too sure.
Another finding i made is that on freebsd too, malloc() is 16 byte aligned.
Please find attached a patch, it's the best i can do but it needs improvements.
--> question: in current SVN we always add manually the prototype of
posix_memalign. with this patch, we do it only if not declared by
<cstdlib> that is if _XOPEN_SOURCE<600. Anyway, is this really good
practice? If XOPEN_SOURCE<600 then maybe we really can't use
posix_memalign, i mean, there's got to be a reason why it's not
---> need to check especially with GCC 3...
*Mac OSX and FreeBSD:
---> Problem solved, we use malloc()
---> no clue
----> no clue
----> problem solved, we use _aligned_malloc
---> we use _mm_malloc. Question: do we need to #include some header,
like <mm_malloc.h>? When vectorization is not enabled we can't count
---> Gael formerly made it use _mm_malloc, so same question as ICC,
which header to include?