@@ -14,69 +14,72 @@ import TestsUtils
14
14
15
15
public let SIMDReduceInteger = [
16
16
BenchmarkInfo (
17
- name: " SIMDReduceInt32x1 " ,
17
+ name: " SIMDReduce.Int32 " ,
18
18
runFunction: run_SIMDReduceInt32x1,
19
19
tags: [ . validation, . SIMD] ,
20
20
setUpFunction: { blackHole ( int32Data) }
21
21
) ,
22
22
BenchmarkInfo (
23
- name: " SIMDReduceInt32x4_init " ,
23
+ name: " SIMDReduce.Int32x4.Initializer " ,
24
24
runFunction: run_SIMDReduceInt32x4_init,
25
25
tags: [ . validation, . SIMD] ,
26
26
setUpFunction: { blackHole ( int32Data) }
27
27
) ,
28
28
BenchmarkInfo (
29
- name: " SIMDReduceInt32x4_cast " ,
29
+ name: " SIMDReduce.Int32x4.Cast " ,
30
30
runFunction: run_SIMDReduceInt32x4_cast,
31
31
tags: [ . validation, . SIMD] ,
32
32
setUpFunction: { blackHole ( int32Data) }
33
33
) ,
34
34
BenchmarkInfo (
35
- name: " SIMDReduceInt32x16_init " ,
35
+ name: " SIMDReduce.Int32x16.Initializer " ,
36
36
runFunction: run_SIMDReduceInt32x16_init,
37
37
tags: [ . validation, . SIMD] ,
38
38
setUpFunction: { blackHole ( int32Data) }
39
39
) ,
40
40
BenchmarkInfo (
41
- name: " SIMDReduceInt32x16_cast " ,
41
+ name: " SIMDReduce.Int32x16.Cast " ,
42
42
runFunction: run_SIMDReduceInt32x16_cast,
43
43
tags: [ . validation, . SIMD] ,
44
44
setUpFunction: { blackHole ( int32Data) }
45
45
) ,
46
46
BenchmarkInfo (
47
- name: " SIMDReduceInt8x1 " ,
47
+ name: " SIMDReduce.Int8 " ,
48
48
runFunction: run_SIMDReduceInt8x1,
49
49
tags: [ . validation, . SIMD] ,
50
50
setUpFunction: { blackHole ( int32Data) }
51
51
) ,
52
52
BenchmarkInfo (
53
- name: " SIMDReduceInt8x16_init " ,
53
+ name: " SIMDReduce.Int8x16.Initializer " ,
54
54
runFunction: run_SIMDReduceInt8x16_init,
55
55
tags: [ . validation, . SIMD] ,
56
56
setUpFunction: { blackHole ( int32Data) }
57
57
) ,
58
58
BenchmarkInfo (
59
- name: " SIMDReduceInt8x16_cast " ,
59
+ name: " SIMDReduce.Int8x16.Cast " ,
60
60
runFunction: run_SIMDReduceInt8x16_cast,
61
61
tags: [ . validation, . SIMD] ,
62
62
setUpFunction: { blackHole ( int32Data) }
63
63
) ,
64
64
BenchmarkInfo (
65
- name: " SIMDReduceInt8x64_init " ,
65
+ name: " SIMDReduce.Int8x64.Initializer " ,
66
66
runFunction: run_SIMDReduceInt8x64_init,
67
67
tags: [ . validation, . SIMD] ,
68
68
setUpFunction: { blackHole ( int32Data) }
69
69
) ,
70
70
BenchmarkInfo (
71
- name: " SIMDReduceInt8x64_cast " ,
71
+ name: " SIMDReduce.Int8x64.Cast " ,
72
72
runFunction: run_SIMDReduceInt8x64_cast,
73
73
tags: [ . validation, . SIMD] ,
74
74
setUpFunction: { blackHole ( int32Data) }
75
75
)
76
76
]
77
77
78
+ // TODO: use 100 for Onone?
79
+ let scale = 1000
80
+
78
81
let int32Data : UnsafeBufferPointer < Int32 > = {
79
- let count = 64
82
+ let count = 256
80
83
// Allocate memory for `count` Int32s with alignment suitable for all
81
84
// SIMD vector types.
82
85
let untyped = UnsafeMutableRawBufferPointer . allocate (
@@ -93,7 +96,7 @@ let int32Data: UnsafeBufferPointer<Int32> = {
93
96
94
97
@inline ( never)
95
98
public func run_SIMDReduceInt32x1( _ N: Int ) {
96
- for _ in 0 ..< 1000 * N {
99
+ for _ in 0 ..< scale *N {
97
100
var accum : Int32 = 0
98
101
for v in int32Data {
99
102
accum &+= v &* v
@@ -104,7 +107,7 @@ public func run_SIMDReduceInt32x1(_ N: Int) {
104
107
105
108
@inline ( never)
106
109
public func run_SIMDReduceInt32x4_init( _ N: Int ) {
107
- for _ in 0 ..< 1000 * N {
110
+ for _ in 0 ..< scale *N {
108
111
var accum = SIMD4 < Int32 > ( )
109
112
for i in stride ( from: 0 , to: int32Data. count, by: 4 ) {
110
113
let v = SIMD4 ( int32Data [ i ..< i+ 4 ] )
@@ -126,7 +129,7 @@ public func run_SIMDReduceInt32x4_cast(_ N: Int) {
126
129
start: UnsafeRawPointer ( int32Data. baseAddress!) . assumingMemoryBound ( to: SIMD4< Int32> . self ) ,
127
130
count: int32Data. count / 4
128
131
)
129
- for _ in 0 ..< 1000 * N {
132
+ for _ in 0 ..< scale *N {
130
133
var accum = SIMD4 < Int32 > ( )
131
134
for v in vecs {
132
135
accum &+= v &* v
@@ -137,7 +140,7 @@ public func run_SIMDReduceInt32x4_cast(_ N: Int) {
137
140
138
141
@inline ( never)
139
142
public func run_SIMDReduceInt32x16_init( _ N: Int ) {
140
- for _ in 0 ..< 1000 * N {
143
+ for _ in 0 ..< scale *N {
141
144
var accum = SIMD16 < Int32 > ( )
142
145
for i in stride ( from: 0 , to: int32Data. count, by: 16 ) {
143
146
let v = SIMD16 ( int32Data [ i ..< i+ 16 ] )
@@ -153,7 +156,7 @@ public func run_SIMDReduceInt32x16_cast(_ N: Int) {
153
156
start: UnsafeRawPointer ( int32Data. baseAddress!) . assumingMemoryBound ( to: SIMD16< Int32> . self ) ,
154
157
count: int32Data. count / 16
155
158
)
156
- for _ in 0 ..< 1000 * N {
159
+ for _ in 0 ..< scale *N {
157
160
var accum = SIMD16 < Int32 > ( )
158
161
for v in vecs {
159
162
accum &+= v &* v
@@ -163,7 +166,7 @@ public func run_SIMDReduceInt32x16_cast(_ N: Int) {
163
166
}
164
167
165
168
let int8Data : UnsafeBufferPointer < Int8 > = {
166
- let count = 256
169
+ let count = 1024
167
170
// Allocate memory for `count` Int8s with alignment suitable for all
168
171
// SIMD vector types.
169
172
let untyped = UnsafeMutableRawBufferPointer . allocate (
@@ -180,7 +183,7 @@ let int8Data: UnsafeBufferPointer<Int8> = {
180
183
181
184
@inline ( never)
182
185
public func run_SIMDReduceInt8x1( _ N: Int ) {
183
- for _ in 0 ..< 1000 * N {
186
+ for _ in 0 ..< scale *N {
184
187
var accum : Int8 = 0
185
188
for v in int8Data {
186
189
accum &+= v &* v
@@ -191,7 +194,7 @@ public func run_SIMDReduceInt8x1(_ N: Int) {
191
194
192
195
@inline ( never)
193
196
public func run_SIMDReduceInt8x16_init( _ N: Int ) {
194
- for _ in 0 ..< 1000 * N {
197
+ for _ in 0 ..< scale *N {
195
198
var accum = SIMD16 < Int8 > ( )
196
199
for i in stride ( from: 0 , to: int8Data. count, by: 16 ) {
197
200
let v = SIMD16 ( int8Data [ i ..< i+ 16 ] )
@@ -207,7 +210,7 @@ public func run_SIMDReduceInt8x16_cast(_ N: Int) {
207
210
start: UnsafeRawPointer ( int8Data. baseAddress!) . assumingMemoryBound ( to: SIMD16< Int8> . self ) ,
208
211
count: int8Data. count / 16
209
212
)
210
- for _ in 0 ..< 1000 * N {
213
+ for _ in 0 ..< scale *N {
211
214
var accum = SIMD16 < Int8 > ( )
212
215
for v in vecs {
213
216
accum &+= v &* v
@@ -218,7 +221,7 @@ public func run_SIMDReduceInt8x16_cast(_ N: Int) {
218
221
219
222
@inline ( never)
220
223
public func run_SIMDReduceInt8x64_init( _ N: Int ) {
221
- for _ in 0 ..< 1000 * N {
224
+ for _ in 0 ..< scale *N {
222
225
var accum = SIMD64 < Int8 > ( )
223
226
for i in stride ( from: 0 , to: int8Data. count, by: 64 ) {
224
227
let v = SIMD64 ( int8Data [ i ..< i+ 64 ] )
@@ -234,7 +237,7 @@ public func run_SIMDReduceInt8x64_cast(_ N: Int) {
234
237
start: UnsafeRawPointer ( int8Data. baseAddress!) . assumingMemoryBound ( to: SIMD64< Int8> . self ) ,
235
238
count: int8Data. count / 64
236
239
)
237
- for _ in 0 ..< 1000 * N {
240
+ for _ in 0 ..< scale *N {
238
241
var accum = SIMD64 < Int8 > ( )
239
242
for v in vecs {
240
243
accum &+= v &* v
0 commit comments