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

Commit

Permalink
Backport fixes for reordering in CUB member initializer lists into 2.…
Browse files Browse the repository at this point in the history
…0 branch

fixes #604
  • Loading branch information
ericniebler committed Apr 20, 2023
1 parent 369a2d5 commit 3f38508
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 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 @@ -99,6 +102,12 @@ function(cub_build_compiler_targets)
${cxx_compile_definitions}
)

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

# Promote warnings and display diagnostic numbers for nvcc:
target_compile_options(cub.compiler_interface INTERFACE
# If using CUDA w/ NVCC...
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 3f38508

Please sign in to comment.