File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Sources/AccelerateLinux/VectorOps Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -77,4 +77,4 @@ The package is structured as follows:
7777 - ` Statistical` - Statistical operations:
7878 - [x] ` vDSP.mean` - Mean of a vector
7979 - ` Transforms` :
80- - [ ] ` vDSP_vdpsp` - Convert a double vector to a single precision vector
80+ - [x ] ` vDSP_vdpsp` - Convert a double vector to a single precision vector
Original file line number Diff line number Diff line change 1+ #if canImport(Accelerate)
2+ @_exported import Accelerate
3+ #else
4+
5+ /// Converts a double-precision vector to a single-precision vector.
6+ /// - Parameters:
7+ /// - __A: The input vector.
8+ /// - __IA: The distance between the elements in the input vector.
9+ /// - __C: The output vector.
10+ /// - __IC: The distance between the elements in the output vector.
11+ /// - __N: The number of elements that the function processes.
12+ public func vDSP_vdpsp(
13+ _ __A: UnsafePointer < Double > ,
14+ _ __IA: vDSP_Stride ,
15+ _ __C: UnsafeMutablePointer < Float > ,
16+ _ __IC: vDSP_Stride ,
17+ _ __N: vDSP_Length
18+ ) {
19+ var i = 0
20+ while i < __N {
21+ __C [ i * __IC] = Float ( __A [ i * __IA] )
22+ i += 1
23+ }
24+ }
25+ #endif
You can’t perform that action at this time.
0 commit comments