Enzyme failed to complie for the custom gradient for C++ as show in this example for the atomicMax
https://fwd.gymni.ch/hc3ivR
which crashed at
if (hasMetadata(key.todiff, "enzyme_gradient")) {
std::set<llvm::Type *> seen;
DIFFE_TYPE subretType = whatType(key.todiff->getReturnType(),
DerivativeMode::ReverseModeGradient,
/intAreConstant/ false, seen);
if (key.todiff->getReturnType()->isVoidTy() ||
key.todiff->getReturnType()->isEmptyTy())
subretType = DIFFE_TYPE::CONSTANT;
@wsmoses will have the fix for this and provide a better msg.