summaryrefslogtreecommitdiff
path: root/HST-S
diff options
context:
space:
mode:
authorBirte Friesel <dfriesel@uos.de>2023-07-24 14:05:56 +0200
committerBirte Friesel <dfriesel@uos.de>2023-07-24 14:05:56 +0200
commite7e6d931f937b1f78ff7b71b2649cf983e145196 (patch)
treec15a78949ec03bbf729dde4af29936ed672579e9 /HST-S
parent2ba50934241c0ed7e6e56f003f96b24bf75c35f3 (diff)
HST-S CPU Baseline: initialize nr_of_dpus for -x 0
Diffstat (limited to 'HST-S')
-rw-r--r--HST-S/baselines/cpu/app_baseline.c7
1 files 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);