Ignore:
Timestamp:
Mar 23, 2015, 8:37:57 PM (5 years ago)
Author:
cameron
Message:

Restructure to use a single process_block_state data area

File:
1 edited

Legend:

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

    r4482 r4538  
    3434#define BUFFER_SEGMENTS 15
    3535#define BUFFER_SIZE (BUFFER_SEGMENTS * SEGMENT_SIZE)
    36 
    37 #define BitBlock_declare(name)  BitBlock name
    38 
    39 #define ubitblock_declare(name, n) \
    40   ubitblock name[n];\
    41   do {int i;\
    42       for (i = 0; i < n; i++) name[i]._128 = simd<1>::constant<0>();\
    43      }\
    44   while (0)
    4536
    4637BitBlock EOF_mask = simd<1>::constant<1>();
     
    143134    struct Output output;
    144135    BitBlock match_vector;
    145     BitBlock carry_q[mCarries];
    146     BitBlock advance_q[mAdvances];
    147    
     136    BitBlock process_block_state_data[(mProcessBlockStateSize + sizeof(BitBlock) - 1)/sizeof(BitBlock)];   
    148137   
    149138    mFileName = infilename + ":";
     
    158147
    159148    match_vector = simd<1>::constant<0>();
    160     memset (carry_q, 0, sizeof(BitBlock) * mCarries);
    161     memset (advance_q, 0, sizeof(BitBlock) * mAdvances);
    162    
     149    memset (process_block_state_data, 0, mProcessBlockStateSize);
    163150    int fdSrc;
    164151    struct stat infile_sb;
     
    209196            block_base = blk*BLOCK_SIZE + segment_base;
    210197            s2p_do_block((BytePack *) &mFileBuffer[block_base], basis_bits);
    211             mProcessBlockFcn(basis_bits, carry_q, advance_q, output);
     198            mProcessBlockFcn(basis_bits, process_block_state_data, output);
    212199
    213200            mLineBreak_scanner.load_block(output.LF, blk);
     
    254241        block_base = block_pos + segment_base;
    255242        s2p_do_block((BytePack *) &mFileBuffer[block_base], basis_bits);
    256         mProcessBlockFcn(basis_bits, carry_q, advance_q, output);
     243        mProcessBlockFcn(basis_bits, process_block_state_data, output);
    257244
    258245        mLineBreak_scanner.load_block(output.LF, blk);
     
    297284    }
    298285   
    299     mProcessBlockFcn(basis_bits, carry_q, advance_q, output);
     286    mProcessBlockFcn(basis_bits, process_block_state_data, output);
    300287
    301288    if (mCountOnlyOption)
Note: See TracChangeset for help on using the changeset viewer.