Skip to content

Commit

Permalink
Check if value_t is thrust tuple of integral
Browse files Browse the repository at this point in the history
  • Loading branch information
Naim committed May 29, 2024
1 parent 222a1e2 commit e407ac6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/include/cugraph/src_dst_lookup_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class search_container_t {

static_assert(std::is_integral_v<edge_id_t>);
static_assert(std::is_integral_v<edge_type_t>);
static_assert(is_arithmetic_or_thrust_tuple_of_arithmetic<value_t>::value);
static_assert(is_thrust_tuple_of_integral<value_t>::value);

~search_container_t();
search_container_t();
Expand Down
13 changes: 13 additions & 0 deletions cpp/include/cugraph/utilities/thrust_tuple_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ struct is_thrust_tuple_of_arithmetic<thrust::tuple<Ts...>> {
static constexpr bool value = (... && is_valid<Ts>);
};

template <typename TupleType>
struct is_thrust_tuple_of_integral : std::false_type {};

template <typename... Ts>
struct is_thrust_tuple_of_integral<thrust::tuple<Ts...>> {
private:
template <typename T>
static constexpr bool is_valid = std::is_integral_v<T> || std::is_same_v<T, thrust::null_type>;

public:
static constexpr bool value = (... && is_valid<Ts>);
};

template <typename T>
struct is_std_tuple : std::false_type {};

Expand Down

0 comments on commit e407ac6

Please sign in to comment.