Commit Graph

26 Commits

Author SHA1 Message Date
Karoy Lorentey
1a275a45c4 [test] Accelerate: Don’t hide utility functions in an if #available block 2020-01-10 16:56:33 -08:00
Karoy Lorentey
71f5ceeaf8 Fix closing braces lost during conflict resolution 2019-11-13 16:18:38 -08:00
Karoy Lorentey
21922a4333 Merge branch 'master' into accelerate-vDSP-interpolation-tests 2019-11-13 15:50:02 -08:00
Karoy Lorentey
f336bf0077 [test] Update for availability adjustments in Accelerate 2019-06-25 20:19:07 -07:00
Steve (Numerics) Canon
d4b90f4837 Temporarily disable all the Accelerate tests.
These are testing for bitwise identical results, but don't guarantee that
the buffers being used always have identical alignment. This will result
in small rounding differences when vector codepaths are used for different
elements of some results.

This is partially an underlying bug in Accelerate (which is outside the
scope of this project to fix), and partly a test bug (which we can address
by adopting approximate comparisons here). In the short term, though, I'm
going to disable these.
2019-05-03 09:12:30 -04:00
simon gladman
e96f61c8bc Use elementsAlmostEqual to resolve suspected alignment-induced failures
`DoublePrecisionInterpolateBetweenNeighbours ` was occasionally faliing on tvOS simulator. Not using exact equality appears to have fixed this issue. The code I've used for `isAlmostEqual` is based on SE-0259
2019-05-02 11:27:43 +01:00
Stephen Canon
a0676e02ab [Accelerate] [vDSP] DFT, FFT, DCT, and Biquad (#24207)
* Swift overlay to vDSP cascaded biquad IIR filter.

* update comment in test

* Swift overlay to vDSP Discrete Cosine Transform

* Swift Overlays to vDSP Fast Fourier Transform and Discrete Fourier Transform

* Tests for DFT and FFT

* Some refactoring and begin documentation.

* Swift overlays to FFT and DFT operations.

* Expand docs.
* Implement `vDSP_destroy_fftsetup` and `vDSP_destroy_fftsetupD`

* Refactor Tests

* Refactor Tests

* Provide transform function that returns the result. Refactoring: parameter names more consistent with other vDSP operations, push `fileprivate` symbols to bottom of file.

* Add apply() function that returns the result.

* Added a version of DFT transform that returns the result.

* update some DFT comments

* Remove FFT overlays from this branch to separate DFT and FFT pull requests.

* [Accelerate] [vDSP] Swift Overlays to FFT Operations

This PR contains Swift overlays to simplify performing 1D and 2D fast Fourier transforms on single- and double-precision data.

This PR includes a subset of the operations (e.g. vDSP_fft_zrop for FFT). My plan is to add the additional operations (e.g. multiple signals, in-place operations, etc.) in a subsequent PR once this is approved.

cc: @moiseev @airspeedswift @stephentyrone

* Composite Branch

Contains FFT, DFT, DCT, and Biquad branches.
2019-04-23 12:31:18 -04:00
Simon Gladman
2ee19145df Merge remote-tracking branch 'origin/accelerate-vDSP-polynomialEvaluation' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:47:31 +01:00
Simon Gladman
95eaa0d3ad Merge remote-tracking branch 'origin/accelerate-vDSP-differenceEquationAndDownsampling' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:41:42 +01:00
Simon Gladman
d5fca4f073 Merge remote-tracking branch 'origin/accelerate-vDSP-linearInterpolation' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:35:07 +01:00
Simon Gladman
ff15bdd108 Merge remote-tracking branch 'origin/accelerate-vDSP-slidingWindow' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:31:42 +01:00
Stephen Canon
d05cd67816 Accelerate vForce (#24152)
* [Accelerate] [vForce] New vForce Overlay

This PR contains a suite of overlays to the vForce transcendental and trigonometric functions on vectors of any length. The overlays simplify the API to the existing functions and accept collections that implement a new protocol called AccelerateBuffer. Conformances are provided for the most useful stdlib Collections.
2019-04-19 21:59:32 +02:00
simon gladman
802d516ad5 [Accelerate] [Quadrature] New Quadrature Overlay (#23127)
* [Accelerate] [Quadrature] New Quadrature Overlay

A class that simplifies approximating the definite integral of a function.

* Fixes in response to PR Review.

Change `@_exported import Accelerate` to `import Accelerate`.
Correct date in copyright comment.

* Code Review Fixes.

* Remove mutable integrator, simply set options in init().
* Remove mutable `maxIntervals` and `qagPointsPerInterval`.
* Update tests.

* Code Review Fixes.

* Use standard library `Result`.
* Implement `QAGPointsPerInterval` as a struct.

* Tidy up Passing Integrand to `quadrature_integrate_function`.

Pass the integrand closure directly to the `quadrature_integrate_function` initialiser rather than attaching as a property of the `Quadrature` class.

* Make `Quadrature` a struct, and remove requirement for `integrand` to be escaping.

* Code Review Changes

* Add long-form integrator algorithm aliases (update tests to use these aliases).
* Make quadrature error description public.
* New tests for error description and `QAGPointsPerInterval`.

* Vectorized Integrand for Quadrature

Create an alternative implementation of `integrate` that accepts an integrand of type `(_ input: UnsafeBufferPointer<Double>, _ result: UnsafeMutableBufferPointer<Double>)`.

* Vectorized Integrand for Quadrature

Create an alternative implementation of `integrate` that accepts an integrand of type `(_ input: UnsafeBufferPointer<Double>, _ result: UnsafeMutableBufferPointer<Double>)`.

* Vectorized Integrand for Quadrature

Remove _ContiguousCollection - it's no longer used.

* Delete ContiguousCollection.swift

Not required.

* Refactor tests.
2019-04-19 02:09:41 +02:00
simon gladman
80c529dd89 Add operations that return their result. 2019-03-29 16:48:08 +00:00
simon gladman
6f803763a6 Add operations that return result. 2019-03-29 16:16:57 +00:00
simon gladman
a3478e0b46 Create versions of operations that return the result. 2019-03-29 14:47:12 +00:00
simon gladman
2547585013 Add versions of operations that return a result. 2019-03-29 10:48:13 +00:00
simon gladman
990a408794 Swift overlays to vDSP_vswsum and vDSP_vswsumD for sliding
window summation over single- and double-precision vectors.
2019-03-18 17:34:08 +00:00
Simon Gladman
8f9c475939 Swift Overlays to vDSP Linear Interpolation Operations 2019-03-17 07:24:20 +00:00
simon gladman
6fad0cf948 Code review changes - better parameter naming for downsample, and rename differenceEquation to twoPoleTwoZeroFilter. 2019-03-14 14:13:24 +00:00
simon gladman
aabcfce65f fix broken tests. 2019-03-13 16:11:36 +00:00
simon gladman
99d8e573c6 vDSP - Swift overlays to vDSP_desamp and vDSP_deq22. 2019-03-13 15:34:11 +00:00
simon gladman
12374f3a49 Swift Overlays to Accelerate vDSP Polynomial Evaluation Functions 2019-03-12 11:54:40 +00:00
Max Moiseev
9b5f24f071 [test] Use REQUIRES instead of XFAIL in an overlay test 2017-08-23 14:00:25 -07:00
Mishal Shah
df070b858f Update swift master to build with Xcode 9 beta 6, macOS 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-08-22 11:52:50 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00