CMakeLists.txt 3.7 KB
Newer Older
Y
Yan Chunwei 已提交
1 2 3 4 5 6 7 8
if(NOT (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM))
    return()
endif()

if(NOT (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM))
  return()
endif()

9 10 11 12 13 14 15 16 17 18 19
set(script_dir ${CMAKE_CURRENT_SOURCE_DIR}/../../../tools/)
message(STATUS "generating arm dotprod code")
find_package(PythonInterp REQUIRED)
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${script_dir}/convert_arm_sdot_to_machine_code.py
        "--input_file=${CMAKE_CURRENT_SOURCE_DIR}/dotprod/__gemm_sdot_meta__.h"
        "--output_file=${CMAKE_CURRENT_SOURCE_DIR}/dotprod/gemm_sdot.h"
        RESULT_VARIABLE gen_code_ret)
if (NOT ${gen_code_ret} STREQUAL "0")
  message(FATAL_ERROR "generating dotprod code quit with error: ${gen_code_ret}")
endif ()

Y
Yan Chunwei 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
set(HAS_ARM_MATH_LIB_DIR OFF)
# will search name as "libmath_arm.${os}.${abi}.${lang}.a"
if(ARM_MATH_LIB_DIR AND EXISTS "${ARM_MATH_LIB_DIR}")
  set(arm_math_name "")
  if(ARM_TARGET_OS STREQUAL "android")
    if(ARM_TARGET_ARCH_ABI STREQUAL "armv8")
      set(arm_math_name "math_arm.android.armv8")
    elseif(ARM_TARGET_ARCH_ABI STREQUAL "armv7")
      set(arm_math_name "math_arm.android.armv7")
    endif()
  endif()

  if(ARM_TARGET_OS STREQUAL "armlinux" )
    if(ARM_TARGET_ARCH_ABI STREQUAL "armv8")
      set(arm_math_name "math_arm.armlinux.armv8")
    elseif(ARM_TARGET_ARCH_ABI STREQUAL "armv7")
      set(arm_math_name "math_arm.armlinux.armv7")
    endif()
  endif()

  if(ARM_TARGET_LANG STREQUAL "clang")
    set(arm_math_name "${arm_math_name}.clang")
  else()
    set(arm_math_name "${arm_math_name}.gcc")
  endif()

  find_library(math_arm_file ${arm_math_name} ${ARM_MATH_LIB_DIR} NO_DEFAULT_PATH)
  if(math_arm_file)
    add_library(math_arm STATIC IMPORTED GLOBAL)
    set_property(TARGET math_arm PROPERTY IMPORTED_LOCATION ${math_arm_file})
    message(STATUS "ARM math library imported: ${math_arm_file}")
    set(HAS_ARM_MATH_LIB_DIR ON)
  else()
    message(WARNING "Can not find arm math library ${arm_math_name} in ${ARM_MATH_LIB_DIR}")
  endif()
endif()


if (NOT HAS_ARM_MATH_LIB_DIR)
  # TODO(xxx): seperate them and do not deps proto, eigen3
60 61
  cc_library(math_arm SRCS
      funcs.cc
Y
Yan Chunwei 已提交
62
      packed_sgemm.cc
63
      packed_sgemm_c4.cc
Y
Yan Chunwei 已提交
64
      sgemm.cc
65 66 67 68 69 70
      gemm_prepacked_int8.cc
      gemm_s8.cc
      sgemv.cc
      gemv_arm_int8.cc
      conv3x3s1_direct_fp32.cc
      conv3x3s2_direct_fp32.cc
71 72
      conv3x3s1p01_depthwise_fp32_relu.cc
      conv3x3s2p01_depthwise_fp32_relu.cc
73 74 75 76
      conv3x3s1p01_depthwise_fp32.cc
      conv3x3s2p01_depthwise_fp32.cc
      conv3x3s1px_depthwise_fp32.cc
      conv3x3s2px_depthwise_fp32.cc
77 78 79 80 81 82
      conv3x3s1_direct_int8.cc
      conv3x3s2_direct_int8.cc
      conv3x3s1_depthwise_int8.cc
      conv3x3s2_depthwise_int8.cc
      conv5x5s1_depthwise_int8.cc
      conv5x5s1_depthwise_fp32.cc
83
      conv5x5s2_depthwise_int8.cc
84
      conv5x5s2_depthwise_fp32.cc
T
TianXiaogang 已提交
85
      conv3x3_winograd_fp32_c4.cc
86
      conv3x3_winograd_int8.cc
87 88
      conv_winograd_3x3.cc
      conv_impl.cc
89
      softmax.cc
Y
Yan Chunwei 已提交
90 91 92
      scale.cc
      pooling.cc
      elementwise.cc
93
      layout.cc
Y
Yan Chunwei 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
      lrn.cc
      decode_bboxes.cc
      concat.cc
      type_trans.cc
      box_coder.cc
      split.cc
      shuffle_channel.cc
      activation.cc
      yolo_box.cc
      dropout.cc
      power.cc
      interpolate.cc
      argmax.cc
      axpy.cc
      fill_bias_relu.cc
      col_im_transform.cc
      im2sequence.cc
      prior_box.cc
      sequence_softmax.cc
      norm.cc
      topk.cc
      increment.cc
      pad2d.cc
      negative.cc
      beam_search.cc
      reduce_max.cc
      sequence_pool.cc
      sequence_expand.cc
      slice.cc
123 124
      reduce_mean.cc
      stack.cc
125 126
      affine_channel.cc
      anchor_generator.cc
J
juncaipeng 已提交
127 128
      split_merge_lod_tenosr.cc
      reduce_prod.cc
X
xiaogang 已提交
129
      lstm.cc
C
cc 已提交
130
      clip.cc
131
      DEPS ${lite_kernel_deps} context tensor)
Y
Yan Chunwei 已提交
132
endif()