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

Commit

Permalink
Better static assert message
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed May 20, 2023
1 parent 0bb2e59 commit e1ea3c9
Showing 1 changed file with 48 additions and 16 deletions.
64 changes: 48 additions & 16 deletions cub/device/device_radix_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

// We cast away const-ness, but will *not* write to these arrays.
// `DispatchRadixSort::Dispatch` will allocate temporary storage and
Expand Down Expand Up @@ -639,7 +641,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

// We cast away const-ness, but will *not* write to these arrays.
// `DispatchRadixSort::Dispatch` will allocate temporary storage and
Expand Down Expand Up @@ -941,7 +945,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

constexpr bool is_overwrite_okay = true;
constexpr bool is_descending = false;
Expand Down Expand Up @@ -1082,7 +1088,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

constexpr bool is_overwrite_okay = true;
constexpr bool is_descending = false;
Expand Down Expand Up @@ -1395,7 +1403,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

// We cast away const-ness, but will *not* write to these arrays.
// `DispatchRadixSort::Dispatch` will allocate temporary storage and
Expand Down Expand Up @@ -1530,7 +1540,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

// We cast away const-ness, but will *not* write to these arrays.
// `DispatchRadixSort::Dispatch` will allocate temporary storage and
Expand Down Expand Up @@ -1827,7 +1839,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

constexpr bool is_overwrite_okay = true;
constexpr bool is_descending = true;
Expand Down Expand Up @@ -1968,7 +1982,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

constexpr bool is_overwrite_okay = true;
constexpr bool is_descending = true;
Expand Down Expand Up @@ -2232,7 +2248,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

// We cast away const-ness, but will *not* write to these arrays.
// `DispatchRadixSort::Dispatch` will allocate temporary storage and
Expand Down Expand Up @@ -2356,7 +2374,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

// We cast away const-ness, but will *not* write to these arrays.
// `DispatchRadixSort::Dispatch` will allocate temporary storage and
Expand Down Expand Up @@ -2656,7 +2676,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

constexpr bool is_overwrite_okay = true;
constexpr bool is_descending = false;
Expand Down Expand Up @@ -2785,7 +2807,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

constexpr bool is_overwrite_okay = true;
constexpr bool is_descending = false;
Expand Down Expand Up @@ -3065,7 +3089,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

// We cast away const-ness, but will *not* write to these arrays.
// `DispatchRadixSort::Dispatch` will allocate temporary storage and
Expand Down Expand Up @@ -3186,7 +3212,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

// We cast away const-ness, but will *not* write to these arrays.
// `DispatchRadixSort::Dispatch` will allocate temporary storage and
Expand Down Expand Up @@ -3453,7 +3481,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

constexpr bool is_overwrite_okay = true;
constexpr bool is_descending = true;
Expand Down Expand Up @@ -3582,7 +3612,9 @@ public:
using offset_t = typename detail::ChooseOffsetT<NumItemsT>::Type;
using decomposer_check_t = detail::radix::decomposer_check_t<KeyT, DecomposerT>;

static_assert(decomposer_check_t::value, "DecomposerT must be a functor");
static_assert(decomposer_check_t::value,
"DecomposerT must be a callable object returning a tuple of references to "
"arithmetic types");

constexpr bool is_overwrite_okay = true;
constexpr bool is_descending = true;
Expand Down

0 comments on commit e1ea3c9

Please sign in to comment.