MCPcopy Create free account
hub / github.com/apache/arrow / FindImp

Method FindImp

cpp/src/arrow/acero/bloom_filter.cc:149–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147
148template <typename T>
149void BlockedBloomFilter::FindImp(int64_t num_rows, const T* hashes,
150 uint8_t* result_bit_vector, bool enable_prefetch) const {
151 int64_t num_processed = 0;
152 uint64_t bits = 0ULL;
153
154 if (enable_prefetch && UsePrefetch()) {
155 constexpr int kPrefetchIterations = 16;
156 for (int64_t i = 0; i < num_rows - kPrefetchIterations; ++i) {
157 ARROW_PREFETCH(blocks_ + block_id(hashes[i + kPrefetchIterations]));
158 uint64_t result = Find(hashes[i]) ? 1ULL : 0ULL;
159 bits |= result << (i & 63);
160 if ((i & 63) == 63) {
161 reinterpret_cast<uint64_t*>(result_bit_vector)[i / 64] = bits;
162 bits = 0ULL;
163 }
164 }
165 num_processed = num_rows - kPrefetchIterations;
166 }
167
168 for (int64_t i = num_processed; i < num_rows; ++i) {
169 uint64_t result = Find(hashes[i]) ? 1ULL : 0ULL;
170 bits |= result << (i & 63);
171 if ((i & 63) == 63) {
172 reinterpret_cast<uint64_t*>(result_bit_vector)[i / 64] = bits;
173 bits = 0ULL;
174 }
175 }
176
177 for (int i = 0; i < bit_util::CeilDiv(num_rows % 64, 8); ++i) {
178 result_bit_vector[num_rows / 64 * 8 + i] = static_cast<uint8_t>(bits >> (i * 8));
179 }
180}
181
182void BlockedBloomFilter::Find(int64_t hardware_flags, int64_t num_rows,
183 const uint32_t* hashes, uint8_t* result_bit_vector,

Callers

nothing calls this directly

Calls 4

UsePrefetchFunction · 0.85
block_idFunction · 0.85
CeilDivFunction · 0.85
FindFunction · 0.70

Tested by

no test coverage detected