diff --git a/Package.swift b/Package.swift index c35448f..119ecb5 100644 --- a/Package.swift +++ b/Package.swift @@ -12,7 +12,10 @@ let package = Package( targets: [ .target( name: "AccelerateLinux", - dependencies: ["CBLAS", "CLAPACK"] + dependencies: ["CBLAS", "CLAPACK"], + swiftSettings: [ + .enableExperimentalFeature("Extern") + ] ), .systemLibrary( name: "CBLAS", @@ -34,9 +37,3 @@ let package = Package( ), ] ) - -var swiftSettings: [SwiftSetting] { - [ - .enableUpcomingFeature("ExistentialAny") - ] -} diff --git a/Sources/AccelerateLinux/MatrixOps/BLAS.swift b/Sources/AccelerateLinux/MatrixOps/BLAS.swift index 2140c08..ea04e24 100644 --- a/Sources/AccelerateLinux/MatrixOps/BLAS.swift +++ b/Sources/AccelerateLinux/MatrixOps/BLAS.swift @@ -26,7 +26,8 @@ import CBLAS /// or /// C←αBA + βC /// with optional use of transposed forms of A, B, or both. -@_silgen_name("cblas_dgemm") +@inlinable +@_extern(c, "cblas_dgemm") public func cblas_dgemm( _ __Order: CBLAS_ORDER, _ __TransA: CBLAS_TRANSPOSE, diff --git a/Sources/AccelerateLinux/MatrixOps/LAPACK.swift b/Sources/AccelerateLinux/MatrixOps/LAPACK.swift index 0aeb61d..cc3b2b0 100644 --- a/Sources/AccelerateLinux/MatrixOps/LAPACK.swift +++ b/Sources/AccelerateLinux/MatrixOps/LAPACK.swift @@ -12,7 +12,8 @@ import CLAPACK /// where P is a permutation matrix, L is unit lower triangular, and U is /// upper triangular. The factored form of A is then used to solve the /// system of equations A * X = B. -@_silgen_name("dgesv_") +@inlinable +@_extern(c, "dgesv_") public func dgesv_( _ __n: UnsafeMutablePointer<__CLPK_integer>!, _ __nrhs: UnsafeMutablePointer<__CLPK_integer>!, @@ -22,7 +23,7 @@ public func dgesv_( _ __b: UnsafeMutablePointer<__CLPK_doublereal>!, _ __ldb: UnsafeMutablePointer<__CLPK_integer>!, _ __info: UnsafeMutablePointer<__CLPK_integer>! -) +) -> Int32 /// Computes the singular value decomposition (SVD) of a real /// M-by-N matrix A, optionally computing the left and/or right singular @@ -38,7 +39,8 @@ public func dgesv_( /// U and V are the left and right singular vectors of A. /// /// Note: that the routine returns V**T, not V. -@_silgen_name("dgesvd_") +@inlinable +@_extern(c, "dgesvd_") public func dgesvd_( _ __jobu: UnsafeMutablePointer!, _ __jobvt: UnsafeMutablePointer!, @@ -54,7 +56,7 @@ public func dgesvd_( _ __work: UnsafeMutablePointer<__CLPK_doublereal>!, _ __lwork: UnsafeMutablePointer<__CLPK_integer>!, _ __info: UnsafeMutablePointer<__CLPK_integer>! -) +) -> Int32 /// Computes an LU factorization of a general M-by-N matrix A /// using partial pivoting with row interchanges. @@ -66,7 +68,8 @@ public func dgesvd_( /// triangular (upper trapezoidal if m < n). /// /// This is the right-looking Level 3 BLAS version of the algorithm. -@_silgen_name("dgetrf_") +@inlinable +@_extern(c, "dgetrf_") public func dgetrf_( _ __m: UnsafeMutablePointer<__CLPK_integer>!, _ __n: UnsafeMutablePointer<__CLPK_integer>!, @@ -81,7 +84,8 @@ public func dgetrf_( /// /// This method inverts U and then computes `inv(A)` by solving the system /// `inv(A)*L = inv(U) for inv(A)`. -@_silgen_name("dgetri_") +@inlinable +@_extern(c, "dgetri_") public func dgetri_( _ __n: UnsafeMutablePointer<__CLPK_integer>!, _ __a: UnsafeMutablePointer<__CLPK_doublereal>!, @@ -104,7 +108,8 @@ public func dgetri_( /// /// The computed eigenvectors are normalized to have Euclidean norm /// equal to 1 and largest component real. -@_silgen_name("dgeev_") +@inlinable +@_extern(c, "dgeev_") public func dgeev_( _ __jobvl: UnsafeMutablePointer!, _ __jobvr: UnsafeMutablePointer!, @@ -120,7 +125,7 @@ public func dgeev_( _ __work: UnsafeMutablePointer<__CLPK_doublereal>!, _ __lwork: UnsafeMutablePointer<__CLPK_integer>!, _ __info: UnsafeMutablePointer<__CLPK_integer>! -) -> Int32 +) /// Computes the Cholesky factorization of a real symmetric positive definite matrix A. /// @@ -130,7 +135,8 @@ public func dgeev_( /// where U is an upper triangular matrix and L is lower triangular. /// /// This is the block version of the algorithm, calling Level 3 BLAS. -@_silgen_name("dpotrf_") +@inlinable +@_extern(c, "dpotrf_") public func dpotrf_( _ __uplo: UnsafeMutablePointer!, _ __n: UnsafeMutablePointer<__CLPK_integer>!, @@ -143,7 +149,8 @@ public func dpotrf_( /// `A * X = B` or `A**T * X = B`, /// where A is a triangular matrix of order N, and B is an N-by-NRHS matrix. /// A check is made to verify that A is nonsingular. -@_silgen_name("dtrtrs_") +@inlinable +@_extern(c, "dtrtrs_") public func dtrtrs_( _ __uplo: UnsafeMutablePointer!, _ __trans: UnsafeMutablePointer!, @@ -153,7 +160,7 @@ public func dtrtrs_( _ __a: UnsafeMutablePointer<__CLPK_doublereal>!, _ __lda: UnsafeMutablePointer<__CLPK_integer>!, _ __b: UnsafeMutablePointer<__CLPK_doublereal>!, - _ __ldb: UnsafeMutablePointer<__CLPK_integer>!, + _ __db: UnsafeMutablePointer<__CLPK_integer>!, _ __info: UnsafeMutablePointer<__CLPK_integer>! ) -> Int32 #endif // canImport(Accelerate)