From 90588c3474fd87afbf3e7984d6503be2a06f3aa8 Mon Sep 17 00:00:00 2001 From: Matteo Perotti Date: Thu, 7 Sep 2023 17:21:28 +0200 Subject: [PATCH] [apps, scripts] Adjust kernel performance --- apps/fft/main.c | 2 +- apps/jacobi2d/kernel/jacobi2d.c | 1 + apps/roi_align/main.c | 2 +- scripts/performance.py | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/fft/main.c b/apps/fft/main.c index 6283287ed..b74037f73 100644 --- a/apps/fft/main.c +++ b/apps/fft/main.c @@ -192,7 +192,7 @@ int main() { stop_timer(); runtime = get_timer(); - float perf = (float)10.0 * NFFT * (31 - __builtin_clz(NFFT)) / runtime; + float perf = (float)5.0 * NFFT * (31 - __builtin_clz(NFFT)) / runtime; float max_perf = 6.0 / 5.0 * NR_LANES * 8.0 / sizeof(float); printf("Performance: %f. Max perf: %f. Actual performance is %f%% of max.\n", diff --git a/apps/jacobi2d/kernel/jacobi2d.c b/apps/jacobi2d/kernel/jacobi2d.c index b72ff7759..a815645a6 100644 --- a/apps/jacobi2d/kernel/jacobi2d.c +++ b/apps/jacobi2d/kernel/jacobi2d.c @@ -74,6 +74,7 @@ WITH ACCESS OR USE OF THE SOFTWARE. // Author: Matteo Perotti, ETH Zurich, #include "jacobi2d.h" +#define DOUBLE_BUFFERING void j2d_s(uint64_t r, uint64_t c, DATA_TYPE *A, DATA_TYPE *B, uint64_t tsteps) { diff --git a/apps/roi_align/main.c b/apps/roi_align/main.c index 2e97d04f6..709d6fec4 100644 --- a/apps/roi_align/main.c +++ b/apps/roi_align/main.c @@ -22,7 +22,7 @@ // Execute only the central kernel with fake data // Execute only on the channels -//#define V_KERNEL_ONLY 1 +#define V_KERNEL_ONLY 1 #define EXTRAPOLATION_VALUE 0 diff --git a/scripts/performance.py b/scripts/performance.py index ae9bbbece..c25b380eb 100755 --- a/scripts/performance.py +++ b/scripts/performance.py @@ -62,7 +62,7 @@ def fconv3d(args, cycles): def jacobi2d(args, cycles): size = int(args[0]) trash_0 = args[1] - performance = 5 * (size-1) * (size-1) / cycles + performance = 2 * 5 * (size-1) * (size-1) / cycles return [size, performance] def dropout(args, cycles): size = int(args[0]) @@ -71,7 +71,7 @@ def dropout(args, cycles): def fft(args, cycles): size = int(args[0]) dtype = args[1] - performance = 10 * size * np.log2(size) / cycles + performance = 5 * size * np.log2(size) / cycles return [size, performance] def dwt(args, cycles): size = int(args[0])