37 template <
typename string_type>
48 const string_type _string)
63 const uint32 word = g / 32u;
64 const uint32 bit = g & 31u;
66 atomicOr(
qgroup.
I + word, 1u << bit );
76 template <
typename string_type>
89 const string_type _string)
102 const uint64 g = qgram(p);
122 template <
typename string_type>
135 const string_type _string)
148 const uint64 g = qgram(p);
177 template <
typename string_type>
182 const string_type
string)
188 thrust::device_vector<uint8> d_temp_storage;
197 for (
uint32 i = 0; i < q; ++i)
198 n_max_qgrams *= ALPHABET_SIZE;
202 I.resize( n_qblocks+1 );
203 S.resize( n_qblocks+1 );
212 I.begin() + n_qblocks + 1u,
219 thrust::make_counting_iterator<uint32>(0),
220 thrust::make_counting_iterator<uint32>(0) + string_len,
232 thrust::plus<uint32>(),
242 SS.resize( n_unique_qgrams + 1u );
246 SS.begin() + n_unique_qgrams + 1u,
252 thrust::make_counting_iterator<uint32>(0),
253 thrust::make_counting_iterator<uint32>(0) + string_len,
258 n_unique_qgrams + 1u,
261 thrust::plus<uint32>(),
268 P.resize( string_len );
271 thrust::device_vector<uint32> SS_copy(
SS );
276 thrust::make_counting_iterator<uint32>(0),
277 thrust::make_counting_iterator<uint32>(0) + string_len,
284 if (n_slots != string_len)
285 throw runtime_error(
"mismatching number of q-grams: inserted %u q-grams, got: %u\n" );