From e7e6d931f937b1f78ff7b71b2649cf983e145196 Mon Sep 17 00:00:00 2001 From: Birte Friesel Date: Mon, 24 Jul 2023 14:05:56 +0200 Subject: HST-S CPU Baseline: initialize nr_of_dpus for -x 0 --- HST-S/baselines/cpu/app_baseline.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/HST-S/baselines/cpu/app_baseline.c b/HST-S/baselines/cpu/app_baseline.c index d67b6b3..f814f21 100644 --- a/HST-S/baselines/cpu/app_baseline.c +++ b/HST-S/baselines/cpu/app_baseline.c @@ -164,10 +164,13 @@ int main(int argc, char **argv) { // Input/output allocation A = malloc(input_size * sizeof(T)); T *bufferA = A; - if(!p.exp) + if(!p.exp) { + // upstream code left nr_of_dpus uninitialized + nr_of_dpus = p.n_threads; histo_host = malloc(nr_of_dpus * p.bins * sizeof(unsigned int)); - else + } else { histo_host = malloc(p.bins * sizeof(unsigned int)); + } // Create an input file with arbitrary data. read_input(A, p); -- cgit v1.2.3