Required gcc version: 8.1 or above
Required nvcc version: 11.2 or 9.2
Follow these steps to run the solution on a GPU device:
-
Clone or download this Repository.
-
The final solutions are present in the
Final Source Codes
folder. It has three solutions: optimised CPU solution, GPU solution 1 and GPU solution 2. -
To run the solutions, create a repository named
test
(it can be named something else as well). Change the working directory totest
. -
Create a
solution.cu
file and ainput.txt
file. Copy the solution to be executed in thesolution.cu
and the input in theinput.txt
. Make sure that the input format is correct. -
Execute the
solution.cu
file using the command below. The output will be printed on the command-line screen.
$nvcc solution.cu
$./a.out
If this doesn't work use:
$nvcc -arch=sm_35 -rdc=true solution.cu
$./a.out
Here arch=sm_35
denotes the compute capability of the gpu. For compute capability of 6.0 use sm_60
, similarly for 8.5 use sm_85
.
The first line of input should contain two integers - the first one for the number of edges in the graph and the second one for the value of k for which the number of k-cliques needs to be found.
Next lines contain two integers each which represents an edge.
The number of k-cliques found along with the execution time is printed.