add CMake test
This commit is contained in:
parent
63c9cc566c
commit
18b577b008
|
@ -1,3 +1,6 @@
|
|||
[submodule "external/moodycamel"]
|
||||
path = external/moodycamel
|
||||
url = https://github.com/cameron314/concurrentqueue
|
||||
[submodule "test/Hetero-Mark"]
|
||||
path = test/Hetero-Mark
|
||||
url = https://github.com/NUCAR-DEV/Hetero-Mark
|
||||
|
|
|
@ -52,3 +52,5 @@ set(GCC_COVERAGE_LINK_FLAGS
|
|||
|
||||
add_subdirectory(compilation)
|
||||
add_subdirectory(runtime)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit b8ea324d2394401776487b3520338d03f8c27676
|
|
@ -0,0 +1,14 @@
|
|||
set(TESTCASES aes)
|
||||
foreach(case ${TESTCASES})
|
||||
message(STATUS "Add test: ${case}")
|
||||
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
message(STATUS "${CMAKE_BINARY_DIR}")
|
||||
find_program(BASH_PROGRAM bash)
|
||||
execute_process(COMMAND find . -name "*test.cc" -type f -delete)
|
||||
add_test(
|
||||
NAME "${case}"
|
||||
COMMAND
|
||||
${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/runHeteroMark.sh ${case}
|
||||
${CUDA_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/Hetero-Mark ${CMAKE_BINARY_DIR})
|
||||
endforeach()
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
TestCase=$1
|
||||
CUDA_PATH=$2
|
||||
HeteroMark_PATH=$3
|
||||
CuPBoP_BUILD_PATH=$4
|
||||
DATASET_PATH=/tmp/data
|
||||
if [ ! -d $DATASET_PATH ]; then
|
||||
echo "Download Hetero Mark dataset"
|
||||
cd /tmp
|
||||
wget https://www.dropbox.com/s/ie2hcxw9lfoghg8/data.tar.gz?dl=1
|
||||
tar -xzf 'data.tar.gz?dl=1'
|
||||
fi
|
||||
|
||||
mkdir -p $TestCase
|
||||
cd $TestCase
|
||||
clang++ -std=c++11 $HeteroMark_PATH/src/$1/cuda/$1_cuda_benchmark.cu -I$HeteroMark_PATH \
|
||||
--cuda-path=$CUDA_PATH \
|
||||
--cuda-gpu-arch=sm_50 -L$CUDA_PATH/lib64 \
|
||||
-lcudart_static -ldl -lrt -pthread -save-temps -v || true
|
||||
export LD_LIBRARY_PATH=$CuPBoP_BUILD_PATH/runtime:$CuPBoP_BUILD_PATH/runtime/threadPool:$LD_LIBRARY_PATH
|
||||
export PATH=$CuPBoP_BUILD_PATH/compilation:$PATH
|
||||
kernelTranslator $1_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc
|
||||
hostTranslator $1_cuda_benchmark-host-x86_64-unknown-linux-gnu.bc host.bc
|
||||
llc --relocation-model=pic --filetype=obj kernel.bc
|
||||
llc --relocation-model=pic --filetype=obj host.bc
|
||||
g++ -o $1 -fPIC -no-pie \
|
||||
$HeteroMark_PATH/src/$1/cuda/main.cc host.o kernel.o $HeteroMark_PATH/src/$1/*.cc $HeteroMark_PATH/src/common/benchmark/*.cc \
|
||||
$HeteroMark_PATH/src/common/command_line_option/*.cc $HeteroMark_PATH/src/common/time_measurement/*.cc \
|
||||
-L$CuPBoP_BUILD_PATH/runtime -L$CuPBoP_BUILD_PATH/runtime/threadPool \
|
||||
-I$HeteroMark_PATH -lpthread -lc -lx86Runtime -lthreadPool
|
||||
./$1 -i $DATASET_PATH/aes/1KB.data -k $DATASET_PATH/aes/key.data -q -v
|
Loading…
Reference in New Issue