File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Sources/AccelerateLinux/VectorOps Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -85,4 +85,4 @@ The package is structured as follows:
8585 - [x] ` vDSP.mean` - Mean of a vector
8686 - ` Transforms` :
8787 - [x] ` vDSP_vdpsp` - Convert a double vector to a single precision vector
88- - [ ] ` vDSP_vspdp` - Convert a single precision vector to a double precision vector
88+ - [x ] ` vDSP_vspdp` - Convert a single precision vector to a double precision vector
Original file line number Diff line number Diff line change @@ -22,4 +22,25 @@ public func vDSP_vdpsp(
2222 i += 1
2323 }
2424}
25+
26+ /// Converts a single-precision vector to a double-precision vector.
27+ /// - Parameters:
28+ /// - __A: The input vector.
29+ /// - __IA: The distance between the elements in the input vector.
30+ /// - __C: The output vector.
31+ /// - __IC: The distance between the elements in the output vector.
32+ /// - __N: The number of elements that the function processes.
33+ public func vDSP_vspdp(
34+ _ __A: UnsafePointer < Float > ,
35+ _ __IA: vDSP_Stride ,
36+ _ __C: UnsafeMutablePointer < Double > ,
37+ _ __IC: vDSP_Stride ,
38+ _ __N: vDSP_Length
39+ ) {
40+ var i = 0
41+ while i < __N {
42+ __C [ i * __IC] = Double ( __A [ i * __IA] )
43+ i += 1
44+ }
45+ }
2546#endif
You can’t perform that action at this time.
0 commit comments