How to do matrix operations in the kernel


In my kernel function, I have to do some matrix operations, such as inversion, multiplication, and svd.

Is it OK to directly use standard C codes, something from numerical recipies on C ?

I wonder that there are any library or codes I can refer ?

you can use MAGMA or CULA tools.