 Timestamp:
 Apr 19, 2012, 1:39:50 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/symbol_table/src/id_symbol_table.hpp
r2034 r2035 84 84 for(uint32_t blk = 0; blk < blocks; blk++) { 85 85 const uint32_t blk_offset = blk * BLOCKSIZE; 86 resolve(blk_offset, &buffer[blk_offset], groups[blk], &starts[blk], &ends_gte_17[blk],h0[blk], h1[blk], symbols);86 resolve(blk_offset, &buffer[blk_offset], groups[blk], &starts[blk], h0[blk], h1[blk], symbols); 87 87 } 88 88 } … … 90 90 // Groups & groups 91 91 IDISA_ALWAYS_INLINE 92 void resolve(uint32_t blk_offset, uint8_t buffer [], Groups groups, BitBlock starts [], BitBlock ends_gte_17[],92 void resolve(uint32_t blk_offset, uint8_t buffer [], Groups & groups, BitBlock starts[], 93 93 BitBlock h0, BitBlock h1, SYMBOL & symbols) { 94 94 … … 120 120 // Bit Space Hash 121 121 /////////////////////////////////////////////////////////////////////////////// 122 if(bitblock::any(groups.ends_8)) { 123 do_block<SYMBOL, hash_table <identity_strategy_t<uint64_t,8>, hash_strategy_d, ALLOCATOR> > 124 (blk_offset, 125 hash_table_8, 126 groups.ends_8, buffer, 8, 127 (uint8_t *)&h0, (uint8_t *)&h1, 8, BLOCK_SIZE/8, 128 symbols, this>gid_factory, this>gid_data); 129 } 130 if(bitblock::any(groups.ends_9)) { 131 do_block<SYMBOL, hash_table<identity_strategy_t<uint64_t,9>, hash_strategy_d, ALLOCATOR> > 132 (blk_offset, 133 hash_table_9, 134 groups.ends_9, buffer, 9, 135 (uint8_t *)&h0, (uint8_t *)&h1, 9, BLOCK_SIZE/8, 136 symbols, this>gid_factory, this>gid_data); 137 } 138 if(bitblock::any(groups.ends_10)) { 139 do_block<SYMBOL, hash_table<identity_strategy_t<uint64_t,10>, hash_strategy_d, ALLOCATOR> > 140 (blk_offset, 141 hash_table_10, 142 groups.ends_10, buffer, 10, 143 (uint8_t *)&h0, (uint8_t *)&h1, 10, BLOCK_SIZE/8, 144 symbols, this>gid_factory, this>gid_data); 145 } 146 if(bitblock::any(groups.ends_11)) { 147 do_block<SYMBOL, hash_table<identity_strategy_t<uint64_t,11>, hash_strategy_d, ALLOCATOR> > 148 (blk_offset, 149 hash_table_11, 150 groups.ends_11, buffer, 11, 151 (uint8_t *)&h0, (uint8_t *)&h1, 11, BLOCK_SIZE/8, 152 symbols, this>gid_factory, this>gid_data); 153 } 154 if(bitblock::any(groups.ends_12)) { 155 do_block<SYMBOL, hash_table<identity_strategy_t<uint64_t,12>, hash_strategy_d, ALLOCATOR> > 156 (blk_offset, 157 hash_table_12, 158 groups.ends_12, buffer, 12, 159 (uint8_t *)&h0, (uint8_t *)&h1, 12, BLOCK_SIZE/8, 160 symbols, this>gid_factory, this>gid_data); 161 } 162 if(bitblock::any(groups.ends_13)) { 163 do_block<SYMBOL, hash_table<identity_strategy_t<uint64_t,13>, hash_strategy_d, ALLOCATOR> > 164 (blk_offset, 165 hash_table_13, 166 groups.ends_13, buffer, 13, 167 (uint8_t *)&h0, (uint8_t *)&h1, 13, BLOCK_SIZE/8, 168 symbols, this>gid_factory, this>gid_data); 169 } 170 if(bitblock::any(groups.ends_14)) { 171 do_block<SYMBOL, hash_table<identity_strategy_t<uint64_t,14>, hash_strategy_d, ALLOCATOR> > 172 (blk_offset, 173 hash_table_14, 174 groups.ends_14, buffer, 14, 175 (uint8_t *)&h0, (uint8_t *)&h1, 14, BLOCK_SIZE/8, 176 symbols, this>gid_factory, this>gid_data); 177 } 178 if(bitblock::any(groups.ends_15)) { 179 do_block<SYMBOL, hash_table<identity_strategy_t<uint64_t,15>, hash_strategy_d, ALLOCATOR> > 180 (blk_offset, 181 hash_table_15, 182 groups.ends_15, buffer, 15, 183 (uint8_t *)&h0, (uint8_t *)&h1, 15, BLOCK_SIZE/8, 184 symbols, this>gid_factory, this>gid_data); 185 } 186 if(bitblock::any(groups.ends_16)) { 187 do_block<SYMBOL, hash_table<identity_strategy_t<BitBlock,16>, hash_strategy_d, ALLOCATOR> > 188 (blk_offset, 189 hash_table_16, 190 groups.ends_16, buffer, 16, 191 (uint8_t *)&h0, (uint8_t *)&h1, 16, BLOCK_SIZE/8, 192 symbols, this>gid_factory, this>gid_data); 193 } 122 #define BIT_HASH(LENGTH_GROUP, COMPARISON_TYPE) \ 123 if(bitblock::any(groups.ends_##LENGTH_GROUP)) { \ 124 do_block<SYMBOL, hash_table <identity_strategy_t<COMPARISON_TYPE, LENGTH_GROUP>, hash_strategy_d, ALLOCATOR> > \ 125 (blk_offset, \ 126 hash_table_##LENGTH_GROUP, \ 127 groups.ends_##LENGTH_GROUP, \ 128 buffer, LENGTH_GROUP, \ 129 (uint8_t *)&h0, (uint8_t *)&h1, LENGTH_GROUP, (BLOCK_SIZE / 8), \ 130 symbols, this>gid_factory, this>gid_data); \ 131 } 132 133 BIT_HASH(8, uint64_t); 134 BIT_HASH(9, uint64_t); 135 BIT_HASH(10, uint64_t); 136 BIT_HASH(11, uint64_t); 137 BIT_HASH(12, uint64_t); 138 BIT_HASH(13, uint64_t); 139 BIT_HASH(14, uint64_t); 140 BIT_HASH(15, uint64_t); 141 BIT_HASH(16, BitBlock); 142 143 #undef BIT_HASH 144 194 145 if(bitblock::any(groups.ends_gte_17)) { 195 146 do_block<SYMBOL, hash_table<identity_strategy_d, hash_strategy_d, ALLOCATOR> > 196 147 (blk_offset, 197 148 hash_table_gte_17, 198 starts, ends_gte_17,149 starts, &groups.ends_gte_17, 199 150 buffer, 200 151 (uint8_t *)&h0, (uint8_t *)&h1, 17, BLOCK_SIZE/8, 201 152 symbols, this>gid_factory, this>gid_data); 202 153 } 154 155 std::cout << "GID max: " << this>gid_data.max() << std::endl; 203 156 } 204 157 … … 266 219 } 267 220 221 assert (spos >= 0); 222 268 223 gid = h_table.lookup_or_insert(buffer_base, spos, lgth, h0_base, h1_base, h_lgth, gid_factory, gid_data); // WARNING: spos must be >= 0 224 225 #ifdef ID_SYMBOL_STORE_SYMBOL_GIDS_AT_END_POSITION 226 symbols.gids[blk_offset + epos] = gid; 227 #else 269 228 symbols.gids[blk_offset + epos  lgth] = gid; 229 #endif 270 230 271 231 #ifdef ID_SYMBOL_TABLE_TEMPLATE_HPP_DEBUG … … 289 249 SYMBOL & symbols, GIDFactory & gid_factory, GIDData & gid_data) { 290 250 291 292 293 251 BitBlock * starts_base = starts; 294 252 uint8_t * buffer_base = buffer; 295 253 uint8_t * h0_base = h0; 296 254 uint8_t * h1_base = h1; … … 340 298 341 299 gid = h_table.lookup_or_insert(buffer_base, spos, lgth, h0_base, h1_base, h_lgth, gid_factory, gid_data); // WARNING: spos must be >= 0 300 301 #ifdef ID_SYMBOL_STORE_SYMBOL_GIDS_AT_END_POSITION 302 symbols.gids[blk_offset + epos] = gid; 303 #else 342 304 symbols.gids[blk_offset + epos  lgth] = gid; 305 #endif 343 306 344 307 #ifdef ID_SYMBOL_TABLE_TEMPLATE_HPP_DEBUG
Note: See TracChangeset
for help on using the changeset viewer.