Ignore:
Timestamp:
Nov 2, 2014, 3:06:46 PM (5 years ago)
Author:
nmedfort
Message:

More work on multiplexing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r4242 r4287  
    9393
    9494    int opt_code;
    95     int count_only_option = 0;
    96     int print_version_option = 0;
    97     int regex_from_file_option = 0;
    98     int ascii_only_option = 0;
    99 
    100     int compile_time_option = 0;
     95    bool count_only_option = 0;
     96    bool print_version_option = 0;
     97    bool regex_from_file_option = 0;
     98    bool ascii_only_option = 0;
     99    bool compile_time_option = 0;
     100    bool enable_multiplexing = 0;
     101    bool print_usage = 0;
    101102
    102103    unsigned long long cycles = 0;
    103     double timer = 0;
     104
    104105
    105106    long lSize = 0;
     
    107108    size_t result;
    108109
    109     while ((opt_code = getopt(argc, argv, "cvfta")) != -1)
     110    while ((opt_code = getopt(argc, argv, "cvftam")) != -1)
    110111    {
    111112        switch (opt_code)
     
    126127            ascii_only_option = 1;
    127128            break;
     129        case 'm':
     130            enable_multiplexing = 1;
     131            break;
    128132        case '?':
    129133            break;
    130134        default:
    131135            printf ("Invalid option: %c\n", opt_code);
    132             printf("Usage: %s [-c] [-v] [-f] [-t] [-a] <regex|regexfile> <inputfile> [<outputfile>]\n", argv[0]);
    133                     exit(-1);
     136            print_usage = 1;
    134137        }
    135138    }
     
    138141    {
    139142        printf ("Too few arguments\n");
    140         printf("Usage: %s [-c] [-v] [-f] [-t] [-a] <regex|regexfile> <inputfile> [<outputfile>]\n", argv[0]);
     143        print_usage = 1;
     144    }
     145
     146    if (print_usage) {
     147        printf("Usage: %s [-a] [-c] [-f] [-m] [-t] [-v] <regex|regexfile> <inputfile> [<outputfile>]\n", argv[0]);
    141148        exit(-1);
    142149    }
     
    187194        if (optind != argc)
    188195        {
    189             printf ("Too many arguments\n");
    190             printf("Usage: %s [-c] [-v] [-f] [-t] [-a] <regex|regexfile> <inputfile> [<outputfile>]\n", argv[0]);
     196            printf("Too many arguments\n");
     197            printf("Usage: %s [-a] [-c] [-f] [-m] [-t] [-v] <regex|regexfile> <inputfile> [<outputfile>]\n", argv[0]);
    191198            exit(-1);
    192199        }
     
    229236    {
    230237        cycles = get_hrcycles();
    231         timer = getElapsedTime();
    232     }
    233     const auto llvm_codegen = icgrep::compile(encoding, (regex_from_file_option ? fileregex : inregex), compile_time_option);
     238    }
     239    const auto llvm_codegen = icgrep::compile(encoding, (regex_from_file_option ? fileregex : inregex), compile_time_option, enable_multiplexing);
    234240
    235241    if (compile_time_option)
    236242    {
    237243        cycles = get_hrcycles() - cycles;
    238         timer = getElapsedTime() - timer;
    239244        std::cout << "Total compile time - cycles:       " << cycles << std::endl;
    240         std::cout << "Total compile time - milliseconds: " << timer << std::endl;
    241245    }
    242246
Note: See TracChangeset for help on using the changeset viewer.