Compare commits

...

5 Commits

Author SHA1 Message Date
bolun fdb2d30868 fix: Makefile 2023-07-19 11:29:15 +08:00
zhangyue207 f532784d4f update CMakeList.txt Makefile for micro benchmark 2023-07-19 11:10:18 +08:00
zhangyue207 454b7651a8 update CMakeList.txt Makefile for micro benchmark 2023-07-19 10:55:51 +08:00
zhangyue207 48322dbf27 Conv Kernel FP16 2023-07-19 10:06:47 +08:00
zhangyue207 523946cb8b add conv_half kernel 2023-07-18 16:55:00 +08:00
2 changed files with 18 additions and 0 deletions

View File

@ -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()

View File

@ -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