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/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: 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) {