added gradient grid that handles multiple GPU usage 2
Former-commit-id: 538f4071ca78b9a45abd8cb5bb455cbcacbc780f