Merged in ezhulenev/eigen-01 (pull request PR-553)

Do not disable alignment with EIGEN_GPUCC

Approved-by: Rasmus Munk Larsen <rmlarsen@google.com>
This commit is contained in:
Rasmus Munk Larsen 2018-12-04 23:47:19 +00:00
commit b57b31cce9
2 changed files with 8 additions and 15 deletions

View File

@ -10,13 +10,6 @@
#ifndef EIGEN_CONFIGURE_VECTORIZATION_H #ifndef EIGEN_CONFIGURE_VECTORIZATION_H
#define 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 // Static and dynamic alignment control
// //
@ -56,7 +49,13 @@
// If the user explicitly disable vectorization, then we also disable alignment // If the user explicitly disable vectorization, then we also disable alignment
#if defined(EIGEN_DONT_VECTORIZE) #if defined(EIGEN_DONT_VECTORIZE)
#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 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 0
#endif
#elif defined(__AVX512F__) #elif defined(__AVX512F__)
// 64 bytes static alignment is preferred only if really required // 64 bytes static alignment is preferred only if really required
#define EIGEN_IDEAL_MAX_ALIGN_BYTES 64 #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 // 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 // account both the user's will (EIGEN_MAX_ALIGN_BYTES,EIGEN_DONT_ALIGN) and our own platform checks
#if EIGEN_MAX_ALIGN_BYTES==0 #if EIGEN_MAX_ALIGN_BYTES==0
@ -211,7 +208,7 @@
#endif #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) #if defined (EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)

View File

@ -742,10 +742,6 @@
// All functions callable from CUDA/HIP code must be qualified with __device__ // All functions callable from CUDA/HIP code must be qualified with __device__
#ifdef EIGEN_GPUCC #ifdef EIGEN_GPUCC
#ifndef EIGEN_DONT_VECTORIZE
#define EIGEN_DONT_VECTORIZE
#endif
#define EIGEN_DEVICE_FUNC __host__ __device__ #define EIGEN_DEVICE_FUNC __host__ __device__
#else #else
#define EIGEN_DEVICE_FUNC #define EIGEN_DEVICE_FUNC