fix autodiff enum comparison warnings

This commit is contained in:
Charles Schlosser 2024-04-22 18:14:20 +00:00 committed by Rasmus Munk Larsen
parent 2265242aa1
commit 4de870b6eb

View File

@ -22,13 +22,8 @@ struct auto_diff_special_op;
template <typename DerivativeType, typename OtherDerivativeType, typename EnableIf = void>
struct maybe_coherent_pad_helper {
static constexpr int SizeAtCompileTime = DerivativeType::SizeAtCompileTime == Dynamic ||
OtherDerivativeType::SizeAtCompileTime == Dynamic
? Dynamic
: int(DerivativeType::SizeAtCompileTime) >
int(OtherDerivativeType::SizeAtCompileTime)
? DerivativeType::SizeAtCompileTime
: OtherDerivativeType::SizeAtCompileTime;
static constexpr int SizeAtCompileTime =
max_size_prefer_dynamic(DerivativeType::SizeAtCompileTime, OtherDerivativeType::SizeAtCompileTime);
using type = CoherentPadOp<DerivativeType, SizeAtCompileTime>;
static type pad(const DerivativeType& x, const OtherDerivativeType& y) {
// CoherentPadOp uses variable_if_dynamic<SizeAtCompileTime>. In this case, `SizeAtCompileTime` might