mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
fixed some potential alignment issues.
This commit is contained in:
parent
1946cc4478
commit
bc99c5f7db
@ -297,7 +297,9 @@ namespace Eigen {
|
|||||||
* If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link
|
* If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link
|
||||||
* vectorized and non-vectorized code.
|
* vectorized and non-vectorized code.
|
||||||
*/
|
*/
|
||||||
#if (defined __GNUC__) || (defined __PGI) || (defined __IBMCPP__) || (defined __ARMCC_VERSION)
|
#if (defined __CUDACC__)
|
||||||
|
#define EIGEN_ALIGN_TO_BOUNDARY(n) __align__(n)
|
||||||
|
#elif (defined __GNUC__) || (defined __PGI) || (defined __IBMCPP__) || (defined __ARMCC_VERSION)
|
||||||
#define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
|
#define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
|
||||||
#elif (defined _MSC_VER)
|
#elif (defined _MSC_VER)
|
||||||
#define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n))
|
#define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n))
|
||||||
|
@ -459,7 +459,7 @@ struct TensorEvaluator<TensorSlicingOp<StartIndices, Sizes, ArgType>, Device>
|
|||||||
this->m_impl.template writePacket<StoreMode>(inputIndices[0], x);
|
this->m_impl.template writePacket<StoreMode>(inputIndices[0], x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CoeffReturnType values[packetSize];
|
EIGEN_ALIGN_DEFAULT CoeffReturnType values[packetSize];
|
||||||
internal::pstore<CoeffReturnType, PacketReturnType>(values, x);
|
internal::pstore<CoeffReturnType, PacketReturnType>(values, x);
|
||||||
this->m_impl.coeffRef(inputIndices[0]) = values[0];
|
this->m_impl.coeffRef(inputIndices[0]) = values[0];
|
||||||
this->m_impl.coeffRef(inputIndices[1]) = values[packetSize-1];
|
this->m_impl.coeffRef(inputIndices[1]) = values[packetSize-1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user