CMakeLists.txt 1.4 KB
Newer Older
D
denglin-github 已提交
1
# compile flags
2 3
set(DLNNE_FLAGS -Wno-error=non-virtual-dtor -Wno-error=unused-variable
                -Wno-error=attributes ${fsanitize})
D
denglin-github 已提交
4 5 6 7 8 9
foreach(flag ${DLNNE_FLAGS})
  safe_set_cflag(CMAKE_C_FLAGS ${flag})
  safe_set_cxxflag(CMAKE_CXX_FLAGS ${flag})
endforeach()

# add nne
10 11 12 13
find_path(
  DLNNE_INCLUDE_DIR dlnne.h
  PATHS $ENV{SOFTWARE_SOURCE_DIR} $ENV{SOFTWARE_SOURCE_DIR}/driver/nne/include
  NO_DEFAULT_PATH)
D
denglin-github 已提交
14

15 16 17 18
find_library(
  DLNNE_LIB libdlnne.so
  PATHS $ENV{SOFTWARE_BUILD_DIR} $ENV{SOFTWARE_BUILD_DIR}/driver/nne
  NO_DEFAULT_PATH)
D
denglin-github 已提交
19

20 21
find_path(CUDA_INCLUDE_DIR cuda.h
          $ENV{SOFTWARE_BUILD_DIR}/llvm-project-10/cuda/include)
D
denglin-github 已提交
22

23 24 25 26 27
find_library(
  CURT_LIB libcurt.so
  PATHS $ENV{SOFTWARE_BUILD_DIR}
        $ENV{SOFTWARE_BUILD_DIR}/llvm-project-10/cuda/lib
  NO_DEFAULT_PATH)
D
denglin-github 已提交
28 29 30 31 32 33 34 35 36

message("DLNNE_INCLUDE_DIR: "${DLNNE_INCLUDE_DIR})
message("DLNNE_LIB: "${DLNNE_LIB})
message("CUDA_INCLUDE_DIR: "${CUDA_INCLUDE_DIR})
message("CURT_LIB: "${CURT_LIB})

include_directories("${DLNNE_INCLUDE_DIR}")
include_directories("${CUDA_INCLUDE_DIR}")

37 38 39 40 41 42 43 44
op_library(
  dlnne_engine_op
  DEPS
  ${GLOB_OPERATOR_DEPS}
  framework_proto
  device_context
  op_registry
  scope)
D
denglin-github 已提交
45 46 47 48 49 50 51

#message("PYBIND_FILE:${pybind_file}")
#file(APPEND ${pybind_file} "USE_NO_KERNEL_OP(dlnne_engine);\n")
#endif()

target_link_libraries(dlnne_engine_op ${DLNNE_LIB} ${CURT_LIB})

52 53 54 55
cc_test(
  test_dlnne_engine_op
  SRCS dlnne_engine_op_test.cc
  DEPS dlnne_engine_op analysis)