Skip to content
Snippets Groups Projects
Commit 8d819f3c authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Added support to run all benchmarks in ctest

parent 5f9d9afa
No related branches found
No related tags found
No related merge requests found
...@@ -161,4 +161,7 @@ add_custom_target(hpvm-check) ...@@ -161,4 +161,7 @@ add_custom_target(hpvm-check)
add_dependencies(hpvm-check check-hpvm) add_dependencies(hpvm-check check-hpvm)
set_target_properties(hpvm-check PROPERTIES FOLDER "Tests") set_target_properties(hpvm-check PROPERTIES FOLDER "Tests")
# HPVM-C benchmarks uses ctest instead of LLVM's test mechanism
# because they are compiled in a custom way
include(CTest)
add_subdirectory(dnn_benchmarks/hpvm-c) add_subdirectory(dnn_benchmarks/hpvm-c)
...@@ -23,6 +23,8 @@ function(approxhpvm_py_codegen bin_filename src_filepath codegen_target) ...@@ -23,6 +23,8 @@ function(approxhpvm_py_codegen bin_filename src_filepath codegen_target)
-t ${codegen_target} -I ${CONFIG_INCLUDE_DIR} ${ARGV} -t ${codegen_target} -I ${CONFIG_INCLUDE_DIR} ${ARGV}
) )
add_custom_target(${bin_filename} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${bin_filename}) add_custom_target(${bin_filename} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${bin_filename})
add_test(NAME test_${bin_filename} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${bin_filename})
set_tests_properties(test_${bin_filename} PROPERTIES RUN_SERIAL TRUE)
set(test_compile_targets ${test_compile_targets} ${bin_filename} PARENT_SCOPE) set(test_compile_targets ${test_compile_targets} ${bin_filename} PARENT_SCOPE)
endfunction(approxhpvm_py_codegen) endfunction(approxhpvm_py_codegen)
...@@ -44,12 +46,8 @@ foreach(dir ${entries}) ...@@ -44,12 +46,8 @@ foreach(dir ${entries})
--quant-file ${dir}/data/quant_ranges_rt.txt --quant-file ${dir}/data/quant_ranges_rt.txt
--conf-file ${dir}/data/tuner_confs.txt --conf-file ${dir}/data/tuner_confs.txt
) )
# Run tensor binary
run_single_benchmark(run_${dirname} ${dirname})
# Generate "cudnn"-targeted code # Generate "cudnn"-targeted code
approxhpvm_py_codegen(${dirname}_cudnn ${dir}/${dirname}_cudnn.cpp cudnn) approxhpvm_py_codegen(${dirname}_cudnn ${dir}/${dirname}_cudnn.cpp cudnn)
# Run cudnn binary
run_single_benchmark(run_${dirname}_cudnn ${dirname}_cudnn)
endforeach(dir) endforeach(dir)
message(STATUS "List of test dnn benchmarks: ${test_compile_targets}") message(STATUS "List of test dnn benchmarks: ${test_compile_targets}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment