forked from jiuyuan/InfiniTensor
Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
bolun | fdb2d30868 | |
zhangyue207 | f532784d4f | |
zhangyue207 | 454b7651a8 | |
zhangyue207 | 48322dbf27 | |
zhangyue207 | 523946cb8b |
|
@ -262,3 +262,19 @@ if(BUILD_TEST)
|
|||
target_link_libraries(nnet_reader InfiniTensor)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
function(build_bench files)
|
||||
file(GLOB BENCH_SOURCES ${files})
|
||||
foreach(benchsourcefile ${BENCH_SOURCES})
|
||||
get_filename_component(benchname ${benchsourcefile} NAME_WE)
|
||||
add_executable("benchmark_${benchname}" ${benchsourcefile})
|
||||
target_link_libraries("benchmark_${benchname}" InfiniTensor)
|
||||
# add_custom_target(NAME ${benchname} COMMAND ${benchname})
|
||||
endforeach(benchsourcefile ${BENCH_SOURCES})
|
||||
endfunction()
|
||||
|
||||
if (BENCH)
|
||||
if (USE_CUDA)
|
||||
build_bench(benchmark/kernels/cuda/*.cc)
|
||||
endif()
|
||||
endif()
|
||||
|
|
2
Makefile
2
Makefile
|
@ -6,12 +6,14 @@ BANG ?= OFF
|
|||
INTELCPU ?= off
|
||||
BACKTRACE ?= ON
|
||||
TEST ?= ON
|
||||
BENCH ?= ON
|
||||
|
||||
CMAKE_OPT = -DCMAKE_BUILD_TYPE=$(TYPE)
|
||||
CMAKE_OPT += -DUSE_CUDA=$(CUDA)
|
||||
CMAKE_OPT += -DUSE_BANG=$(BANG)
|
||||
CMAKE_OPT += -DUSE_BACKTRACE=$(BACKTRACE)
|
||||
CMAKE_OPT += -DBUILD_TEST=$(TEST)
|
||||
CMAKE_OPT += -DBENCH=$(BENCH)
|
||||
|
||||
ifeq ($(INTELCPU), ON)
|
||||
CMAKE_OPT += -DUSE_INTELCPU=ON -DCMAKE_CXX_COMPILER=dpcpp
|
||||
|
|
Loading…
Reference in New Issue