Changeset 3089 for proto/parabix2


Ignore:
Timestamp:
Apr 28, 2013, 2:02:55 PM (6 years ago)
Author:
cameron
Message:

Moving transposition out of template into Pablo code; allows byte access

Location:
proto/parabix2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/pablo_template.cpp

    r3024 r3089  
    7171// @ global depends on 'error_tracker' and 'EOF_mask' definitions.
    7272//////////////////////////////////////////////////////////////////////////////////////////
     73typedef char * Bytedata;
     74
    7375@global
    7476
     
    126128}
    127129
     130
    128131void do_process(FILE *infile, FILE *outfile) {
    129132
     
    141144    int chars_avail = 0;
    142145                int chars_read  = 0;
     146    char * bytedata;
    143147
    144148    //////////////////////////////////////////////////////////////////////////////////////////
     
    146150    //////////////////////////////////////////////////////////////////////////////////////////
    147151                //      BitBlock buf[(BUFFER_SIZE)/sizeof(BitBlock)];
    148                 //      uint8_t * src_buffer = (uint8_t *)buf + COPYBACK_SIZE;
     152                //      char_t * src_buffer = (char *)buf + COPYBACK_SIZE;
    149153
    150154                #ifdef STL_ALIGNED_VECTOR
    151                         std::vector<uint8_t, AAllocator<uint8_t> > src_buffer;
     155                        std::vector<char, AAllocator<char> > src_buffer;
    152156                        src_buffer.reserve(BUFFER_SIZE);
    153157                #else
    154                         uint8_t * COPYBACK;
    155                         uint8_t * src_buffer;
     158                        char * COPYBACK;
     159                        char * src_buffer;
    156160                        ALLOC_STATIC_ALIGNED_BYTE_BUFFER_WITH_COPYBACK(COPYBACK, src_buffer);
    157161                #endif
     
    206210        if (chars_avail >= SEGMENT_SIZE) chars_avail = SEGMENT_SIZE;
    207211
     212      Transpose transpose;
    208213    @stream_stmts
    209214
     
    218223      for (int blk = 0; blk < SEGMENT_BLOCKS; blk++) {
    219224          block_base = blk*BLOCK_SIZE;
    220                   s2p_do_block((BytePack *) &src_buffer[block_base], basis_bits);
    221 
     225                  //s2p_do_block((BytePack *) &src_buffer[block_base], basis_bits);
     226          bytedata = &src_buffer[block_base];
    222227          @block_stmts
    223228
     
    255260    while (remaining >= BLOCK_SIZE) {
    256261          block_base = block_pos;
    257                                 s2p_do_block((BytePack *) &src_buffer[block_pos], basis_bits);
     262//                              s2p_do_block((BytePack *) &src_buffer[block_pos], basis_bits);
     263          bytedata = &src_buffer[block_base];
    258264          @block_stmts
    259265          tracker.StoreNewlines(lex.LF);
     
    276282#endif
    277283          EOF_mask = bitblock::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-remaining));
    278                                 s2p_do_final_block((BytePack *) &src_buffer[block_pos], basis_bits, EOF_mask);
     284//                              s2p_do_final_block((BytePack *) &src_buffer[block_pos], basis_bits, EOF_mask);
     285          bytedata = &src_buffer[block_pos];
    279286          @final_block_stmts
    280287          tracker.StoreNewlines(lex.LF);
  • proto/parabix2/parabix2_pablo.py

    r2797 r3089  
    564564     
    565565   
    566 def Main(basis_bits, lex, u8, xml_char, scope1, ctCDPI_Callouts, ref_Callouts, tag_Callouts, masks, xml_names, check_streams): 
    567        
     566def Main(bytedata, basis_bits, lex, u8, xml_char, scope1, ctCDPI_Callouts, ref_Callouts, tag_Callouts, masks, xml_names, check_streams):       
     567       
     568        Transpose(bytedata, basis_bits)
     569
    568570        # Classify bytes for UTF-8 processing, whitespace and control
    569571        # processing and XML lexical analysis.
Note: See TracChangeset for help on using the changeset viewer.