Fix gradient_solver function prototype