From ae24cae249a1f39395e83b47a1f9a885d64fe6c3 Mon Sep 17 00:00:00 2001 From: Serhii Yaskovets <yaskovet@mpi-cbg.de> Date: Wed, 2 Aug 2023 18:39:10 +0200 Subject: [PATCH] Fix template substitution failure for Graph_CSR with no edge --- src/memory_ly/memory_conf.hpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/memory_ly/memory_conf.hpp b/src/memory_ly/memory_conf.hpp index 7394049a..6a588036 100644 --- a/src/memory_ly/memory_conf.hpp +++ b/src/memory_ly/memory_conf.hpp @@ -257,13 +257,27 @@ struct memory_traits_lin * \return a reference to the object selected * */ - template<unsigned int p, typename data_type, typename g1_type, typename key_type> + template<unsigned int p, typename data_type, typename g1_type, typename key_type, typename std::enable_if<!std::is_same<data_type, memory_c<boost::fusion::vector<>, 1, memory>>::value,int>::type = 0> __host__ __device__ static inline auto get(data_type & data_, const g1_type & g1, const key_type & v1) -> decltype(boost::fusion::at_c<p>(data_.mem_r.operator[](g1.LinId(v1)))) & { return boost::fusion::at_c<p>(data_.mem_r.operator[](g1.LinId(v1))); } + /*! \brief Return a reference to the selected element. + * SFINAE is used to hande CSR graphs, where boost::fusion::at_c<p>(boost::fusion::vector<>) breaks in boost 1.8* onwards + * + * \param data object from where to take the element + * \param g1 grid information + * \param v1 element id + * + * \return a reference to the object selected + * + */ + template<unsigned int p, typename data_type, typename g1_type, typename key_type, typename std::enable_if<std::is_same<data_type, memory_c<boost::fusion::vector<>, 1, memory>>::value,int>::type = 0> + __host__ __device__ static inline void get(data_type & data_, const g1_type & g1, const key_type & v1) {} + /*! \brief Return a reference to the selected element + * SFINAE is used to hande CSR graphs, where boost::fusion::at_c<p>(boost::fusion::vector<>) breaks in boost 1.8* onwards * * \param data object from where to take the element * \param g1 grid information -- GitLab