Ignore:
Timestamp:
Nov 28, 2017, 1:45:19 AM (17 months ago)
Author:
nmedfort
Message:

Bug fix for segment pipeline parallel mode + memory management improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/cc/multiplex_CCs.cpp

    r5741 r5748  
    2424//
    2525
    26 std::map<UCD::codepoint_t, boost::dynamic_bitset<>> computeBreakpoints(std::vector<UCD::UnicodeSet> CCs) {
     26std::map<UCD::codepoint_t, boost::dynamic_bitset<>> computeBreakpoints(const std::vector<const re::CC *> & CCs) {
    2727    std::map<UCD::codepoint_t, boost::dynamic_bitset<>> breakpoints;
    2828    for (unsigned i = 0; i < CCs.size(); i++) {
    29         for (const UCD::UnicodeSet::interval_t & range : CCs[i]) {
    30             auto lo = re::lo_codepoint(range);
    31             auto hi = re::hi_codepoint(range);
     29        for (const auto range : *CCs[i]) {
     30            const auto lo = re::lo_codepoint(range);
     31            const auto hi = re::hi_codepoint(range);
    3232            auto f = breakpoints.find(lo);
    3333            if (f == breakpoints.end()) {
     
    4646
    4747
    48 void doMultiplexCCs(const std::vector<UCD::UnicodeSet> & CCs,
     48void doMultiplexCCs(const std::vector<const re::CC *> & CCs,
    4949                    std::vector<std::vector<unsigned>> & exclusiveSetIDs,
    50                     std::vector<UCD::UnicodeSet> & multiplexedCCs) {
     50                    std::vector<re::CC *> & multiplexedCCs) {
    5151   
    52     std::map<UCD::codepoint_t, boost::dynamic_bitset<>> breakpoints = computeBreakpoints(CCs);
     52    const auto breakpoints = computeBreakpoints(CCs);
    5353    // Initialize the exclusiveSetIDs to have one empty vector per source CC.
    5454    exclusiveSetIDs.clear();
     
    7575            for (unsigned bit = 0; bit < multiplexed_bit_count; bit++) {
    7676                if (((current_exclusive_set_idx >> bit) & 1) == 1) {
    77                     multiplexedCCs[bit].insert_range(range_lo, range_hi);
     77                    multiplexedCCs[bit]->insert_range(range_lo, range_hi);
    7878                }
    7979            }
     
    9696            if ((current_exclusive_set_idx & (current_exclusive_set_idx - 1)) == 0) {
    9797                multiplexed_bit_count++;
    98                 multiplexedCCs.push_back(UCD::UnicodeSet());
     98                multiplexedCCs.push_back(re::makeCC());
    9999            }
    100100        }
Note: See TracChangeset for help on using the changeset viewer.