From dbd7230d52e27cd415e2a835892c77f556afc18b Mon Sep 17 00:00:00 2001 From: Soheil Shahrooz Date: Tue, 23 Nov 2021 18:41:45 +0330 Subject: [PATCH 1/2] Added cub as a submodule --- .gitmodules | 3 +++ IM.h | 2 +- cub | 1 + kernels.cu | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .gitmodules create mode 160000 cub diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..159f49c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cub"] + path = cub + url = https://github.com/NVIDIA/cub.git diff --git a/IM.h b/IM.h index 42c2268..c113336 100644 --- a/IM.h +++ b/IM.h @@ -10,7 +10,7 @@ #include #include "kernels.h" -#include "./cub-1.8.0/cub/cub.cuh" +#include "./cub/cub/cub.cuh" #define MAX_NUMBER_OF_RR_SETS 30000000 diff --git a/cub b/cub new file mode 160000 index 0000000..c3cceac --- /dev/null +++ b/cub @@ -0,0 +1 @@ +Subproject commit c3cceac115c072fb63df1836ff46d8c60d9eb304 diff --git a/kernels.cu b/kernels.cu index eece415..2bbab71 100644 --- a/kernels.cu +++ b/kernels.cu @@ -7,7 +7,7 @@ #include #include -#include "./cub-1.8.0/cub/cub.cuh" +#include "./cub/cub/cub.cuh" __device__ uint32_t mix_hash(uint32_t a, uint32_t b, uint32_t c) { From cc30bbace6fa6b9fa7b9527df5f1b5292898981f Mon Sep 17 00:00:00 2001 From: Soheil Shahrooz Date: Tue, 23 Nov 2021 19:02:25 +0330 Subject: [PATCH 2/2] Edited README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eaa66ce..95301cb 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,23 @@ gIM is a GPU-accelerated RIS-based influence maximization (IM) algorithm. ### CUDA toolkit To install CUDA toolkit please use [this link](https://developer.nvidia.com/cuda-downloads). +### Repository Preparation + +gIM uses cub library for some parallel algorithms like scan. Before compiling the code, initialize submodules using the following command: + ``` + git submodule update --init + ``` + ### Compilation Compile the code using the following command: ``` nvcc -std=c++11 -O3 -lcurand *.cu -o gIM ``` - + If you are using CUDA 7.5 and newer versions on Windows, you can remove the -std flag because these versions include the support for C++11 standard by default. Wildcard expansion does not work in cmd.exe, so you need to use the following command for compiling the code: + ``` + nvcc -O3 -lcurand kernels.cu IM.cu testgraph.cu -o gIM + ``` ### Execution Run the code using the following command: