summaryrefslogtreecommitdiff
path: root/expt_0525.cu
diff options
context:
space:
mode:
Diffstat (limited to 'expt_0525.cu')
-rw-r--r--expt_0525.cu19
1 files changed, 15 insertions, 4 deletions
diff --git a/expt_0525.cu b/expt_0525.cu
index 8e7cd10..6450282 100644
--- a/expt_0525.cu
+++ b/expt_0525.cu
@@ -596,14 +596,19 @@ inline auto calcBlocks(size_t input) {
}
int main(int argc, char **argv) {
- if (argc != 4) {
- printf("Usage %s [sample] [search] [insertion]\n", argv[0]);
+ if (argc < 4) {
+ printf("Usage %s <sample> <search> <insertion> [file length]\n", argv[0]);
exit(1);
}
auto sample_length = strtol(argv[1], nullptr, 10);
auto search_length = strtol(argv[2], nullptr, 10);
auto insertion_length = strtol(argv[3], nullptr, 10);
+ auto total_row = 0L;
+
+ if (argc > 4) {
+ total_row = strtol(argv[4], nullptr, 10);
+ }
if (insertion_length < search_length) {
printf("Search should smaller than insertion\n");
@@ -611,10 +616,16 @@ int main(int argc, char **argv) {
printf("Sample: %ld, Insertion: %ld, Search: %ld ", sample_length,
insertion_length, search_length);
-
fflush(stdout);
+
ReadHelper readHelper("normal_distribution.txt", sample_length,
- insertion_length, 0);
+ insertion_length, total_row);
+
+ if (total_row) {
+ printf("Skip: %ld ", readHelper.random_number);
+ fflush(stdout);
+ }
+
readHelper.readFile();
std::vector<key_type> _sample, _population;
readHelper.split_into(_sample, _population);