diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2025-01-10 09:55:24 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2025-01-10 09:55:24 +0100 |
commit | ffc37b5f40278ff6b736fb2aeaa407171bd103da (patch) | |
tree | 3d7cde4dd652a293de74c45beb94af8309a4fb04 /BS/host | |
parent | b5b95dad5e2d80f06932fbe97e2c87f5ba4d9a5b (diff) |
BS: Randomize elements and queries
Diffstat (limited to 'BS/host')
-rw-r--r-- | BS/host/app.c | 6 |
1 files changed, 4 insertions, 2 deletions
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]; } } |