added gradient grid that handles multiple GPU usage
Former-commit-id: b83c2d705661f9a2e9fb3e0dc2413434c09162c1