Ignore:
Timestamp:
Jan 18, 2013, 11:59:55 AM (6 years ago)
Author:
bhull
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/PDF/pablo_template_pdf.cpp

    r2803 r2814  
    1212#include <simd-lib/bitblock.hpp>
    1313#include <simd-lib/carryQ.hpp>
    14 #include <simd-lib/pabloSupport.hpp>
    1514#include <simd-lib/bitblock_iterator.hpp>
    1615#include <simd-lib/s2p.hpp>
     
    174173#define PADDING_BLOCKS 1
    175174#define PADDING_SIZE (BLOCK_SIZE * PADDING_BLOCKS)
    176 #define COPYBACK_BLOCKS 0
     175#define COPYBACK_BLOCKS 1
    177176#define COPYBACK_SIZE (BLOCK_SIZE * COPYBACK_BLOCKS)
    178 #define LOOKAHEAD_BLOCKS 1
     177#define LOOKAHEAD_BLOCKS 0
    179178#define LOOKAHEAD_SIZE (BLOCK_SIZE * LOOKAHEAD_BLOCKS)
    180179#define SEGMENT_BLOCKS  16
     
    582581        // Initial file read
    583582        //////////////////////////////////////////////////////////////////////////////////////////
    584         chars_read = fread((void *)src_buffer, 1, SEGMENT_SIZE + LOOKAHEAD_SIZE, infile);
     583        chars_read = fread((void *)&src_buffer[COPYBACK_SIZE], 1, SEGMENT_SIZE + LOOKAHEAD_SIZE, infile);
    585584        remaining = chars_read;
    586585        chars_avail = chars_read;       
    587586        padding_read = chars_read - SEGMENT_SIZE;
    588 
     587int position = 0;
    589588        if (chars_avail >= SEGMENT_SIZE) chars_avail = SEGMENT_SIZE;
    590589
     
    597596          PERF_SEC_START(parser_timer);
    598597          for (int blk = 0; blk < SEGMENT_BLOCKS; blk++) {
    599                   block_base = blk*BLOCK_SIZE;
     598                  block_base = blk*BLOCK_SIZE+COPYBACK_SIZE;
    600599                  s2p_do_block((BytePack *) &src_buffer[block_base], basis_bits);
    601600
     
    607606
    608607                  @block_stmts
    609 
     608      starts[blk]=marker.starts;
     609          others[blk]=marker.others;
    610610                  //postprocess_do_block(lex, ctCDPI_Callouts, ref_Callouts, check_streams, (char *)src_buffer, buffer_base, block_base,chars_avail, tracker);
    611611
    612612          }
     613
     614                postprocess_do_block(&starts[0], &others[0], &src_buffer[COPYBACK_SIZE-position],  position, SEGMENT_BLOCKS, false);   
     615        position+=SEGMENT_BLOCKS*128;
     616
     617
    613618          PERF_SEC_END(parser_timer, chars_avail);
    614619
    615620                remaining -= SEGMENT_SIZE;
    616           memmove(src_buffer, &src_buffer[SEGMENT_SIZE], padding_read);
    617           chars_read = fread(&src_buffer[padding_read], 1, (SEGMENT_SIZE + LOOKAHEAD_SIZE - padding_read), infile);
    618 
    619                 padding_read = SEGMENT_SIZE + LOOKAHEAD_SIZE - padding_read ;//chars_read;
     621          memmove(src_buffer, &src_buffer[SEGMENT_SIZE-COPYBACK_SIZE], padding_read+COPYBACK_SIZE);
     622          chars_read = fread(&src_buffer[padding_read+COPYBACK_SIZE], 1, (SEGMENT_SIZE + LOOKAHEAD_SIZE - padding_read), infile);
     623                padding_read = chars_read-(SEGMENT_SIZE + LOOKAHEAD_SIZE - padding_read) ;//chars_read;
    620624
    621625                remaining += chars_read;
     
    635639        PERF_SEC_START(parser_timer);
    636640
    637         block_base = 0;
     641        block_base = COPYBACK_SIZE;
    638642
    639643        /* Full Blocks */
     
    685689        // buffer_pos += chars_avail;
    686690        // buffer_base = buffer_pos;
    687 postprocess_do_block(starts, others, src_buffer,  0, 1, blk==1);       
    688 if (blk>1){
    689 postprocess_do_block(&starts[1], &others[1], src_buffer,  128, blk-1, true);}
     691//postprocess_do_block(starts, others, src_buffer,  0, 1, blk==1);     
     692//if (blk>1){
     693postprocess_do_block(&starts[0], &others[0], &src_buffer[COPYBACK_SIZE-position],  position, blk, true);       
     694//}
    690695        PERF_SEC_END(parser_timer, chars_avail);
    691696}
Note: See TracChangeset for help on using the changeset viewer.