1 if(NOT BUILD_ONERT_TRAIN)
3 endif(NOT BUILD_ONERT_TRAIN)
9 list(APPEND ONERT_TRAIN_SRCS "src/onert_train.cc")
10 list(APPEND ONERT_TRAIN_SRCS "src/args.cc")
11 list(APPEND ONERT_TRAIN_SRCS "src/nnfw_util.cc")
12 list(APPEND ONERT_TRAIN_SRCS "src/randomgen.cc")
13 list(APPEND ONERT_TRAIN_SRCS "src/rawformatter.cc")
14 list(APPEND ONERT_TRAIN_SRCS "src/rawdataloader.cc")
16 nnfw_find_package(Boost REQUIRED program_options)
17 nnfw_find_package(HDF5 QUIET)
20 list(APPEND ONERT_TRAIN_SRCS "src/h5formatter.cc")
23 add_executable(onert_train ${ONERT_TRAIN_SRCS})
26 target_compile_definitions(onert_train PRIVATE ONERT_HAVE_HDF5=1)
27 target_include_directories(onert_train PRIVATE ${HDF5_INCLUDE_DIRS})
28 target_link_libraries(onert_train ${HDF5_CXX_LIBRARIES})
30 message(WARNING "HDF5 NOT found. Install libhdf5-dev or set EXT_HDF5_DIR to support load/dump in onert_train.")
33 target_include_directories(onert_train PRIVATE src)
34 target_include_directories(onert_train PRIVATE ${Boost_INCLUDE_DIRS})
36 target_link_libraries(onert_train nnfw_lib_tflite jsoncpp)
37 target_link_libraries(onert_train nnfw-dev)
38 target_link_libraries(onert_train ${Boost_PROGRAM_OPTIONS_LIBRARY})
39 target_link_libraries(onert_train nnfw_lib_benchmark)
41 install(TARGETS onert_train DESTINATION bin)
45 endif(NOT ENABLE_TEST)
48 set(TEST_ONERT_TRAIN test_onert_train)
50 file(GLOB_RECURSE ONERT_TRAIN_TEST_SRCS "test/*.cc")
51 list(APPEND ONERT_TRAIN_TEST_SRCS "src/rawdataloader.cc")
52 list(APPEND ONERT_TRAIN_TEST_SRCS "src/nnfw_util.cc")
54 add_executable(${TEST_ONERT_TRAIN} ${ONERT_TRAIN_TEST_SRCS})
56 target_link_libraries(${TEST_ONERT_TRAIN} nnfw-dev)
57 target_link_libraries(${TEST_ONERT_TRAIN} gtest gtest_main dl ${LIB_PTHREAD})
59 add_test(${TEST_ONERT_TRAIN} ${TEST_ONERT_TRAIN})
60 install(TARGETS ${TEST_ONERT_TRAIN} DESTINATION unittest)