Skip to content

Commit 3c813fa

Browse files
author
Simon Gladman
committed
Composite Branch of vDSP Swift Overlay Work
Contains the following: [Accelerate] [vDSP] Swift Overlays to Sliding Window Summation Operations [Accelerate] [vDSP] Swift Overlays to Linear Interpolation Operations [Accelerate] [vDSP] Swift Overlays to Complex Vector Operations [Accelerate] [vDSP] Swift overlays to 1D and 2D convolution operations. [Accelerate] [vDSP] Swift overlays to dot product and distance functions. [Accelerate] [vDSP] Swift overlays to `vDSP_desamp` and `vDSP_deq22`. [Accelerate] [vDSP] Vector Reduction Functions [Accelerate] [vDSP] Elementwise Vector-Vector and Vector-Scalar Arithmetic [Accelerate] [vDSP] Miscellaneous Conversion Functions [Accelerate] [vDSP] Polynomial Evaluation Functions [Accelerate] [vDSP] Clipping, Limit, and Threshold Functions [Accelerate] [vDSP] Fill, Clear, and Generation Functions [Accelerate] [vDSP] Integration Functions [Accelerate] [vDSP] Vector Type Conversion Functions [Accelerate] [vDSP] Swift overlays to Vector-Vector Extrema and Single-Vector Operations
1 parent 7be3ed7 commit 3c813fa

21 files changed

+948
-1115
lines changed

stdlib/public/Darwin/Accelerate/vDSP_Arithmetic.swift

Lines changed: 280 additions & 282 deletions
Large diffs are not rendered by default.

stdlib/public/Darwin/Accelerate/vDSP_ClippingLimitThreshold.swift

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Accelerate
14-
1513
extension vDSP {
1614

1715
// MARK: Clip
@@ -26,7 +24,7 @@ extension vDSP {
2624
public static func clip<U>(_ vector: U,
2725
to bounds: ClosedRange<Float>) -> [Float]
2826
where
29-
U: _ContiguousCollection,
27+
U: AccelerateBuffer,
3028
U.Element == Float {
3129

3230
let result = Array<Float>(unsafeUninitializedCapacity: vector.count) {
@@ -53,8 +51,8 @@ extension vDSP {
5351
to bounds: ClosedRange<Float>,
5452
result: inout V)
5553
where
56-
U: _ContiguousCollection,
57-
V: _MutableContiguousCollection,
54+
U: AccelerateBuffer,
55+
V: AccelerateMutableBuffer,
5856
U.Element == Float, V.Element == Float {
5957

6058
let n = result.count
@@ -85,7 +83,7 @@ extension vDSP {
8583
public static func clip<U>(_ vector: U,
8684
to bounds: ClosedRange<Double>) -> [Double]
8785
where
88-
U: _ContiguousCollection,
86+
U: AccelerateBuffer,
8987
U.Element == Double {
9088

9189
let result = Array<Double>(unsafeUninitializedCapacity: vector.count) {
@@ -112,8 +110,8 @@ extension vDSP {
112110
to bounds: ClosedRange<Double>,
113111
result: inout V)
114112
where
115-
U: _ContiguousCollection,
116-
V: _MutableContiguousCollection,
113+
U: AccelerateBuffer,
114+
V: AccelerateMutableBuffer,
117115
U.Element == Double, V.Element == Double {
118116

119117
let n = result.count
@@ -159,7 +157,7 @@ extension vDSP {
159157
public static func invertedClip<U>(_ vector: U,
160158
to bounds: ClosedRange<Float>) -> [Float]
161159
where
162-
U: _ContiguousCollection,
160+
U: AccelerateBuffer,
163161
U.Element == Float {
164162

165163
let result = Array<Float>(unsafeUninitializedCapacity: vector.count) {
@@ -199,8 +197,8 @@ extension vDSP {
199197
to bounds: ClosedRange<Float>,
200198
result: inout V)
201199
where
202-
U: _ContiguousCollection,
203-
V: _MutableContiguousCollection,
200+
U: AccelerateBuffer,
201+
V: AccelerateMutableBuffer,
204202
U.Element == Float, V.Element == Float {
205203

206204
let n = result.count
@@ -244,7 +242,7 @@ extension vDSP {
244242
public static func invertedClip<U>(_ vector: U,
245243
to bounds: ClosedRange<Double>) -> [Double]
246244
where
247-
U: _ContiguousCollection,
245+
U: AccelerateBuffer,
248246
U.Element == Double {
249247

250248
let result = Array<Double>(unsafeUninitializedCapacity: vector.count) {
@@ -284,8 +282,8 @@ extension vDSP {
284282
to bounds: ClosedRange<Double>,
285283
result: inout V)
286284
where
287-
U: _ContiguousCollection,
288-
V: _MutableContiguousCollection,
285+
U: AccelerateBuffer,
286+
V: AccelerateMutableBuffer,
289287
U.Element == Double, V.Element == Double {
290288

291289
let n = result.count
@@ -328,7 +326,7 @@ extension vDSP {
328326
to lowerBound: Float,
329327
with rule: ThresholdRule<Float>) -> [Float]
330328
where
331-
U: _ContiguousCollection,
329+
U: AccelerateBuffer,
332330
U.Element == Float {
333331

334332
let result = Array<Float>(unsafeUninitializedCapacity: vector.count) {
@@ -364,8 +362,8 @@ extension vDSP {
364362
with rule: ThresholdRule<Float>,
365363
result: inout V)
366364
where
367-
U: _ContiguousCollection,
368-
V: _MutableContiguousCollection,
365+
U: AccelerateBuffer,
366+
V: AccelerateMutableBuffer,
369367
U.Element == Float, V.Element == Float {
370368

371369
let n = result.count
@@ -409,7 +407,7 @@ extension vDSP {
409407
to lowerBound: Double,
410408
with rule: ThresholdRule<Double>) -> [Double]
411409
where
412-
U: _ContiguousCollection,
410+
U: AccelerateBuffer,
413411
U.Element == Double {
414412

415413
let result = Array<Double>(unsafeUninitializedCapacity: vector.count) {
@@ -445,8 +443,8 @@ extension vDSP {
445443
with rule: ThresholdRule<Double>,
446444
result: inout V)
447445
where
448-
U: _ContiguousCollection,
449-
V: _MutableContiguousCollection,
446+
U: AccelerateBuffer,
447+
V: AccelerateMutableBuffer,
450448
U.Element == Double, V.Element == Double {
451449

452450
let n = result.count
@@ -495,7 +493,7 @@ extension vDSP {
495493
limit: Float,
496494
withOutputConstant outputConstant: Float) -> [Float]
497495
where
498-
U: _ContiguousCollection,
496+
U: AccelerateBuffer,
499497
U.Element == Float {
500498

501499
let result = Array<Float>(unsafeUninitializedCapacity: vector.count) {
@@ -527,8 +525,8 @@ extension vDSP {
527525
withOutputConstant outputConstant: Float,
528526
result: inout V)
529527
where
530-
U: _ContiguousCollection,
531-
V: _MutableContiguousCollection,
528+
U: AccelerateBuffer,
529+
V: AccelerateMutableBuffer,
532530
U.Element == Float, V.Element == Float {
533531

534532
let n = result.count
@@ -563,7 +561,7 @@ extension vDSP {
563561
limit: Double,
564562
withOutputConstant outputConstant: Double) -> [Double]
565563
where
566-
U: _ContiguousCollection,
564+
U: AccelerateBuffer,
567565
U.Element == Double {
568566

569567
let result = Array<Double>(unsafeUninitializedCapacity: vector.count) {
@@ -595,8 +593,8 @@ extension vDSP {
595593
withOutputConstant outputConstant: Double,
596594
result: inout V)
597595
where
598-
U: _ContiguousCollection,
599-
V: _MutableContiguousCollection,
596+
U: AccelerateBuffer,
597+
V: AccelerateMutableBuffer,
600598
U.Element == Double, V.Element == Double {
601599

602600
let n = result.count

stdlib/public/Darwin/Accelerate/vDSP_ComplexConversion.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Accelerate
14-
15-
1613
extension vDSP {
1714

1815
/// Converts split complex to interleaved complex; single-precision.

stdlib/public/Darwin/Accelerate/vDSP_ComplexOperations.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extension vDSP {
2727
public static func phase<V>(_ splitComplex: DSPSplitComplex,
2828
result: inout V)
2929
where
30-
V: _MutableContiguousCollection,
30+
V: AccelerateMutableBuffer,
3131
V.Element == Float {
3232

3333
let n = vDSP_Length(result.count)
@@ -50,7 +50,7 @@ extension vDSP {
5050
public static func phase<V>(_ splitComplex: DSPDoubleSplitComplex,
5151
result: inout V)
5252
where
53-
V: _MutableContiguousCollection,
53+
V: AccelerateMutableBuffer,
5454
V.Element == Double {
5555

5656
let n = vDSP_Length(result.count)
@@ -166,7 +166,7 @@ extension vDSP {
166166
by vector: U,
167167
result: inout DSPSplitComplex)
168168
where
169-
U: _ContiguousCollection,
169+
U: AccelerateBuffer,
170170
U.Element == Float {
171171

172172
withUnsafePointer(to: splitComplex) { a in
@@ -191,7 +191,7 @@ extension vDSP {
191191
by vector: U,
192192
result: inout DSPDoubleSplitComplex)
193193
where
194-
U: _ContiguousCollection,
194+
U: AccelerateBuffer,
195195
U.Element == Double {
196196

197197
withUnsafePointer(to: splitComplex) { a in
@@ -216,7 +216,7 @@ extension vDSP {
216216
by vector: U,
217217
result: inout DSPSplitComplex)
218218
where
219-
U: _ContiguousCollection,
219+
U: AccelerateBuffer,
220220
U.Element == Float {
221221

222222
withUnsafePointer(to: splitComplex) { a in
@@ -241,7 +241,7 @@ extension vDSP {
241241
by vector: U,
242242
result: inout DSPDoubleSplitComplex)
243243
where
244-
U: _ContiguousCollection,
244+
U: AccelerateBuffer,
245245
U.Element == Double {
246246

247247
withUnsafePointer(to: splitComplex) { a in
@@ -472,7 +472,7 @@ extension vDSP {
472472
public static func absolute<V>(_ vector: DSPSplitComplex,
473473
result: inout V)
474474
where
475-
V: _MutableContiguousCollection,
475+
V: AccelerateMutableBuffer,
476476
V.Element == Float {
477477

478478
let n = result.count
@@ -496,7 +496,7 @@ extension vDSP {
496496
public static func absolute<V>(_ vector: DSPDoubleSplitComplex,
497497
result: inout V)
498498
where
499-
V: _MutableContiguousCollection,
499+
V: AccelerateMutableBuffer,
500500
V.Element == Double {
501501

502502
let n = result.count
@@ -525,7 +525,7 @@ extension vDSP {
525525
public static func squareMagnitudes<V>(_ splitComplex: DSPSplitComplex,
526526
result: inout V)
527527
where
528-
V : _MutableContiguousCollection,
528+
V : AccelerateMutableBuffer,
529529
V.Element == Float {
530530

531531
let n = vDSP_Length(result.count)
@@ -548,7 +548,7 @@ extension vDSP {
548548
public static func squareMagnitudes<V>(_ splitComplex: DSPDoubleSplitComplex,
549549
result: inout V)
550550
where
551-
V : _MutableContiguousCollection,
551+
V : AccelerateMutableBuffer,
552552
V.Element == Double {
553553

554554
let n = vDSP_Length(result.count)

0 commit comments

Comments
 (0)