...
 
Commits (4)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
PROJECT(cusabnatk CXX)
PROJECT(cusabnatk CXX CUDA)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
......@@ -25,8 +25,6 @@ INCLUDE(CheckCXXCompilerFlag)
FIND_PACKAGE(CUDA 10.0 REQUIRED)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --default-stream per-thread" )
INCLUDE_DIRECTORIES(include/ .)
ADD_SUBDIRECTORY(src)
......
......@@ -14,5 +14,5 @@ cd build/
# Change NVCC flags as needed
cmake ../ -DCMAKE_INSTALL_PREFIX=$DIR -DCUDA_NVCC_FLAGS="-arch=sm_61"
#make -j8 install VERBOSE=1
# make -j8 install VERBOSE=1
make -j8 install
......@@ -14,8 +14,6 @@
#ifndef GPU_COUNTER_HPP
#define GPU_COUNTER_HPP
#define CUDA_API_PER_THREAD_DEFAULT_STREAM
#include <cinttypes>
#include <vector>
#include <atomic>
......@@ -113,7 +111,8 @@ public:
resultList_, // results array for Nijk
resultListPa_, // results array for Nij
intermediaResult_, // memory for intermediate results
streamId);
streamId,
streams[streamId]);
//TODO: fix this condition
for (int i = 0; i < 1024; ++i) {
......
......@@ -5,6 +5,7 @@
#include <cinttypes>
#include <vector>
#include <assert.h>
#include <cuda_runtime.h>
......@@ -39,6 +40,7 @@ void cudaCallBlockCount(const uint block_count,
uint64_t* results,
uint64_t *resultsPa,
uint64_t* intermediateData,
int streamId);
int streamId,
cudaStream_t stream);
#endif // GPU_UTIL
CUDA_ADD_LIBRARY(gpu_util STATIC gpu_util.cu)
set(CUDA_SEPARABLE_COMPILATION TRUE)
CUDA_ADD_LIBRARY(gpu_util STATIC gpu_util.cu)
\ No newline at end of file
This diff is collapsed.
#!/bin/bash
rm gpu_util.o
rm ../examples/query
rm query.o
#compile cuda code
nvcc -arch=sm_61 -rdc=true -c gpu_util.cu -lcudadevrt -o gpu_util.o -I../include
#create static library from object code
ar rcs gpu_util.a gpu_util.o
#compile C++ code
g++ -fopenmp -std=c++14 -O3 -c ../examples/query.cpp -o query.o -I/util/common/cuda/cuda-10.0/include -I../include
#link
nvcc -arch=sm_61 query.o gpu_util.a -Xcompiler -fopenmp -std=c++14 -O3 -o ../examples/query \
-I/util/common/cuda/cuda-10.0/include -I../include /util/common/cuda/cuda-10.0/lib64/libcudart_static.a \
-ldl -lrt /util/common/cuda/cuda-10.0/lib64/libcudart_static.a
\ No newline at end of file