Threshold current for switching of a perpendicular magnetic layer induced by spin Hall effect