aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/ConfigureVectorization.h
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2018-09-14 20:17:47 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2018-09-14 20:17:47 +0200
commitd7378aae8e87f85fcf825bf3a04501a16aca4780 (patch)
tree9525f54d66f2704594a3a435b60193e48caa57ab /Eigen/src/Core/util/ConfigureVectorization.h
parent9b864cdb3789dbddaa26e53dd85393713b24ce94 (diff)
Provide EIGEN_ALIGNOF macro, and give handmade_aligned_malloc the possibility for alignments larger than the standard alignment.
Diffstat (limited to 'Eigen/src/Core/util/ConfigureVectorization.h')
-rw-r--r--Eigen/src/Core/util/ConfigureVectorization.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/ConfigureVectorization.h b/Eigen/src/Core/util/ConfigureVectorization.h
index f30503b33..e75c7d89e 100644
--- a/Eigen/src/Core/util/ConfigureVectorization.h
+++ b/Eigen/src/Core/util/ConfigureVectorization.h
@@ -39,15 +39,19 @@
*/
#if (defined EIGEN_CUDACC)
#define EIGEN_ALIGN_TO_BOUNDARY(n) __align__(n)
+ #define EIGEN_ALIGNOF(x) __alignof(x)
#elif EIGEN_COMP_GNUC || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM
#define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
+ #define EIGEN_ALIGNOF(x) __alignof(x)
#elif EIGEN_COMP_MSVC
#define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n))
+ #define EIGEN_ALIGNOF(x) __alignof(x)
#elif EIGEN_COMP_SUNCC
// FIXME not sure about this one:
#define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
+ #define EIGEN_ALIGNOF(x) __alignof(x)
#else
- #error Please tell me what is the equivalent of __attribute__((aligned(n))) for your compiler
+ #error Please tell me what is the equivalent of __attribute__((aligned(n))) and __alignof(x) for your compiler
#endif
// If the user explicitly disable vectorization, then we also disable alignment