Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes a performance regression in FST #13850

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cpp/src/io/fst/agent_dfa.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,24 @@ class DFASimulationCallbackWrapper {
SymbolT const read_symbol)
{
uint32_t const count = transducer_table(old_state, symbol_id, read_symbol);
#if __CUDA_ARCH__ > 0
elstehle marked this conversation as resolved.
Show resolved Hide resolved
if (write) {
#pragma unroll 1
for (uint32_t out_char = 0; out_char < count; out_char++) {
out_it[out_count + out_char] =
transducer_table(old_state, symbol_id, out_char, read_symbol);
out_idx_it[out_count + out_char] = offset + character_index;
}
}
#else
if (write) {
for (uint32_t out_char = 0; out_char < count; out_char++) {
out_it[out_count + out_char] =
transducer_table(old_state, symbol_id, out_char, read_symbol);
out_idx_it[out_count + out_char] = offset + character_index;
}
}
#endif
out_count += count;
}

Expand Down