Skip to content

Commit 46b4c89

Browse files
authored
Merge pull request #89 from oneapi-src/golam/hashtable/fix_seed
[hashtable] allow specifying seed w/o needing to specify --no-verify
2 parents 167c57e + 82cfdd0 commit 46b4c89

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

hashtable/CUDA/src/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ void process_cmdline_arguments(int argc, char* argv[], bool &verify, uint32_t &s
127127
verify = false;
128128
return;
129129
}
130+
} else if (argc == 3) {
131+
if (strcmp(argv[1], "--seed") == 0) {
132+
seed = std::stoi(argv[2]);
133+
return;
134+
}
130135
} else if (argc == 4) {
131136
if (strcmp(argv[1], "--no-verify") == 0 || strcmp(argv[2], "--seed") == 0) {
132137
verify = false;
@@ -272,7 +277,6 @@ PRINT_TIMER("iterate_hashtable ");
272277
// seconds = milliseconds / 1000.0f;
273278

274279
destroy_hashtable(pHashTable);
275-
276280
}
277281
TIMER_END()
278282
TIMER_PRINT("hashtable - total time for whole calculation")

hashtable/HIP/src/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ void process_cmdline_arguments(int argc, char* argv[], bool &verify, uint32_t &s
127127
verify = false;
128128
return;
129129
}
130+
} else if (argc == 3) {
131+
if (strcmp(argv[1], "--seed") == 0) {
132+
seed = std::stoi(argv[2]);
133+
return;
134+
}
130135
} else if (argc == 4) {
131136
if (strcmp(argv[1], "--no-verify") == 0 || strcmp(argv[2], "--seed") == 0) {
132137
verify = false;

hashtable/SYCL/src/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ void process_cmdline_arguments(int argc, char* argv[], bool &verify, uint32_t &s
127127
verify = false;
128128
return;
129129
}
130+
} else if (argc == 3) {
131+
if (strcmp(argv[1], "--seed") == 0) {
132+
seed = std::stoi(argv[2]);
133+
return;
134+
}
130135
} else if (argc == 4) {
131136
if (strcmp(argv[1], "--no-verify") == 0 || strcmp(argv[2], "--seed") == 0) {
132137
verify = false;
@@ -191,6 +196,7 @@ PRINT_TIMER("generate_hashtable ");
191196
START_TIMER();
192197
#endif
193198
sycl::queue qht;
199+
194200
#ifdef DEBUG_TIME
195201
STOP_TIMER();
196202
PRINT_TIMER("init ");
@@ -274,7 +280,6 @@ PRINT_TIMER("iterate_hashtable ");
274280
// seconds = milliseconds / 1000.0f;
275281

276282
destroy_hashtable(pHashTable, qht);
277-
278283
}
279284
TIMER_END()
280285
TIMER_PRINT("hashtable - total time for whole calculation")

0 commit comments

Comments
 (0)