Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ let package = Package(
targets: [
.target(
name: "AccelerateLinux",
dependencies: ["CBLAS", "CLAPACK"]
dependencies: ["CBLAS", "CLAPACK"],
swiftSettings: [
.enableExperimentalFeature("Extern")
]
),
.systemLibrary(
name: "CBLAS",
Expand All @@ -34,9 +37,3 @@ let package = Package(
),
]
)

var swiftSettings: [SwiftSetting] {
[
.enableUpcomingFeature("ExistentialAny")
]
}
3 changes: 2 additions & 1 deletion Sources/AccelerateLinux/MatrixOps/BLAS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
29 changes: 18 additions & 11 deletions Sources/AccelerateLinux/MatrixOps/LAPACK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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>!,
Expand All @@ -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
Expand All @@ -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<CChar>!,
_ __jobvt: UnsafeMutablePointer<CChar>!,
Expand All @@ -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.
Expand All @@ -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>!,
Expand All @@ -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>!,
Expand All @@ -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<CChar>!,
_ __jobvr: UnsafeMutablePointer<CChar>!,
Expand All @@ -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.
///
Expand All @@ -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<CChar>!,
_ __n: UnsafeMutablePointer<__CLPK_integer>!,
Expand All @@ -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<CChar>!,
_ __trans: UnsafeMutablePointer<CChar>!,
Expand All @@ -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)