Fix inlining and linkage
Fix linkage for cuda backend