Skip to content

Add missing availability information to enums defined in vDSP overlays #24232

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 2 commits into from
Apr 24, 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
4 changes: 3 additions & 1 deletion stdlib/public/Darwin/Accelerate/Accelerate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ public enum vDSP {}
public enum vForce {}

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


@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
public struct VectorizableDouble {
public typealias Scalar = Double
}
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/Darwin/Accelerate/vDSP_Biquad.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
//
//===----------------------------------------------------------------------===//


import Accelerate

//===----------------------------------------------------------------------===//
//
// Biquad Structure
Expand Down Expand Up @@ -240,9 +237,12 @@ public protocol vDSP_FloatingPointBiquadFilterable: BinaryFloatingPoint {
associatedtype BiquadFunctions: vDSP_BiquadFunctions where BiquadFunctions.Scalar == Self
}

@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
extension Float: vDSP_FloatingPointBiquadFilterable {
public typealias BiquadFunctions = vDSP.VectorizableFloat
}

@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
extension Double: vDSP_FloatingPointBiquadFilterable {
public typealias BiquadFunctions = vDSP.VectorizableDouble
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ extension vDSP {
}

// MARK: Vector threshold.


@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
public enum ThresholdRule<T: BinaryFloatingPoint> {
/// Returns threshold if input is less than threshold; otherwise input value.
case clampToThreshold
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/Accelerate/vDSP_Conversion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ extension vDSP {
}

// MARK: Floating-point to integer conversion

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
public enum RoundingMode {
case towardZero
case towardNearestInteger
Expand Down
3 changes: 1 addition & 2 deletions stdlib/public/Darwin/Accelerate/vDSP_DCT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
//
//===----------------------------------------------------------------------===//

import Accelerate

extension vDSP {

/// An enum that specifies which DCT variant to perform.
Expand Down Expand Up @@ -132,6 +130,7 @@ fileprivate protocol vDSP_DCTFunctions {
U.Element == Scalar, V.Element == Scalar
}

@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
extension vDSP.VectorizableFloat: vDSP_DCTFunctions {

@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
Expand Down
2 changes: 2 additions & 0 deletions stdlib/public/Darwin/Accelerate/vDSP_DFT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ extension vDSP {

/// An enumeration that specifies whether to perform complex-to-complex or
/// complex-to-real discrete Fourier transform.
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
// TODO: Should probably be @_frozen; check with Accelerate.
public enum DFTTransformType {
/// Specifies complex-to-complex discrete Fourier transform, forward
/// or inverse
Expand Down
3 changes: 1 addition & 2 deletions stdlib/public/Darwin/Accelerate/vDSP_FFT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
//
//===----------------------------------------------------------------------===//

import Accelerate

//===----------------------------------------------------------------------===//
//
// 1D and 2D Fast Fourier Transform
Expand All @@ -22,6 +20,7 @@ import Accelerate
extension vDSP {

/// An enumeration that defines the size of the FFT decomposition.
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
public enum Radix {
case radix2
case radix3
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/Accelerate/vDSP_FFT_DFT_Common.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

extension vDSP {

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
public enum FourierTransformDirection {
case forward
case inverse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ extension vDSP {
}

/// Enum specifying window sequence.
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
public enum WindowSequence {
/// Creates a normalized Hanning window.
case hanningNormalized
Expand Down
2 changes: 2 additions & 0 deletions stdlib/public/Darwin/Accelerate/vDSP_Integration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
//===----------------------------------------------------------------------===//

extension vDSP {

@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *)
public enum IntegrationRule {
case runningSum
case simpson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ extension vDSP {
}

// MARK: Sorting

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
public enum SortOrder: Int32 {
case ascending = 1
case descending = -1
Expand Down