graph
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
edge_tc.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
7 #include <vector>
8 #include <iostream>
9 #include <cuda_runtime.h>
10 
12 
14 {
15 private:
16  enum class Kernel
17  {
18  LINEAR,
19  BINARY
20  };
21 
22 private:
24 
25  // partitioned data structures
26  std::vector<UnifiedMemoryCSR> graphs_;
27  std::vector<CUDAManagedVector<Uint>> edgeSrc_;
28 
29  // per-block triangle counts for each partition
30  std::vector<CUDAManagedVector<uint64_t>> triangleCounts_;
31 
32  // per-partition device pointers (csr structure)
33  std::vector<const Uint *> rowOffsets_d_;
34  std::vector<const Uint *> cols_d_;
35  std::vector<const char *> isLocalCol_d_;
36 
37  // additional nnz-sized data for edge sources
38  std::vector<const Uint *> rows_d_;
39 
40  std::vector<uint64_t *> triangleCounts_d_;
41 
42  size_t numEdges_; // edges in input graph
43  size_t numNodes_; // nodes in input graph
44 
45 public:
46  EdgeTC(Config &c);
47  virtual ~EdgeTC();
48  virtual void read_data(const std::string &path) override;
49  virtual void setup_data() override;
50  virtual size_t count() override;
51  virtual uint64_t num_edges() override { return numEdges_; }
52  virtual size_t num_nodes() { return numNodes_; }
53 };
54 
virtual size_t num_nodes()
Definition: edge_tc.hpp:52
size_t numNodes_
Definition: edge_tc.hpp:43
size_t numEdges_
Definition: edge_tc.hpp:42
Kernel kernel_
Definition: edge_tc.hpp:23
Kernel
Definition: edge_tc.hpp:16
virtual uint64_t num_edges() override
number of edges traversed during triangle counting
Definition: edge_tc.hpp:51
Definition: edge_tc.hpp:13
std::vector< const Uint * > rowOffsets_d_
Definition: edge_tc.hpp:33
std::vector< UnifiedMemoryCSR > graphs_
Definition: edge_tc.hpp:26
PANGOLIN_BEGIN_NAMESPACE()
std::vector< const char * > isLocalCol_d_
Definition: edge_tc.hpp:35
std::vector< CUDAManagedVector< Uint > > edgeSrc_
Definition: edge_tc.hpp:27
Definition: cuda_triangle_counter.hpp:15
std::vector< uint64_t * > triangleCounts_d_
Definition: edge_tc.hpp:40
Definition: config.hpp:10
std::vector< CUDAManagedVector< uint64_t > > triangleCounts_
Definition: edge_tc.hpp:30
#define PANGOLIN_END_NAMESPACE()
std::vector< const Uint * > cols_d_
Definition: edge_tc.hpp:34
std::vector< const Uint * > rows_d_
Definition: edge_tc.hpp:38