summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BS/baselines/cpu/bs_omp.c2
-rw-r--r--BS/host/app.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/BS/baselines/cpu/bs_omp.c b/BS/baselines/cpu/bs_omp.c
index 874299b..d79ede8 100644
--- a/BS/baselines/cpu/bs_omp.c
+++ b/BS/baselines/cpu/bs_omp.c
@@ -45,7 +45,7 @@ void create_test_file(DTYPE * input, uint64_t nr_elements, DTYPE * querys, uint
for(uint64_t i = 0; i < n_querys; i++)
{
- querys[i] = input[rand() % (nr_elements - 2)];
+ querys[i] = input[rand() % nr_elements];
}
}
diff --git a/BS/host/app.c b/BS/host/app.c
index 10d76f1..f267645 100644
--- a/BS/host/app.c
+++ b/BS/host/app.c
@@ -33,12 +33,14 @@
// Create input arrays
void create_test_file(DTYPE * input, DTYPE * querys, uint64_t nr_elements, uint64_t nr_querys) {
+ srand(time(NULL));
+
input[0] = 1;
for (uint64_t i = 1; i < nr_elements; i++) {
- input[i] = input[i - 1] + 1;
+ input[i] = input[i - 1] + (rand() % 10) + 1;
}
for (uint64_t i = 0; i < nr_querys; i++) {
- querys[i] = i;
+ querys[i] = input[rand() % nr_elements];
}
}