Changeset 1608 for proto


Ignore:
Timestamp:
Oct 28, 2011, 7:55:00 PM (8 years ago)
Author:
ksherdy
Message:

Added block at a time iterator class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/pablo_template.cpp

    r1606 r1608  
    1111#include "../lib/carryQ.hpp"
    1212#include "../lib/bit_stream_iterator.hpp"
     13#include "../lib/bit_block_iterator.hpp"
    1314
    1415#define SEGMENT_BLOCKS 12
     
    7172void do_process(FILE *infile, FILE *outfile);
    7273
    73 static inline void validate_block(BitStreamIterator & start, int block_base, int is_valid(int));
    74 static inline void validate_block(BitStreamIterator & start, int block_base, int is_valid(int,int));
     74static inline void validate_block(BitBlockIterator<BitBlock> & start, int block_base, int is_valid(int));
     75static inline void validate_block(BitBlockIterator<BitBlock> & start, int block_base, int is_valid(int,int));
    7576
    7677int main(int argc, char * argv[]) {
     
    266267}
    267268
    268 static inline void validate_block(BitStreamIterator & start, int block_base, int is_valid(int)) {
    269 
    270         BitStreamIterator end;
     269static inline void validate_block(BitBlockIterator<BitBlock> & start, int block_base, int is_valid(int)) {
     270
     271        BitBlockIterator<BitBlock> end;
    271272        int pos, block_pos;
    272273
     
    286287}
    287288
    288 static inline void validate_block(BitStreamIterator & start, int block_base, int buffer_base, int is_valid(int,int)) {
    289 
    290         BitStreamIterator end;
     289static inline void validate_block(BitBlockIterator<BitBlock> & start, int block_base, int buffer_base, int is_valid(int,int)) {
     290
     291        BitBlockIterator<BitBlock> end;
    291292        int pos, block_pos, file_pos;
    292293
     
    313314
    314315                if (bitblock_has_bit(simd_or(check_streams.non_ascii_name_starts, check_streams.non_ascii_names))) {
    315                     BitStreamIterator iter_NameStrt_check(&check_streams.non_ascii_name_starts, sizeof(BitBlock)/sizeof(ScanBlock));
     316                    BitBlockIterator<BitBlock> iter_NameStrt_check(&check_streams.non_ascii_name_starts);
    316317                        validate_block(iter_NameStrt_check, block_base, NameStrt_check);
    317                         BitStreamIterator iter_Name_check(&check_streams.non_ascii_names, sizeof(BitBlock)/sizeof(ScanBlock));
     318                        BitBlockIterator<BitBlock> iter_Name_check(&check_streams.non_ascii_names);
    318319                        validate_block(iter_Name_check, block_base, Name_check);
    319320                }
    320321            if (bitblock_has_bit(ctCDPI_Callouts.PI_name_starts)){
    321                 BitStreamIterator iter_PI_name_starts(&(ctCDPI_Callouts.PI_name_starts), sizeof(BitBlock)/sizeof(ScanBlock));
     322                BitBlockIterator<BitBlock> iter_PI_name_starts(&(ctCDPI_Callouts.PI_name_starts));
    322323                validate_block(iter_PI_name_starts, block_base, buffer_base, PIName_check);
    323324            }
    324325            if (bitblock_has_bit(ctCDPI_Callouts.CD_starts)){
    325                 BitStreamIterator iter_CD_check(&ctCDPI_Callouts.CD_starts, sizeof(BitBlock)/sizeof(ScanBlock));
     326                BitBlockIterator<BitBlock> iter_CD_check(&ctCDPI_Callouts.CD_starts);
    326327                validate_block(iter_CD_check, block_base, CD_check);
    327328            }
    328329            if(bitblock_has_bit(ref_Callouts.GenRef_starts)){
    329                 BitStreamIterator iter_GenRef_check(&ref_Callouts.GenRef_starts, sizeof(BitBlock)/sizeof(ScanBlock));
     330                BitBlockIterator<BitBlock> iter_GenRef_check(&ref_Callouts.GenRef_starts);
    330331                validate_block(iter_GenRef_check, block_base, GenRef_check);
    331332            }
    332333            if(bitblock_has_bit(ref_Callouts.DecRef_starts)){
    333                 BitStreamIterator iter_DecRef_check(&ref_Callouts.DecRef_starts, sizeof(BitBlock)/sizeof(ScanBlock));
     334                BitBlockIterator<BitBlock> iter_DecRef_check(&ref_Callouts.DecRef_starts);
    334335                validate_block(iter_DecRef_check, block_base, DecRef_check);
    335336            }
    336337            if(bitblock_has_bit(ref_Callouts.HexRef_starts)){
    337                 BitStreamIterator iter_HexRef_check(&ref_Callouts.HexRef_starts, sizeof(BitBlock)/sizeof(ScanBlock));
     338                BitBlockIterator<BitBlock> iter_HexRef_check(&ref_Callouts.HexRef_starts);
    338339                validate_block(iter_HexRef_check, block_base, HexRef_check);
    339340            }
    340341            if(bitblock_has_bit(check_streams.att_refs)){
    341                 BitStreamIterator iter_AttRef_check(&check_streams.att_refs, sizeof(BitBlock)/sizeof(ScanBlock));
     342                BitBlockIterator<BitBlock> iter_AttRef_check(&check_streams.att_refs);
    342343                validate_block(iter_AttRef_check, block_base, AttRef_check);
    343344            }
Note: See TracChangeset for help on using the changeset viewer.