# end functions
#
+#
# Used by unit tests
+#
set(NNC_SOFT_BACKEND_DIR ${CMAKE_CURRENT_SOURCE_DIR}/plugin/soft_backend)
set(NNC_INTERPRETER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/plugin/interpreter)
+set(NNC_CAFFE_FRONTEND_DIR ${CMAKE_CURRENT_SOURCE_DIR}/plugin/caffe_frontend)
+set(NNC_TFLITE_FRONTEND_DIR ${CMAKE_CURRENT_SOURCE_DIR}/plugin/tflite_frontend)
set(NNC_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/core)
set(NNC_SUPPORT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/support)
--- /dev/null
+add_nncc_example_executable(caffe_model_dumper ${OPTIONS_SRC} model_dump.cpp)
+nncc_target_link_libraries(caffe_model_dumper nnc_support caffe_importer)
+target_include_directories(caffe_model_dumper PRIVATE ${NNC_CAFFE_FRONTEND_DIR})
\ No newline at end of file
--- /dev/null
+add_executable(tflite_import_example sanity_check.cpp ${OPTIONS_SRC})
+
+target_link_libraries(tflite_import_example PUBLIC tflite_schema)
+target_link_libraries(tflite_import_example PRIVATE tflite_import)
+target_include_directories(tflite_import_example PRIVATE ${NNC_TFLITE_FRONTEND_DIR})
-add_subdirectory(frontend)
+#
+# FRONTENDs
+#
+add_subdirectory(common_frontend)
+add_subdirectory(tflite_frontend)
+add_subdirectory(caffe_frontend)
+
+#
+# BACKENDs
+#
add_subdirectory(interpreter)
add_subdirectory(soft_backend)
# Caffe importer #
###################
-file(GLOB caffe_importer_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
-file(GLOB caffe_importer_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)
+file(GLOB caffe_importer_sources *.cpp)
+file(GLOB caffe_importer_headers *.h)
add_nncc_library(caffe_importer SHARED ${caffe_importer_sources}
${caffe_importer_headers})
-target_include_directories(caffe_importer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
-
target_link_libraries(caffe_importer PUBLIC caffeproto)
-target_link_libraries(caffe_importer PUBLIC ${nn_import_common})
+target_link_libraries(caffe_importer PUBLIC nn_import_common)
target_link_libraries(caffe_importer PRIVATE nnc_support)
target_link_libraries(caffe_importer PRIVATE nnc_core)
-add_nncc_example_executable(caffe_model_dumper ${OPTIONS_SRC} examples/model_dump.cpp)
-nncc_target_link_libraries(caffe_model_dumper nnc_support caffe_importer)
-
# install caffe frontend library
install_nnc_plugin(caffe_importer)
#include "caffe/proto/caffe.pb.h"
-#include "nn_importer.h"
+#include "plugin/common_frontend/nn_importer.h"
namespace nncc
{
#include "core/modelIR/TensorUtil.h"
#include "support/PluginException.h"
-#include "shape_helper.h"
+#include "plugin/common_frontend/shape_helper.h"
#include "caffe_model_visitor.h"
namespace nncc
#include "core/modelIR/operations/reshape_op.h"
#include "core/modelIR/operations/fully_connected_op.h"
-#include "shape_helper.h"
+#include "plugin/common_frontend/shape_helper.h"
#include "caffe_op_creator.h"
namespace nncc
--- /dev/null
+##########################################
+# Common for every importer code library #
+##########################################
+
+set(COMMON_SOURCES
+ model_allocation.cpp
+ shape_helper.cpp)
+
+add_library(nn_import_common STATIC ${COMMON_SOURCES})
+set_target_properties(nn_import_common PROPERTIES POSITION_INDEPENDENT_CODE ON)
+target_link_libraries(nn_import_common PRIVATE nnc_core nnc_support)
\ No newline at end of file
#include <sys/stat.h>
#include <sys/mman.h>
-#include "model_allocation.h"
+#include "plugin/common_frontend/model_allocation.h"
using namespace nncc::contrib::frontend::common;
#include <vector>
-#include "shape_helper.h"
+#include "plugin/common_frontend/shape_helper.h"
#include "support/PluginException.h"
namespace nncc
+++ /dev/null
-##########################################
-# Common for every importer code library #
-##########################################
-
-file(GLOB common_sources common/*)
-file(GLOB common_headers include/*)
-
-set(nn_import_common nn_import_common)
-add_library(${nn_import_common} STATIC ${common_sources} ${common_headers})
-
-target_include_directories(${nn_import_common} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
-set_target_properties(${nn_import_common} PROPERTIES POSITION_INDEPENDENT_CODE ON)
-
-target_link_libraries(${nn_import_common} PRIVATE nnc_core nnc_support)
-
-add_subdirectory(tflite)
-add_subdirectory(caffe)
# TFLITE importer #
###################
-set(tflite_importer_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_walker.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_dump_visitor.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_ir_visitor.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_op_creator.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_v3_importer.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_plugin.cpp)
-file(GLOB tflite_importer_headers include/*.h)
+set(tflite_importer_sources tflite_walker.cpp
+ tflite_dump_visitor.cpp
+ tflite_ir_visitor.cpp
+ tflite_op_creator.cpp
+ tflite_v3_importer.cpp
+ tflite_plugin.cpp)
+file(GLOB tflite_importer_headers *.h)
set(tflite_import tflite_import)
add_library(${tflite_import} SHARED ${tflite_importer_sources} ${tflite_importer_headers})
-target_include_directories(${tflite_import} PUBLIC include)
-
target_link_libraries(${tflite_import} PUBLIC tflite_schema)
target_link_libraries(${tflite_import} PUBLIC flatbuffers)
-target_link_libraries(${tflite_import} PUBLIC ${nn_import_common})
+target_link_libraries(${tflite_import} PUBLIC nn_import_common)
target_link_libraries(${tflite_import} PUBLIC nnc_support)
target_link_libraries(${tflite_import} PUBLIC nnc_core)
-###################
-# TFLITE examples #
-###################
-
-file(GLOB tflite_example_sources examples/*)
-
-set(tflite_import_example tflite_import_example)
-add_executable(${tflite_import_example} ${tflite_example_sources} ${OPTIONS_SRC})
-
-target_link_libraries(${tflite_import_example} PUBLIC tflite_schema)
-target_link_libraries(${tflite_import_example} PRIVATE ${tflite_import})
-
# install tflite frontend library
install_nnc_plugin(tflite_import)
#include "core/modelIR/TensorUtil.h"
#include "core/modelIR/operations/variable_op.h"
-#include "shape_helper.h"
+#include "plugin/common_frontend/shape_helper.h"
#include "tflite_ir_visitor.h"
#include "tflite_op_creator.h"
#include "core/modelIR/operations/common.h"
#include "schema_v3.h"
-#include "shape_helper.h"
+#include "plugin/common_frontend/shape_helper.h"
namespace nncc
{
#include <string>
#include "schema_v3.h"
-#include "nn_importer.h"
-#include "model_allocation.h"
+#include "plugin/common_frontend/nn_importer.h"
+#include "plugin/common_frontend/model_allocation.h"
namespace nncc
{
add_executable(system_test_import_tflite tflite.cpp ${OPTIONS_SRC})
target_link_libraries(system_test_import_tflite PRIVATE nnc_support tflite_import)
+target_include_directories(system_test_import_tflite PRIVATE ${NNC_TFLITE_FRONTEND_DIR})
add_executable(system_test_import_caffe caffe.cpp ${OPTIONS_SRC})
target_link_libraries(system_test_import_caffe PRIVATE nnc_support caffe_importer)
+target_include_directories(system_test_import_caffe PRIVATE ${NNC_CAFFE_FRONTEND_DIR})
#include "core/modelIR/operations/softmax_op.h"
#include "core/modelIR/ShapeInference.h"
-#include "shape_helper.h"
+#include "plugin/common_frontend/shape_helper.h"
#include "op_info_generated.h"
#include "graph_creator.h"
#include "core/modelIR/ShapeInference.h"
#include "op_info_generated.h"
-#include "shape_helper.h"
+#include "plugin/common_frontend/shape_helper.h"
#include "graph_creator.h"
using namespace nncc::contrib::frontend::common;