Skip to content

Commit

Permalink
combine adjacent ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed May 14, 2024
1 parent c90ca4c commit cd6e3c4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cpp/src/strings/case.cu
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,9 @@ 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) {
if (mb_total > 0) {
cuda::atomic_ref<int64_t, cuda::thread_scope_block> ref{*d_output};
ref.fetch_add(mb_total, cuda::std::memory_order_relaxed);
}
if ((lane_idx == 0) && (mb_total > 0)) {
cuda::atomic_ref<int64_t, cuda::thread_scope_block> ref{*d_output};
ref.fetch_add(mb_total, cuda::std::memory_order_relaxed);
}
}

Expand Down

0 comments on commit cd6e3c4

Please sign in to comment.