new benchmarks (zfill, zsmul)
@@ -537,6 +537,45 @@ static double bench_fftmod(long scale)
+static double bench_generic_expand(int typ, long scale)
+{
+ long dims[DIMS] = { 1, 256 * scale, 256 * scale, 1, 1, 16, 1, 16 };
+
+ complex float* x = md_alloc(DIMS, dims, CFL_SIZE);
+
+ double tic = timestamp();
+
+ switch (typ) {
+
+ case 0:
+ md_zfill(DIMS, dims, x, 1.);
+ break;
+ case 1:
+ md_zsmul(DIMS, dims, x, x, 1.);
+ break;
+ default:
+ assert(0);
+ }
+
+ double toc = timestamp();
+
+ md_free(x);
+
+ return toc - tic;
+}
+
+
+static double bench_zfill(long scale)
+{
+ return bench_generic_expand(0, scale);
+}
+
+static double bench_zsmul(long scale)
+{
+ return bench_generic_expand(1, scale);
+}
+
+
enum bench_indices { REPETITION_IND, SCALE_IND, THREADS_IND, TESTS_IND, BENCH_DIMS };
@@ -597,6 +636,8 @@ const struct benchmark_s {
{ bench_zl1norm, "l1 norm" },
{ bench_copy1, "copy 1" },
{ bench_copy2, "copy 2" },
+ { bench_zfill, "complex fill" },
+ { bench_zsmul, "complex scalar multiplication" },
{ bench_wavelet, "wavelet soft thresh" },
{ bench_mdfft, "(MD-)FFT" },
{ bench_fft, "FFT" },
