From 637647b941c3b5b75450263674037adbb6096f8b Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Tue, 14 May 2024 17:47:51 -0700 Subject: [PATCH] [upstream_utils] Improve Eigen intellisense fix (#6621) --- .../eigen_patches/0002-Intellisense-fix.patch | 35 +++++++++---------- .../src/Core/util/ConfigureVectorization.h | 7 ++++ .../include/Eigen/src/Core/util/Macros.h | 10 ------ 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/upstream_utils/eigen_patches/0002-Intellisense-fix.patch b/upstream_utils/eigen_patches/0002-Intellisense-fix.patch index 830162b647..2c7d477f29 100644 --- a/upstream_utils/eigen_patches/0002-Intellisense-fix.patch +++ b/upstream_utils/eigen_patches/0002-Intellisense-fix.patch @@ -4,27 +4,24 @@ Date: Fri, 20 Jan 2023 23:41:56 -0800 Subject: [PATCH 2/3] Intellisense fix --- - Eigen/src/Core/util/Macros.h | 10 ++++++++++ - 1 file changed, 10 insertions(+) + Eigen/src/Core/util/ConfigureVectorization.h | 7 +++++++ + 1 file changed, 7 insertions(+) -diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h -index 4d10eecd05db826ea5e6a65115022b19f1112c6a..5c8b3a3b3ea66c7bf5159f50c9ce09f7b90182d4 100644 ---- a/Eigen/src/Core/util/Macros.h -+++ b/Eigen/src/Core/util/Macros.h -@@ -60,6 +60,16 @@ - // Compiler identification, EIGEN_COMP_* - //------------------------------------------------------------------------------------------ +diff --git a/Eigen/src/Core/util/ConfigureVectorization.h b/Eigen/src/Core/util/ConfigureVectorization.h +index 1c7217339bcb2c29366360c56343863126d8aafc..e8f5d2ce0d5917ec7df65800ff115f59e028e14b 100644 +--- a/Eigen/src/Core/util/ConfigureVectorization.h ++++ b/Eigen/src/Core/util/ConfigureVectorization.h +@@ -165,6 +165,13 @@ -+/// \internal Disable NEON features in Intellisense -+#if __INTELLISENSE__ -+#ifdef __ARM_NEON -+#undef __ARM_NEON -+#endif -+#ifdef __ARM_NEON__ -+#undef __ARM_NEON__ + //---------------------------------------------------------------------- + ++// Disable vectorization in intellisense ++#ifdef __INTELLISENSE__ ++#ifndef EIGEN_DONT_VECTORIZE ++#define EIGEN_DONT_VECTORIZE +#endif +#endif + - /// \internal EIGEN_COMP_GNUC set to version (e.g., 951 for GCC 9.5.1) for all compilers compatible with GCC - #ifdef __GNUC__ - #define EIGEN_COMP_GNUC (__GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__) + // if alignment is disabled, then disable vectorization. Note: EIGEN_MAX_ALIGN_BYTES is the proper check, it takes into + // account both the user's will (EIGEN_MAX_ALIGN_BYTES,EIGEN_DONT_ALIGN) and our own platform checks + #if EIGEN_MAX_ALIGN_BYTES == 0 diff --git a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/ConfigureVectorization.h b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/ConfigureVectorization.h index 1c7217339b..e8f5d2ce0d 100644 --- a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/ConfigureVectorization.h +++ b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/ConfigureVectorization.h @@ -165,6 +165,13 @@ //---------------------------------------------------------------------- +// Disable vectorization in intellisense +#ifdef __INTELLISENSE__ +#ifndef EIGEN_DONT_VECTORIZE +#define EIGEN_DONT_VECTORIZE +#endif +#endif + // if alignment is disabled, then disable vectorization. Note: EIGEN_MAX_ALIGN_BYTES is the proper check, it takes into // account both the user's will (EIGEN_MAX_ALIGN_BYTES,EIGEN_DONT_ALIGN) and our own platform checks #if EIGEN_MAX_ALIGN_BYTES == 0 diff --git a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/Macros.h b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/Macros.h index 5c8b3a3b3e..4d10eecd05 100644 --- a/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/Macros.h +++ b/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Core/util/Macros.h @@ -60,16 +60,6 @@ // Compiler identification, EIGEN_COMP_* //------------------------------------------------------------------------------------------ -/// \internal Disable NEON features in Intellisense -#if __INTELLISENSE__ -#ifdef __ARM_NEON -#undef __ARM_NEON -#endif -#ifdef __ARM_NEON__ -#undef __ARM_NEON__ -#endif -#endif - /// \internal EIGEN_COMP_GNUC set to version (e.g., 951 for GCC 9.5.1) for all compilers compatible with GCC #ifdef __GNUC__ #define EIGEN_COMP_GNUC (__GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__)