Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #582 from senior-zero/fix-main/github/reorder
Browse files Browse the repository at this point in the history
Fix reordering in CUB member initializer lists
  • Loading branch information
gevtushenko authored Oct 18, 2022
2 parents 1fc34df + fd6df92 commit e0fe848
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions cmake/CubBuildCompilerTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
function(cub_build_compiler_targets)
set(cxx_compile_definitions)
set(cxx_compile_options)
set(cuda_compile_options)

if ("MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
append_option_if_available("/W4" cxx_compile_options)
Expand Down Expand Up @@ -38,6 +39,8 @@ function(cub_build_compiler_targets)
# Some tests require /bigobj to fit everything into their object files:
append_option_if_available("/bigobj" cxx_compile_options)
else()
append_option_if_available("-Wreorder" cuda_compile_options)

append_option_if_available("-Werror" cxx_compile_options)
append_option_if_available("-Wall" cxx_compile_options)
append_option_if_available("-Wextra" cxx_compile_options)
Expand Down Expand Up @@ -94,6 +97,12 @@ function(cub_build_compiler_targets)
)
endforeach()

foreach (cuda_option IN LISTS cuda_compile_options)
target_compile_options(cub.compiler_interface INTERFACE
$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:${cuda_option}>
)
endforeach()

# Add these for both CUDA and CXX targets:
target_compile_definitions(cub.compiler_interface INTERFACE
${cxx_compile_definitions}
Expand Down
4 changes: 2 additions & 2 deletions cub/agent/agent_histogram.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -695,12 +695,12 @@ struct AgentHistogram
:
temp_storage(temp_storage.Alias()),
d_wrapped_samples(d_samples),
d_native_samples(NativePointer(d_wrapped_samples)),
num_output_bins(num_output_bins),
num_privatized_bins(num_privatized_bins),
d_output_histograms(d_output_histograms),
privatized_decode_op(privatized_decode_op),
output_decode_op(output_decode_op),
d_native_samples(NativePointer(d_wrapped_samples)),
privatized_decode_op(privatized_decode_op),
prefer_smem((MEM_PREFERENCE == SMEM) ?
true : // prefer smem privatized histograms
(MEM_PREFERENCE == GMEM) ?
Expand Down
4 changes: 2 additions & 2 deletions cub/agent/agent_select_if.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ struct AgentSelectIf
:
temp_storage(temp_storage.Alias()),
d_in(d_in),
d_flags_in(d_flags_in),
d_selected_out(d_selected_out),
select_op(select_op),
d_flags_in(d_flags_in),
inequality_op(equality_op),
select_op(select_op),
num_items(num_items)
{}

Expand Down
2 changes: 1 addition & 1 deletion cub/block/block_exchange.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,8 @@ public:
:
temp_storage(PrivateStorage()),
linear_tid(RowMajorTid(BLOCK_DIM_X, BLOCK_DIM_Y, BLOCK_DIM_Z)),
warp_id((WARPS == 1) ? 0 : linear_tid / WARP_THREADS),
lane_id(LaneId()),
warp_id((WARPS == 1) ? 0 : linear_tid / WARP_THREADS),
warp_offset(warp_id * WARP_TIME_SLICED_ITEMS)
{}

Expand Down
8 changes: 4 additions & 4 deletions cub/device/dispatch/dispatch_radix_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1921,9 +1921,9 @@ struct DispatchSegmentedRadixSort :
d_end_offsets(d_end_offsets),
begin_bit(begin_bit),
end_bit(end_bit),
is_overwrite_okay(is_overwrite_okay),
stream(stream),
ptx_version(ptx_version)
ptx_version(ptx_version),
is_overwrite_okay(is_overwrite_okay)
{}

CUB_DETAIL_RUNTIME_DEBUG_SYNC_IS_NOT_SUPPORTED
Expand Down Expand Up @@ -1954,9 +1954,9 @@ struct DispatchSegmentedRadixSort :
d_end_offsets(d_end_offsets),
begin_bit(begin_bit),
end_bit(end_bit),
is_overwrite_okay(is_overwrite_okay),
stream(stream),
ptx_version(ptx_version)
ptx_version(ptx_version),
is_overwrite_okay(is_overwrite_okay)
{
CUB_DETAIL_RUNTIME_DEBUG_SYNC_USAGE_LOG
}
Expand Down

0 comments on commit e0fe848

Please sign in to comment.