Skip to content

[Accelerate] Declare availability where missing, remove where redundant #25776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 27, 2019
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
8 changes: 6 additions & 2 deletions stdlib/public/Darwin/Accelerate/Accelerate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@
//===----------------------------------------------------------------------===//

/// An enum that acts as a namespace for Swift overlays to vImage option sets and enums..
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public enum vImage {}

/// An enum that acts as a namespace for Swift overlays to vDSP based functions.
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public enum vDSP {}

/// An enum that acts as a namespace for Swift overlays to vForce based functions.
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public enum vForce {}

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension vDSP {
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public struct VectorizableFloat {
public typealias Scalar = Float
}

@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public struct VectorizableDouble {
public typealias Scalar = Double
}
Expand Down
22 changes: 11 additions & 11 deletions stdlib/public/Darwin/Accelerate/AccelerateBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// In practice, most types conforming to this protocol will be Collections,
/// but they need not be--they need only have an Element type and count, and
/// provide the withUnsafeBufferPointer function.
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public protocol AccelerateBuffer {
/// The buffer's element type.
associatedtype Element
Expand All @@ -34,7 +34,7 @@ public protocol AccelerateBuffer {
///
/// In practice, most types conforming to this protocol will be
/// MutableCollections, but they need not be.
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public protocol AccelerateMutableBuffer: AccelerateBuffer {
/// Calls the given closure with a pointer to the object's mutable
/// contiguous storage.
Expand All @@ -43,7 +43,7 @@ public protocol AccelerateMutableBuffer: AccelerateBuffer {
) rethrows -> R
}

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public extension AccelerateBuffer where Self: Collection {
@inlinable
func withUnsafeBufferPointer<R>(
Expand All @@ -53,7 +53,7 @@ public extension AccelerateBuffer where Self: Collection {
}
}

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AccelerateMutableBuffer where Self: MutableCollection {
@inlinable
public mutating func withUnsafeMutableBufferPointer<R>(
Expand All @@ -63,24 +63,24 @@ extension AccelerateMutableBuffer where Self: MutableCollection {
}
}

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension Array: AccelerateMutableBuffer { }

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ContiguousArray: AccelerateMutableBuffer { }

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ArraySlice: AccelerateMutableBuffer { }

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension UnsafeBufferPointer: AccelerateBuffer { }

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension UnsafeMutableBufferPointer: AccelerateMutableBuffer { }

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension Slice: AccelerateBuffer where Base: AccelerateBuffer { }

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension Slice: AccelerateMutableBuffer
where Base: AccelerateMutableBuffer & MutableCollection { }
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/Accelerate/Quadrature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

// MARK: Quadrature

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
/// A structure that approximates the definite integral of a function over a finite interval.
///
/// The following code is an example of using a `Quadrature` structure to calculate the
Expand Down Expand Up @@ -49,6 +48,7 @@
///
/// let vRresult = quadrature.integrate(over: 0.0 ... diameter,
/// integrand: vectorExp)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public struct Quadrature {

private var integrateOptions = quadrature_integrate_options()
Expand Down
Loading