  By using grid homology theory, we give an explicit algorithm for computing
Ozsv\'ath-Stipsicz-Szab\'o's $\Upsilon$-invariant and the $d$-invariant of Dehn
surgeries along knots in $S^3$. As its application, we compute the two
invariants for all prime knots with up to 11 crossings.
