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

Fix atomic_ref scope when multiple blocks are updating the same output #16051

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion cpp/src/strings/case.cu
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ CUDF_KERNEL void has_multibytes_kernel(char const* d_input_chars,
auto const mb_total = block_reduce(temp_storage).Reduce(mb_count, cub::Sum());

if ((lane_idx == 0) && (mb_total > 0)) {
cuda::atomic_ref<int64_t, cuda::thread_scope_block> ref{*d_output};
cuda::atomic_ref<int64_t, cuda::thread_scope_device> ref{*d_output};
ref.fetch_add(mb_total, cuda::std::memory_order_relaxed);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/strings/replace/multi.cu
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ CUDF_KERNEL void count_targets(replace_multi_parallel_fn fn, int64_t chars_bytes
auto const total = block_reduce(temp_storage).Reduce(count, cub::Sum());

if ((lane_idx == 0) && (total > 0)) {
cuda::atomic_ref<int64_t, cuda::thread_scope_block> ref{*d_output};
cuda::atomic_ref<int64_t, cuda::thread_scope_device> ref{*d_output};
ref.fetch_add(total, cuda::std::memory_order_relaxed);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/strings/split/split.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ CUDF_KERNEL void count_delimiters_kernel(Tokenizer tokenizer,
auto const total = block_reduce(temp_storage).Reduce(count, cub::Sum());

if ((lane_idx == 0) && (total > 0)) {
cuda::atomic_ref<int64_t, cuda::thread_scope_block> ref{*d_output};
cuda::atomic_ref<int64_t, cuda::thread_scope_device> ref{*d_output};
ref.fetch_add(total, cuda::std::memory_order_relaxed);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/text/tokenize.cu
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ CUDF_KERNEL void count_characters(uint8_t const* d_chars, int64_t chars_bytes, i
auto const total = block_reduce(temp_storage).Reduce(count, cub::Sum());

if ((lane_idx == 0) && (total > 0)) {
cuda::atomic_ref<int64_t, cuda::thread_scope_block> ref{*d_output};
cuda::atomic_ref<int64_t, cuda::thread_scope_device> ref{*d_output};
ref.fetch_add(total, cuda::std::memory_order_relaxed);
}
}
Expand Down
Loading