diff --git a/cpp/src/prims/detail/prim_functors.cuh b/cpp/src/prims/detail/prim_functors.cuh index 13dc0648aef..d142aed1051 100644 --- a/cpp/src/prims/detail/prim_functors.cuh +++ b/cpp/src/prims/detail/prim_functors.cuh @@ -37,25 +37,32 @@ struct call_e_op_t { EdgeOp const& e_op{}; key_t key{}; typename GraphViewType::vertex_type major_offset{}; - typename GraphViewType::vertex_type const* indices{nullptr}; // indices = edge_partition.incies() + edge_offset + typename GraphViewType::vertex_type const* indices{ + nullptr}; // indices = edge_partition.incies() + edge_offset typename GraphViewType::edge_type edge_offset{}; - __device__ auto operator()(typename GraphViewType::edge_type i /* index in key's neighbor list */) const + __device__ auto operator()( + typename GraphViewType::edge_type i /* index in key's neighbor list */) const { auto minor = indices[i]; auto minor_offset = edge_partition.minor_offset_from_minor_nocheck(minor); - std::conditional_t key_or_src{}; - std::conditional_t key_or_dst{}; + std::conditional_t + key_or_src{}; + std::conditional_t + key_or_dst{}; if constexpr (GraphViewType::is_storage_transposed) { key_or_src = minor; key_or_dst = key; - } - else { + } else { key_or_src = key; key_or_dst = minor; } - auto src_offset = GraphViewType::is_storage_transposed ? minor_offset : major_offset; - auto dst_offset = GraphViewType::is_storage_transposed ? major_offset : minor_offset; + auto src_offset = GraphViewType::is_storage_transposed ? minor_offset : major_offset; + auto dst_offset = GraphViewType::is_storage_transposed ? major_offset : minor_offset; return e_op(key_or_src, key_or_dst, edge_partition_src_value_input.get(src_offset), @@ -79,30 +86,35 @@ struct call_e_op_with_key_t { EdgePartitionEdgeValueInputWrapper const& edge_partition_e_value_input{}; EdgeOp const& e_op{}; - __device__ auto operator()(key_t key, typename GraphViewType::edge_type i /* index in edge_partition's edge list */) const + __device__ auto operator()( + key_t key, typename GraphViewType::edge_type i /* index in edge_partition's edge list */) const { typename GraphViewType::vertex_type major{}; if constexpr (std::is_same_v) { major = key; - } - else { + } else { major = thrust::get<0>(key); } auto major_offset = edge_partition.major_offset_from_major_nocheck(major); auto minor = *(edge_partition.indices() + i); auto minor_offset = edge_partition.minor_offset_from_minor_nocheck(minor); - std::conditional_t key_or_src{}; - std::conditional_t key_or_dst{}; + std::conditional_t + key_or_src{}; + std::conditional_t + key_or_dst{}; if constexpr (GraphViewType::is_storage_transposed) { key_or_src = minor; key_or_dst = key; - } - else { + } else { key_or_src = key; key_or_dst = minor; } - auto src_offset = GraphViewType::is_storage_transposed ? minor_offset : major_offset; - auto dst_offset = GraphViewType::is_storage_transposed ? major_offset : minor_offset; + auto src_offset = GraphViewType::is_storage_transposed ? minor_offset : major_offset; + auto dst_offset = GraphViewType::is_storage_transposed ? major_offset : minor_offset; return e_op(key_or_src, key_or_dst, edge_partition_src_value_input.get(src_offset),