Skip to content

Commit 94641c8

Browse files
committed
linmath: use correct 32-byte alignment when compiling Eigen with AVX
1 parent 8c6a2a5 commit 94641c8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

dtool/src/dtoolbase/dtoolbase.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,21 +336,26 @@
336336
#define ALIGN_4BYTE
337337
#define ALIGN_8BYTE
338338
#define ALIGN_16BYTE
339+
#define ALIGN_32BYTE
339340
#define ALIGN_64BYTE
340341
#elif defined(_MSC_VER)
341342
#define ALIGN_4BYTE __declspec(align(4))
342343
#define ALIGN_8BYTE __declspec(align(8))
343344
#define ALIGN_16BYTE __declspec(align(16))
345+
#define ALIGN_32BYTE __declspec(align(32))
344346
#define ALIGN_64BYTE __declspec(align(64))
345347
#elif defined(__GNUC__)
346348
#define ALIGN_4BYTE __attribute__ ((aligned (4)))
347349
#define ALIGN_8BYTE __attribute__ ((aligned (8)))
348350
#define ALIGN_16BYTE __attribute__ ((aligned (16)))
351+
#define ALIGN_32BYTE __attribute__ ((aligned (32)))
349352
#define ALIGN_64BYTE __attribute__ ((aligned (64)))
350353
#else
351354
#define ALIGN_4BYTE
352355
#define ALIGN_8BYTE
353356
#define ALIGN_16BYTE
357+
#define ALIGN_32BYTE
358+
#define ALIGN_64BYTE
354359
#endif
355360

356361
// Do we need to implement memory-alignment enforcement within the

panda/src/linmath/lsimpleMatrix.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ class LSimpleMatrix {
6161
#endif // HAVE_EIGEN
6262

6363
// This is as good a place as any to define this alignment macro.
64-
#ifdef LINMATH_ALIGN
64+
#if defined(LINMATH_ALIGN) && defined(HAVE_EIGEN) && defined(__AVX__)
65+
#define ALIGN_LINMATH ALIGN_32BYTE
66+
#elif defined(LINMATH_ALIGN)
6567
#define ALIGN_LINMATH ALIGN_16BYTE
6668
#else
6769
#define ALIGN_LINMATH

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy