make gemm, gemv work with shape of 0.

Also work around what seam a bug in CUBLAS gemv with shape of 0.