Changeset 1795


Ignore:
Timestamp:
Dec 18, 2011, 10:57:01 AM (7 years ago)
Author:
vla24
Message:

updated wcd template implementation for Ken's symbol table.

Location:
proto/SymbolTable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/SymbolTable/src/Makefile

    r1786 r1795  
    5656
    5757buffer_profiling_papi: $(SRCFILE)
    58         $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -DCODE_CLOCKER  -DPERF_SCRIPT -DUSE_XMLWF $(CODE_CLOCKER) #-DCACHE_PERF
     58        $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -DCODE_CLOCKER  -DPERF_SCRIPT -DUSE_XMLWF $(CODE_CLOCKER) # -DL2_PERF
    5959
    6060asm:  $(SRCFILE)
  • proto/SymbolTable/wcd_ls_template.cpp

    r1721 r1795  
    11// WARNING: This implementation does not run, it will give the wrong result and crash.
    2 #error "This implementation does not run, it will give the wrong result and/or crash."
     2//#error "This implementation does not run, it will give the wrong result and/or crash."
    33
    44#define USE_LS_SYMBOL_TABLE
     
    2828int buffer_base=0;
    2929char * source;
    30 BitBlock EOF_mask = simd<1>::constant<1>();
    3130
    3231queue <size_t> elem_starts_buf;
     
    3433vector <int> gids;
    3534LSSymbolTable ls_symbol_table;
    36 LineColTracker tracker;
    3735
    3836static inline void postprocess_do_block(Dictionary& dictionary);
     
    4038template<bool allow_performance_check, bool finalize_gids> void do_process(FILE *infile, FILE *outfile);
    4139
    42 static inline void validate_block(BitBlockForwardIterator & start, int block_base, int is_valid(int));
    43 static inline void validate_block(BitBlockForwardIterator & start, int block_base, int is_valid(int,int));
    4440static inline void do_symbol_table_lookup();
    4541
     
    5248                         dictionaryfile, infile, outfile);
    5349    int greatest_GID_in_dictionary;
    54     populateDictionary(dictionaryfile, outfile, gids, greatest_GID_in_dictionary);
    55 
    56     ls_symbol_table.clear();
    57     rewind (dictionaryfile);
    58     do_process<true, false>(dictionaryfile, outfile);
     50//    populateDictionary(dictionaryfile, outfile, gids, greatest_GID_in_dictionary);
     51
     52//    ls_symbol_table.clear();
     53//    rewind (dictionaryfile);
     54//    do_process<true, false>(dictionaryfile, outfile);
    5955
    6056//      PERF_SEC_BIND(1);
     
    7268
    7369    // gather dictionary statistics
    74     int totalKnownWordsInDictionary, totalUnknownWordsInDictionary;
    75     wordCountInDictionary(greatest_GID_in_dictionary, gids, totalUnknownWordsInDictionary, totalKnownWordsInDictionary);
    76     printWordCountInDictionary(totalUnknownWordsInDictionary, totalKnownWordsInDictionary);
     70//    int totalKnownWordsInDictionary, totalUnknownWordsInDictionary;
     71//    wordCountInDictionary(greatest_GID_in_dictionary, gids, totalUnknownWordsInDictionary, totalKnownWordsInDictionary);
     72//    printWordCountInDictionary(totalUnknownWordsInDictionary, totalKnownWordsInDictionary);
    7773
    7874    fclose(dictionaryfile);
     
    119115        ls_symbol_table.put((unsigned char*)source + start - buffer_base, length);
    120116    }
    121 }
    122 
    123 static inline void validate_block(BitBlockForwardIterator & start, int block_base, int is_valid(int)) {
    124 
    125         BitBlockForwardIterator end;
    126         int pos, block_pos;
    127 
    128         while(start != end) {
    129 
    130                 block_pos = block_base + *start;
    131                 int rv = is_valid(block_pos);
    132 
    133                 if (rv) {
    134                         int error_line, error_column;
    135                         tracker.get_Line_and_Column(block_pos, error_line, error_column);
    136                         ReportError(XMLTestSuiteError::get_msg(rv), error_line, error_column);
    137                         exit(-1);
    138                 }
    139                 start++;
    140         }
    141 }
    142 
    143 static inline void validate_block(BitBlockForwardIterator & start, int block_base, int buffer_base, int is_valid(int,int)) {
    144 
    145         BitBlockForwardIterator end;
    146         int pos, block_pos, file_pos;
    147 
    148         while(start != end) {
    149 
    150                 block_pos = block_base + *start;
    151                 file_pos = block_pos+buffer_base;
    152 
    153 
    154                 int rv = is_valid(block_pos, file_pos);
    155 
    156                 if (rv) {
    157                         int error_line, error_column;
    158                         tracker.get_Line_and_Column(block_pos, error_line, error_column);
    159                         ReportError(XMLTestSuiteError::get_msg(rv), error_line, error_column);
    160                         exit(-1);
    161                 }
    162                 start++;
    163         }
    164117}
    165118
Note: See TracChangeset for help on using the changeset viewer.