[WIP] Add initial support for MAGMA / CUBLAS.

Still has problem in linking.