  We solve, for finite $N$, the matrix model of supersymmetric $U(N)$
Chern-Simons theory coupled to $N_{f}$ massive hypermultiplets of $R$-charge
$\frac{1}{2}$, together with a Fayet-Iliopoulos term. We compute the partition
function by identifying it with a determinant of a Hankel matrix, whose entries
are parametric derivatives (of order $N_{f}-1$) of Mordell integrals. We obtain
finite Gauss sums expressions for the partition functions. We also apply these
results to obtain an exhaustive test of Giveon-Kutasov (GK) duality in the
$\mathcal{N}=3$ setting, by systematic computation of the matrix models
involved. The phase factor that arises in the duality is then obtained
explicitly. We give an expression characterized by modular arithmetic (mod 4)
behavior that holds for all tested values of the parameters (checked up to
$N_{f}=12$ flavours).
