mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
Silenced more compilation warnings
This commit is contained in:
parent
114e863f08
commit
057cfd2f02
@ -85,7 +85,7 @@ struct TensorEvaluator
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(const array<DenseIndex, NumCoords>& coords) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(const array<DenseIndex, NumCoords>& coords) const {
|
||||||
eigen_assert(m_data);
|
eigen_assert(m_data);
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
return m_data[m_dims.IndexOfColMajor(coords)];
|
return m_data[m_dims.IndexOfColMajor(coords)];
|
||||||
} else {
|
} else {
|
||||||
return m_data[m_dims.IndexOfRowMajor(coords)];
|
return m_data[m_dims.IndexOfRowMajor(coords)];
|
||||||
@ -158,7 +158,7 @@ struct TensorEvaluator<const Derived, Device>
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(const array<DenseIndex, NumCoords>& coords) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(const array<DenseIndex, NumCoords>& coords) const {
|
||||||
eigen_assert(m_data);
|
eigen_assert(m_data);
|
||||||
const Index index = (Layout == ColMajor) ? m_dims.IndexOfColMajor(coords)
|
const Index index = (static_cast<int>(Layout) == static_cast<int>(ColMajor)) ? m_dims.IndexOfColMajor(coords)
|
||||||
: m_dims.IndexOfRowMajor(coords);
|
: m_dims.IndexOfRowMajor(coords);
|
||||||
#ifdef __CUDA_ARCH__
|
#ifdef __CUDA_ARCH__
|
||||||
return __ldg(m_data+index);
|
return __ldg(m_data+index);
|
||||||
@ -366,8 +366,8 @@ struct TensorEvaluator<const TensorSelectOp<IfArgType, ThenArgType, ElseArgType>
|
|||||||
m_thenImpl(op.thenExpression(), device),
|
m_thenImpl(op.thenExpression(), device),
|
||||||
m_elseImpl(op.elseExpression(), device)
|
m_elseImpl(op.elseExpression(), device)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT((TensorEvaluator<IfArgType, Device>::Layout == TensorEvaluator<ThenArgType, Device>::Layout), YOU_MADE_A_PROGRAMMING_MISTAKE);
|
EIGEN_STATIC_ASSERT((static_cast<int>(TensorEvaluator<IfArgType, Device>::Layout) == static_cast<int>(TensorEvaluator<ThenArgType, Device>::Layout)), YOU_MADE_A_PROGRAMMING_MISTAKE);
|
||||||
EIGEN_STATIC_ASSERT((TensorEvaluator<IfArgType, Device>::Layout == TensorEvaluator<ElseArgType, Device>::Layout), YOU_MADE_A_PROGRAMMING_MISTAKE);
|
EIGEN_STATIC_ASSERT((static_cast<int>(TensorEvaluator<IfArgType, Device>::Layout) == static_cast<int>(TensorEvaluator<ElseArgType, Device>::Layout)), YOU_MADE_A_PROGRAMMING_MISTAKE);
|
||||||
eigen_assert(dimensions_match(m_condImpl.dimensions(), m_thenImpl.dimensions()));
|
eigen_assert(dimensions_match(m_condImpl.dimensions(), m_thenImpl.dimensions()));
|
||||||
eigen_assert(dimensions_match(m_thenImpl.dimensions(), m_elseImpl.dimensions()));
|
eigen_assert(dimensions_match(m_thenImpl.dimensions(), m_elseImpl.dimensions()));
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi
|
|||||||
|
|
||||||
const typename TensorEvaluator<ArgType, Device>::Dimensions& input_dims = m_impl.dimensions();
|
const typename TensorEvaluator<ArgType, Device>::Dimensions& input_dims = m_impl.dimensions();
|
||||||
const Sizes& output_dims = op.sizes();
|
const Sizes& output_dims = op.sizes();
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
m_inputStrides[0] = 1;
|
m_inputStrides[0] = 1;
|
||||||
for (int i = 1; i < NumDims; ++i) {
|
for (int i = 1; i < NumDims; ++i) {
|
||||||
m_inputStrides[i] = m_inputStrides[i-1] * input_dims[i-1];
|
m_inputStrides[i] = m_inputStrides[i-1] * input_dims[i-1];
|
||||||
@ -348,7 +348,7 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi
|
|||||||
m_impl.evalSubExprsIfNeeded(NULL);
|
m_impl.evalSubExprsIfNeeded(NULL);
|
||||||
if (internal::is_arithmetic<Scalar>::value && data && m_impl.data()) {
|
if (internal::is_arithmetic<Scalar>::value && data && m_impl.data()) {
|
||||||
Index contiguous_values = 1;
|
Index contiguous_values = 1;
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
for (int i = 0; i < NumDims; ++i) {
|
for (int i = 0; i < NumDims; ++i) {
|
||||||
contiguous_values *= dimensions()[i];
|
contiguous_values *= dimensions()[i];
|
||||||
if (dimensions()[i] != m_impl.dimensions()[i]) {
|
if (dimensions()[i] != m_impl.dimensions()[i]) {
|
||||||
@ -394,7 +394,7 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi
|
|||||||
|
|
||||||
Index inputIndices[] = {0, 0};
|
Index inputIndices[] = {0, 0};
|
||||||
Index indices[] = {index, index + packetSize - 1};
|
Index indices[] = {index, index + packetSize - 1};
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
for (int i = NumDims - 1; i > 0; --i) {
|
for (int i = NumDims - 1; i > 0; --i) {
|
||||||
const Index idx0 = indices[0] / m_fastOutputStrides[i];
|
const Index idx0 = indices[0] / m_fastOutputStrides[i];
|
||||||
const Index idx1 = indices[1] / m_fastOutputStrides[i];
|
const Index idx1 = indices[1] / m_fastOutputStrides[i];
|
||||||
@ -446,7 +446,7 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi
|
|||||||
Scalar* result = m_impl.data();
|
Scalar* result = m_impl.data();
|
||||||
if (result) {
|
if (result) {
|
||||||
Index offset = 0;
|
Index offset = 0;
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
for (int i = 0; i < NumDims; ++i) {
|
for (int i = 0; i < NumDims; ++i) {
|
||||||
if (m_dimensions[i] != m_impl.dimensions()[i]) {
|
if (m_dimensions[i] != m_impl.dimensions()[i]) {
|
||||||
offset += m_offsets[i] * m_inputStrides[i];
|
offset += m_offsets[i] * m_inputStrides[i];
|
||||||
@ -482,7 +482,7 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi
|
|||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const
|
||||||
{
|
{
|
||||||
Index inputIndex = 0;
|
Index inputIndex = 0;
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
for (int i = NumDims - 1; i > 0; --i) {
|
for (int i = NumDims - 1; i > 0; --i) {
|
||||||
const Index idx = index / m_fastOutputStrides[i];
|
const Index idx = index / m_fastOutputStrides[i];
|
||||||
inputIndex += (idx + m_offsets[i]) * m_inputStrides[i];
|
inputIndex += (idx + m_offsets[i]) * m_inputStrides[i];
|
||||||
@ -547,7 +547,7 @@ struct TensorEvaluator<TensorSlicingOp<StartIndices, Sizes, ArgType>, Device>
|
|||||||
const int packetSize = internal::unpacket_traits<PacketReturnType>::size;
|
const int packetSize = internal::unpacket_traits<PacketReturnType>::size;
|
||||||
Index inputIndices[] = {0, 0};
|
Index inputIndices[] = {0, 0};
|
||||||
Index indices[] = {index, index + packetSize - 1};
|
Index indices[] = {index, index + packetSize - 1};
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
for (int i = NumDims - 1; i > 0; --i) {
|
for (int i = NumDims - 1; i > 0; --i) {
|
||||||
const Index idx0 = indices[0] / this->m_fastOutputStrides[i];
|
const Index idx0 = indices[0] / this->m_fastOutputStrides[i];
|
||||||
const Index idx1 = indices[1] / this->m_fastOutputStrides[i];
|
const Index idx1 = indices[1] / this->m_fastOutputStrides[i];
|
||||||
|
@ -106,7 +106,7 @@ struct TensorEvaluator<const TensorReverseOp<ReverseDimensions, ArgType>, Device
|
|||||||
{
|
{
|
||||||
// Compute strides
|
// Compute strides
|
||||||
m_dimensions = m_impl.dimensions();
|
m_dimensions = m_impl.dimensions();
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
m_strides[0] = 1;
|
m_strides[0] = 1;
|
||||||
for (int i = 1; i < NumDims; ++i) {
|
for (int i = 1; i < NumDims; ++i) {
|
||||||
m_strides[i] = m_strides[i-1] * m_dimensions[i-1];
|
m_strides[i] = m_strides[i-1] * m_dimensions[i-1];
|
||||||
@ -138,7 +138,7 @@ struct TensorEvaluator<const TensorReverseOp<ReverseDimensions, ArgType>, Device
|
|||||||
{
|
{
|
||||||
eigen_assert(index < dimensions().TotalSize());
|
eigen_assert(index < dimensions().TotalSize());
|
||||||
Index inputIndex = 0;
|
Index inputIndex = 0;
|
||||||
if (Layout == ColMajor) {
|
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
|
||||||
for (int i = NumDims - 1; i > 0; --i) {
|
for (int i = NumDims - 1; i > 0; --i) {
|
||||||
Index idx = index / m_strides[i];
|
Index idx = index / m_strides[i];
|
||||||
index -= idx * m_strides[i];
|
index -= idx * m_strides[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user