From e407ac6b8447d9e5ef29f7c1356d8c9461083680 Mon Sep 17 00:00:00 2001 From: Naim Date: Wed, 29 May 2024 18:51:45 +0200 Subject: [PATCH] Check if value_t is thrust tuple of integral --- cpp/include/cugraph/src_dst_lookup_container.hpp | 2 +- .../cugraph/utilities/thrust_tuple_utils.hpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cpp/include/cugraph/src_dst_lookup_container.hpp b/cpp/include/cugraph/src_dst_lookup_container.hpp index 5f05067b11b..bed00d849e7 100644 --- a/cpp/include/cugraph/src_dst_lookup_container.hpp +++ b/cpp/include/cugraph/src_dst_lookup_container.hpp @@ -61,7 +61,7 @@ class search_container_t { static_assert(std::is_integral_v); static_assert(std::is_integral_v); - static_assert(is_arithmetic_or_thrust_tuple_of_arithmetic::value); + static_assert(is_thrust_tuple_of_integral::value); ~search_container_t(); search_container_t(); diff --git a/cpp/include/cugraph/utilities/thrust_tuple_utils.hpp b/cpp/include/cugraph/utilities/thrust_tuple_utils.hpp index 304a5b94bd6..2c36ed33359 100644 --- a/cpp/include/cugraph/utilities/thrust_tuple_utils.hpp +++ b/cpp/include/cugraph/utilities/thrust_tuple_utils.hpp @@ -113,6 +113,19 @@ struct is_thrust_tuple_of_arithmetic> { static constexpr bool value = (... && is_valid); }; +template +struct is_thrust_tuple_of_integral : std::false_type {}; + +template +struct is_thrust_tuple_of_integral> { + private: + template + static constexpr bool is_valid = std::is_integral_v || std::is_same_v; + + public: + static constexpr bool value = (... && is_valid); +}; + template struct is_std_tuple : std::false_type {};