Add support for differentiable solver.