diff options
author | Rasmus Munk Larsen <rmlarsen@google.com> | 2018-12-04 23:47:19 +0000 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2018-12-04 23:47:19 +0000 |
commit | b57b31cce9e86eac78d2219c976797225ac1db38 (patch) | |
tree | bec4fe280fe2864689463c5320a33ed77abafacf /Eigen | |
parent | 919414b9fe2ad7fdcb0f2b2cbdf6b5322d0f2034 (diff) | |
parent | 0bb15bb6d6a445edb9341c4970d854882347b6d7 (diff) |
Merged in ezhulenev/eigen-01 (pull request PR-553)
Do not disable alignment with EIGEN_GPUCC
Approved-by: Rasmus Munk Larsen <rmlarsen@google.com>
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/util/ConfigureVectorization.h | 19 | ||||
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 4 |
2 files changed, 8 insertions, 15 deletions
diff --git a/Eigen/src/Core/util/ConfigureVectorization.h b/Eigen/src/Core/util/ConfigureVectorization.h index 263604597..c70ad894e 100644 --- a/Eigen/src/Core/util/ConfigureVectorization.h +++ b/Eigen/src/Core/util/ConfigureVectorization.h @@ -10,13 +10,6 @@ #ifndef EIGEN_CONFIGURE_VECTORIZATION_H #define EIGEN_CONFIGURE_VECTORIZATION_H -// FIXME: not sure why this is needed, perhaps it is not needed anymore. -#ifdef __NVCC__ - #ifndef EIGEN_DONT_VECTORIZE - #define EIGEN_DONT_VECTORIZE - #endif -#endif - //------------------------------------------------------------------------------------------ // Static and dynamic alignment control // @@ -56,7 +49,13 @@ // If the user explicitly disable vectorization, then we also disable alignment #if defined(EIGEN_DONT_VECTORIZE) - #define EIGEN_IDEAL_MAX_ALIGN_BYTES 0 + #if defined(EIGEN_GPUCC) + // GPU code is always vectorized and requires memory alignment for + // statically allocated buffers. + #define EIGEN_IDEAL_MAX_ALIGN_BYTES 16 + #elif + #define EIGEN_IDEAL_MAX_ALIGN_BYTES 0 + #endif #elif defined(__AVX512F__) // 64 bytes static alignment is preferred only if really required #define EIGEN_IDEAL_MAX_ALIGN_BYTES 64 @@ -183,8 +182,6 @@ //---------------------------------------------------------------------- - - // 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 @@ -211,7 +208,7 @@ #endif -#ifndef EIGEN_DONT_VECTORIZE +#if !(defined(EIGEN_DONT_VECTORIZE) || defined(EIGEN_GPUCC)) #if defined (EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER) diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 9d277e26f..c7dba1fc4 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -742,10 +742,6 @@ // All functions callable from CUDA/HIP code must be qualified with __device__ #ifdef EIGEN_GPUCC - #ifndef EIGEN_DONT_VECTORIZE - #define EIGEN_DONT_VECTORIZE - #endif - #define EIGEN_DEVICE_FUNC __host__ __device__ #else #define EIGEN_DEVICE_FUNC |