mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-12 09:23:12 +08:00
Allow custom TENSOR_CONTRACTION_DISPATCH macro.
Currently TF lite needs to hack around with the Tensor headers in order to customize the contraction dispatch method. Here we add simple `#ifndef` guards to allow them to provide their own dispatch prior to inclusion.
This commit is contained in:
parent
fc87e2cbaa
commit
6aec83263d
@ -633,6 +633,7 @@ struct TensorContractionEvaluatorBase : internal::no_assignment_operator
|
|||||||
}
|
}
|
||||||
#endif // EIGEN_USE_THREADS
|
#endif // EIGEN_USE_THREADS
|
||||||
|
|
||||||
|
#ifndef TENSOR_CONTRACTION_DISPATCH
|
||||||
#define TENSOR_CONTRACTION_DISPATCH(METHOD, ALIGNMENT, ARGS) \
|
#define TENSOR_CONTRACTION_DISPATCH(METHOD, ALIGNMENT, ARGS) \
|
||||||
if (this->m_lhs_inner_dim_contiguous) { \
|
if (this->m_lhs_inner_dim_contiguous) { \
|
||||||
if (this->m_rhs_inner_dim_contiguous) { \
|
if (this->m_rhs_inner_dim_contiguous) { \
|
||||||
@ -663,7 +664,9 @@ struct TensorContractionEvaluatorBase : internal::no_assignment_operator
|
|||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef TENSOR_CONTRACTION_ASYNC_DISPATCH
|
||||||
#define TENSOR_CONTRACTION_ASYNC_DISPATCH(METHOD, DONE, ALIGNMENT, ARGS, FN) \
|
#define TENSOR_CONTRACTION_ASYNC_DISPATCH(METHOD, DONE, ALIGNMENT, ARGS, FN) \
|
||||||
if (this->m_lhs_inner_dim_contiguous) { \
|
if (this->m_lhs_inner_dim_contiguous) { \
|
||||||
if (this->m_rhs_inner_dim_contiguous) { \
|
if (this->m_rhs_inner_dim_contiguous) { \
|
||||||
@ -694,6 +697,7 @@ struct TensorContractionEvaluatorBase : internal::no_assignment_operator
|
|||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC void evalTo(Scalar* buffer) const {
|
EIGEN_DEVICE_FUNC void evalTo(Scalar* buffer) const {
|
||||||
static_cast<const Derived*>(this)->template evalProduct<Unaligned>(buffer);
|
static_cast<const Derived*>(this)->template evalProduct<Unaligned>(buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user