|
|
|
@ -10,8 +10,22 @@ function(pass_library TARGET DEST)
|
|
|
|
|
set(options "")
|
|
|
|
|
set(oneValueArgs "")
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
|
set(targetPrefix "")
|
|
|
|
|
|
|
|
|
|
# Get optional argument
|
|
|
|
|
set(extraMacroArgs ${ARGN})
|
|
|
|
|
list(LENGTH extraMacroArgs numExtraMacroArgs)
|
|
|
|
|
if(numExtraMacroArgs GREATER 0)
|
|
|
|
|
list(GET extraMacroArgs 0 targetPrefix)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
cmake_parse_arguments(op_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
cc_library(${TARGET} SRCS ${TARGET}.cc DEPS graph_pattern_detector pass fuse_pass_base ${op_library_DEPS})
|
|
|
|
|
if(targetPrefix)
|
|
|
|
|
cc_library(${TARGET} SRCS ${targetPrefix}/${TARGET}.cc DEPS graph_pattern_detector pass fuse_pass_base ${op_library_DEPS})
|
|
|
|
|
else()
|
|
|
|
|
cc_library(${TARGET} SRCS ${TARGET}.cc DEPS graph_pattern_detector pass fuse_pass_base ${op_library_DEPS})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# add more DEST here, such as train, dist and collect USE_PASS into a file automatically.
|
|
|
|
|
if (${DEST} STREQUAL "base" OR ${DEST} STREQUAL "inference")
|
|
|
|
|
message(STATUS "add pass ${TARGET} ${DEST}")
|
|
|
|
@ -62,11 +76,11 @@ foreach (index RANGE 3 6)
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
if(WITH_MKLDNN)
|
|
|
|
|
pass_library(mkldnn_placement_pass base)
|
|
|
|
|
pass_library(depthwise_conv_mkldnn_pass base)
|
|
|
|
|
pass_library(conv_bias_mkldnn_fuse_pass inference)
|
|
|
|
|
pass_library(conv_relu_mkldnn_fuse_pass inference)
|
|
|
|
|
pass_library(conv_elementwise_add_mkldnn_fuse_pass inference)
|
|
|
|
|
pass_library(mkldnn_placement_pass base mkldnn)
|
|
|
|
|
pass_library(depthwise_conv_mkldnn_pass base mkldnn)
|
|
|
|
|
pass_library(conv_bias_mkldnn_fuse_pass inference mkldnn)
|
|
|
|
|
pass_library(conv_relu_mkldnn_fuse_pass inference mkldnn)
|
|
|
|
|
pass_library(conv_elementwise_add_mkldnn_fuse_pass inference mkldnn)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
cc_library(fuse_elewise_add_act_pass SRCS fuse_elewise_add_act_pass.cc DEPS pass graph_pattern_detector )
|
|
|
|
@ -86,7 +100,7 @@ cc_test(test_fc_fuse_pass SRCS fc_fuse_pass_tester.cc DEPS fc_fuse_pass framewor
|
|
|
|
|
cc_test(test_seqpool_concat_fuse_pass SRCS seqpool_concat_fuse_pass_tester.cc DEPS seqpool_concat_fuse_pass framework_proto)
|
|
|
|
|
cc_test(test_is_test_pass SRCS is_test_pass_tester.cc DEPS is_test_pass)
|
|
|
|
|
if (WITH_MKLDNN)
|
|
|
|
|
cc_test(test_depthwise_conv_mkldnn_pass SRCS depthwise_conv_mkldnn_pass_tester.cc DEPS depthwise_conv_mkldnn_pass)
|
|
|
|
|
cc_test(test_conv_relu_mkldnn_fuse_pass SRCS conv_relu_mkldnn_fuse_pass_tester.cc DEPS conv_relu_mkldnn_fuse_pass)
|
|
|
|
|
cc_test(test_conv_elementwise_add_mkldnn_fuse_pass SRCS conv_elementwise_add_mkldnn_fuse_pass_tester.cc DEPS conv_elementwise_add_mkldnn_fuse_pass)
|
|
|
|
|
cc_test(test_depthwise_conv_mkldnn_pass SRCS mkldnn/depthwise_conv_mkldnn_pass_tester.cc DEPS depthwise_conv_mkldnn_pass)
|
|
|
|
|
cc_test(test_conv_relu_mkldnn_fuse_pass SRCS mkldnn/conv_relu_mkldnn_fuse_pass_tester.cc DEPS conv_relu_mkldnn_fuse_pass)
|
|
|
|
|
cc_test(test_conv_elementwise_add_mkldnn_fuse_pass SRCS mkldnn/conv_elementwise_add_mkldnn_fuse_pass_tester.cc DEPS conv_elementwise_add_mkldnn_fuse_pass)
|
|
|
|
|
endif ()
|
|
|
|
|