File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -460,15 +460,11 @@ class ColumnMatrix {
460460 std::vector<size_t > k_offsets (n_threads + 1 , 0 ); // offsets of non-zero elements for each thread
461461 // k_offsets[0] = 0;
462462 // k_offsets[tid] - starting offset of non-zero elements processed by thread tid
463- size_t block_size = DivRoundUp (batch_size, n_threads) ;
463+ const auto word32size = MissingIndicator::BitFieldT:: kValueSize ;
464464
465- /*
466- * We use bitfield as a missing indicator. To ensure thread safe access to the bitfield
467- * each underlying word of the bitfiled should be processed by a single thread.
468- * So we need to align the row-blocks.
469- */
470- block_size = DivRoundUp (block_size, MissingIndicator::BitFieldT::kValueSize ) *
471- MissingIndicator::BitFieldT::kValueSize ;
465+ size_t block_size = DivRoundUp (batch_size, n_threads); // preliminary block size
466+ // align block_size to be multiple of kValueSize, so that each thread processes full words in the bitfield
467+ block_size = DivRoundUp (block_size, word32size) * word32size;
472468 /*
473469 * To prevent race conditions on the bitfield, we ensure each thread operates on
474470 * distinct 32-bit words. If a data batch (starting at `base_rowid`) doesn't align
You can’t perform that action at this time.
0 commit comments