Skip to content

Commit

Permalink
Address review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed May 20, 2023
1 parent 38f2e32 commit d428ad3
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 10 deletions.
31 changes: 24 additions & 7 deletions cub/device/dispatch/dispatch_radix_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1145,16 +1145,33 @@ struct DeviceRadixSortPolicy
* Single-problem dispatch
******************************************************************************/

// TODO State that `DecomposerT` is an implementation detail

/**
* Utility class for dispatching the appropriately-tuned kernels for device-wide radix sort
*
* @tparam IS_DESCENDING
* Whether or not the sorted-order is high-to-low
*
* @tparam KeyT
* Key type
*
* @tparam ValueT
* Value type
*
* @tparam OffsetT
* Signed integer type for global offsets
*
* @tparam DecomposerT
* Implementation detail, do not specify directly, requirements on the
* content of this type are subject to breaking change.
*/
template <
bool IS_DESCENDING, ///< Whether or not the sorted-order is high-to-low
typename KeyT, ///< Key type
typename ValueT, ///< Value type
typename OffsetT, ///< Signed integer type for global offsets
typename SelectedPolicy = DeviceRadixSortPolicy<KeyT, ValueT, OffsetT>,
typename DecomposerT = detail::fundamental_decomposer_t>
template <bool IS_DESCENDING,
typename KeyT,
typename ValueT,
typename OffsetT,
typename SelectedPolicy = DeviceRadixSortPolicy<KeyT, ValueT, OffsetT>,
typename DecomposerT = detail::fundamental_decomposer_t>
struct DispatchRadixSort : SelectedPolicy
{
//------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions examples/device/example_device_radix_sort_custom.cu
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*
******************************************************************************/

#include <cuda/std/tuple>
#include <cub/device/device_radix_sort.cuh>

#include <bitset>
Expand Down
2 changes: 1 addition & 1 deletion test/catch2_test_block_radix_sort.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* Copyright (c) 2011-2022, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down
2 changes: 1 addition & 1 deletion test/catch2_test_block_radix_sort_custom.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* Copyright (c) 2011-2022, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down
27 changes: 27 additions & 0 deletions test/catch2_test_radix_operations.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/******************************************************************************
* Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the NVIDIA CORPORATION nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/

#include <cub/block/radix_rank_sort_operations.cuh>

#include <thrust/detail/raw_pointer_cast.h>
Expand Down
2 changes: 1 addition & 1 deletion test/test_device_radix_sort.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ void TestUnspecifiedRanges()
#if TEST_KEY_BYTES == 4
// Following tests check that new decomposer API doesn't break old API.
// It's disabled because some compilers don't like implicit conversions, which
// is required for the test. Once we figure out how to temporarely enable conversion, we can
// is required for the test. Once we figure out how to temporarily enable conversion, we can
// re-enable the test.
#define ENABLING_CONVERSION_IS_FIGURED_OUT 0
#if ENABLING_CONVERSION_IS_FIGURED_OUT
Expand Down

0 comments on commit d428ad3

Please sign in to comment.