Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4b4536

Browse files
committed
updated hetero_traversal benchmark
1 parent 5fb9ddc commit d4b4536

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

benchmarks/hetero_traversal/main.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ int main(int argc, char* argv[]) {
4646

4747
for(int i=10; i<=10000; i += 500) {
4848

49-
double runtime {0.0};
50-
5149
Graph graph(i, 4*i, cuda_ratio);
5250

5351
//std::ofstream ofs(std::string("graph") + std::to_string(graph.size()) + ".txt");
5452
//graph.dump(ofs);
5553
//continue;
5654

55+
double runtime {0.0};
56+
5757
for(unsigned j=0; j<num_rounds; ++j) {
5858
if(model == "tf") {
5959
runtime += measure_time_taskflow(graph, num_threads, num_gpus).count();

benchmarks/hetero_traversal/omp.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ void omp(const Graph& g, unsigned num_cpus, unsigned num_gpus) {
8989
int* gx = nullptr;
9090
int* gy = nullptr;
9191
int* gz = nullptr;
92-
TF_CHECK_CUDA(cudaMalloc(&gx, N*sizeof(int)), "failed at cudaMalloc");
93-
TF_CHECK_CUDA(cudaMalloc(&gy, N*sizeof(int)), "failed at cudaMalloc");
94-
TF_CHECK_CUDA(cudaMalloc(&gz, N*sizeof(int)), "failed at cudaMalloc");
92+
TF_CHECK_CUDA(cudaMallocManaged(&gx, N*sizeof(int)), "failed at cudaMallocManaged");
93+
TF_CHECK_CUDA(cudaMallocManaged(&gy, N*sizeof(int)), "failed at cudaMallocManaged");
94+
TF_CHECK_CUDA(cudaMallocManaged(&gz, N*sizeof(int)), "failed at cudaMallocManaged");
9595

9696
for(size_t l=0; l<levellist.size(); ++l) {
9797
#pragma omp parallel for num_threads(num_cpus + num_gpus)

benchmarks/hetero_traversal/taskflow.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ void taskflow(const Graph& g, unsigned num_cpus, unsigned num_gpus) {
1212
int* gx = nullptr;
1313
int* gy = nullptr;
1414
int* gz = nullptr;
15-
TF_CHECK_CUDA(cudaMalloc(&gx, N*sizeof(int)), "failed at cudaMalloc");
16-
TF_CHECK_CUDA(cudaMalloc(&gy, N*sizeof(int)), "failed at cudaMalloc");
17-
TF_CHECK_CUDA(cudaMalloc(&gz, N*sizeof(int)), "failed at cudaMalloc");
15+
TF_CHECK_CUDA(cudaMallocManaged(&gx, N*sizeof(int)), "failed at cudaMalloc");
16+
TF_CHECK_CUDA(cudaMallocManaged(&gy, N*sizeof(int)), "failed at cudaMalloc");
17+
TF_CHECK_CUDA(cudaMallocManaged(&gz, N*sizeof(int)), "failed at cudaMalloc");
1818

1919
tf::Taskflow taskflow;
2020
tf::Executor executor(num_cpus, num_gpus);

benchmarks/hetero_traversal/tbb.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ void TBB(const Graph& g, unsigned num_cpus, unsigned num_gpus) {
5454
int* gx = nullptr;
5555
int* gy = nullptr;
5656
int* gz = nullptr;
57-
TF_CHECK_CUDA(cudaMalloc(&gx, N*sizeof(int)), "failed at cudaMalloc");
58-
TF_CHECK_CUDA(cudaMalloc(&gy, N*sizeof(int)), "failed at cudaMalloc");
59-
TF_CHECK_CUDA(cudaMalloc(&gz, N*sizeof(int)), "failed at cudaMalloc");
57+
TF_CHECK_CUDA(cudaMallocManaged(&gx, N*sizeof(int)), "failed at cudaMallocManaged");
58+
TF_CHECK_CUDA(cudaMallocManaged(&gy, N*sizeof(int)), "failed at cudaMallocManaged");
59+
TF_CHECK_CUDA(cudaMallocManaged(&gz, N*sizeof(int)), "failed at cudaMallocManaged");
6060

6161
std::vector<std::unique_ptr<continue_node<continue_msg>>> tasks(g.num_nodes);
6262
std::vector<size_t> indegree(g.num_nodes, 0);

0 commit comments

Comments
 (0)