Skip to content
Snippets Groups Projects
Commit 69ff97de authored by yaskovet's avatar yaskovet
Browse files

Fix template substitution failure for Graph_CSR with no edge (get_lin)

parent ae24cae2
No related branches found
No related tags found
No related merge requests found
...@@ -249,6 +249,7 @@ struct memory_traits_lin ...@@ -249,6 +249,7 @@ struct memory_traits_lin
typedef boost::mpl::int_<AOS_layout> type_value; typedef boost::mpl::int_<AOS_layout> type_value;
/*! \brief Return a reference to the selected element /*! \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 data object from where to take the element
* \param g1 grid information * \param g1 grid information
...@@ -286,13 +287,14 @@ struct memory_traits_lin ...@@ -286,13 +287,14 @@ struct memory_traits_lin
* \return a reference to the object selected * \return a reference to the object selected
* *
*/ */
template<unsigned int p, typename data_type, typename g1_type> template<unsigned int p, typename data_type, typename g1_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_lin(data_type & data_, const g1_type & g1, const size_t lin_id) -> decltype(boost::fusion::at_c<p>(data_.mem_r.operator[](lin_id))) & __host__ __device__ static inline auto get_lin(data_type & data_, const g1_type & g1, const size_t lin_id) -> decltype(boost::fusion::at_c<p>(data_.mem_r.operator[](lin_id))) &
{ {
return boost::fusion::at_c<p>(data_.mem_r.operator[](lin_id)); return boost::fusion::at_c<p>(data_.mem_r.operator[](lin_id));
} }
/*! \brief Return a reference to the selected element /*! \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 data object from where to take the element
* \param g1 grid information * \param g1 grid information
...@@ -301,7 +303,19 @@ struct memory_traits_lin ...@@ -301,7 +303,19 @@ struct memory_traits_lin
* \return a reference to the object selected * \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 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_lin(data_type & data_, const g1_type & g1, const size_t lin_id) {}
/*! \brief Return a reference to the selected element
*
* \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 auto get_c(const data_type & data_, const g1_type & g1, const key_type & v1) -> decltype(boost::fusion::at_c<p>(data_.mem_r.operator[](g1.LinId(v1)))) & __host__ __device__ static inline auto get_c(const 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))); return boost::fusion::at_c<p>(data_.mem_r.operator[](g1.LinId(v1)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment