CMakeLists.txt 1.3 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
find_path(
  DLNNE_INCLUDE_DIR dlnne.h
D
denglin-github 已提交
12
  PATHS $ENV{DL_SDK_DIR} $ENV{DL_SDK_DIR}/include/dlnne
13
  NO_DEFAULT_PATH)
D
denglin-github 已提交
14

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

D
denglin-github 已提交
20
find_path(CUDA_INCLUDE_DIR cuda.h $ENV{DL_SDK_DIR}/include)
D
denglin-github 已提交
21

22 23
find_library(
  CURT_LIB libcurt.so
D
denglin-github 已提交
24
  PATHS $ENV{DL_SDK_DIR} $ENV{DL_SDK_DIR}/lib
25
  NO_DEFAULT_PATH)
D
denglin-github 已提交
26 27 28 29 30 31 32 33 34

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}")

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

#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})

50 51 52 53
cc_test(
  test_dlnne_engine_op
  SRCS dlnne_engine_op_test.cc
  DEPS dlnne_engine_op analysis)