File tree 1 file changed +22
-0
lines changed 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -213,4 +213,26 @@ g["boolarray_true_load!"] = @benchmarkable perf_true_load!($boolarr)
213
213
g[" bitarray_true_fill!" ] = @benchmarkable fill! ($ bitarr, true )
214
214
g[" boolarray_true_fill!" ] = @benchmarkable fill! ($ boolarr, true )
215
215
216
+
217
+ # ###################################
218
+ # Float to Int conversion (#18954) #
219
+ # ###################################
220
+
221
+ function perf_convert! (a, x)
222
+ for i= 1 : length (x)
223
+ a[i] = x[i]
224
+ end
225
+ return a
226
+ end
227
+
228
+ x_int = rand (1 : 1000000 ,100 ,100 )
229
+ x_float = 1.0 * x_int
230
+ x_complex = x_float .+ 0.0im
231
+
232
+ g = addgroup! (SUITE, " convert" , [" Int" ])
233
+ g[" Int" , " Float64" ] = @benchmarkable perf_convert! ($ x_int, $ x_float)
234
+ g[" Float64" , " Int" ] = @benchmarkable perf_convert! ($ x_float, $ x_int)
235
+ g[" Complex{Float64}" , " Int" ] = @benchmarkable perf_convert! ($ x_complex, $ x_int)
236
+ g[" Int" , " Complex{Float64}" ] = @benchmarkable perf_convert! ($ x_int, $ x_complex)
237
+
216
238
end # module
You can’t perform that action at this time.
0 commit comments