Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
seunghwak committed Feb 7, 2024
1 parent c5f556a commit d44c868
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions cpp/src/prims/detail/prim_functors.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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<GraphViewType::is_storage_transposed, typename GraphViewType::vertex_type, key_t> key_or_src{};
std::conditional_t<GraphViewType::is_storage_transposed, key_t, typename GraphViewType::vertex_type> key_or_dst{};
std::conditional_t<GraphViewType::is_storage_transposed,
typename GraphViewType::vertex_type,
key_t>
key_or_src{};
std::conditional_t<GraphViewType::is_storage_transposed,
key_t,
typename GraphViewType::vertex_type>
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),
Expand All @@ -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<key_t, typename GraphViewType::vertex_type>) {
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<GraphViewType::is_storage_transposed, typename GraphViewType::vertex_type, key_t> key_or_src{};
std::conditional_t<GraphViewType::is_storage_transposed, key_t, typename GraphViewType::vertex_type> key_or_dst{};
std::conditional_t<GraphViewType::is_storage_transposed,
typename GraphViewType::vertex_type,
key_t>
key_or_src{};
std::conditional_t<GraphViewType::is_storage_transposed,
key_t,
typename GraphViewType::vertex_type>
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),
Expand Down

0 comments on commit d44c868

Please sign in to comment.