I don't understand what your code is attempting to do. It looks like synmod_map_seq is just negating the first column of A, but it is not explained why. The template syntax also seems wrong, lacking <typename T>.

On the other hand, why are you inverting a matrix? It is rarely the best method. If you are solving Ax=b, that is, x = A^{-1} b, just use magma_dgesv, or equivalently, magma_dgetrf and magma_dgetrs. Those factor the matrix into LU, then solve LUx=b, which is both faster and more accurate than explicitly inverting the matrix A.