Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.15
with:
source: '.'
source: './app ./include ./src ./test'
build-linux:
strategy:
matrix:
Expand Down
24 changes: 14 additions & 10 deletions app/Graph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,26 @@ if (NOT CMAKE_BUILD_TYPE)
endif()

if (WIN32)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
set(CMAKE_BUILD_TYPE "Debug")
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
set(CMAKE_BUILD_TYPE "Release")
endif()

set(OPENCV_BIN_SOURCE "${OPENCV_BUILD_DIR}/bin")
if (MSVC)
set(OPENCV_BIN_SOURCE "${OPENCV_BUILD_DIR}/bin/$<CONFIG>")
endif()

add_custom_command(TARGET Graph_Build POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${OPENCV_BUILD_DIR}/bin/."
"${OPENCV_BIN_SOURCE}"
"${CMAKE_BINARY_DIR}/bin/")
endif()

if (WIN32)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
set(CMAKE_BUILD_TYPE "Debug")
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
set(CMAKE_BUILD_TYPE "Release")
endif()
add_custom_command(TARGET ACC POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${OPENCV_BUILD_DIR}/bin/."
"${OPENCV_BIN_SOURCE}"
"${CMAKE_BINARY_DIR}/bin/")
endif()

Expand Down
1 change: 0 additions & 1 deletion app/Graph/acc_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <sstream>
#include <unordered_map>

#include "build.cpp"
#include "build.hpp"

namespace fs = std::filesystem;
Expand Down
9 changes: 9 additions & 0 deletions app/Graph/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

using namespace it_lab_ai;

bool LayerFactory::onednn_ = false;

std::unordered_map<std::string, std::string> model_paths = {
{"alexnet_mnist", MODEL_PATH_H5},
{"googlenet", MODEL_PATH_GOOGLENET_ONNX},
{"resnet", MODEL_PATH_RESNET_ONNX},
{"densenet", MODEL_PATH_DENSENET_ONNX},
{"yolo", MODEL_PATH_YOLO11NET_ONNX}};

Graph build_graph_linear(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
bool comments) {
if (comments) {
Expand Down
9 changes: 1 addition & 8 deletions app/Graph/build.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@
#include "layers/TransposeLayer.hpp"
#include "layers_oneDNN/EWLayer.hpp"

std::unordered_map<std::string, std::string> model_paths = {
{"alexnet_mnist", MODEL_PATH_H5},
{"googlenet", MODEL_PATH_GOOGLENET_ONNX},
{"resnet", MODEL_PATH_RESNET_ONNX},
{"densenet", MODEL_PATH_DENSENET_ONNX},
{"yolo", MODEL_PATH_YOLO11NET_ONNX}};
extern std::unordered_map<std::string, std::string> model_paths;

struct ParseResult {
std::vector<std::shared_ptr<it_lab_ai::Layer>> layers;
Expand Down Expand Up @@ -94,6 +89,4 @@ class LayerFactory {
}
};

bool LayerFactory::onednn_ = false;

} // namespace it_lab_ai
1 change: 0 additions & 1 deletion app/Graph/graph_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <numeric>
#include <unordered_map>

#include "build.cpp"
#include "build.hpp"

namespace fs = std::filesystem;
Expand Down
10 changes: 10 additions & 0 deletions cmake/opencv_config.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
set(OPENCV_BUILD_DIR "${CMAKE_BINARY_DIR}/3rdparty/opencv_build")
file(MAKE_DIRECTORY "${OPENCV_BUILD_DIR}")

set(_opencv_bin_dir "${OPENCV_BUILD_DIR}/bin")
file(MAKE_DIRECTORY "${_opencv_bin_dir}")
if (WIN32)
foreach(_cfg Debug Release RelWithDebInfo MinSizeRel)
file(MAKE_DIRECTORY "${_opencv_bin_dir}/${_cfg}")
endforeach()
endif()

unset(_opencv_bin_dir)

execute_process(
COMMAND ${CMAKE_COMMAND}
-S "${CMAKE_SOURCE_DIR}/3rdparty/opencv"
Expand Down
6 changes: 5 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ if (NOT CMAKE_BUILD_TYPE)
endif()

if (WIN32)
set(OPENCV_BIN_SOURCE "${OPENCV_BUILD_DIR}/bin")
if (MSVC)
set(OPENCV_BIN_SOURCE "${OPENCV_BUILD_DIR}/bin/$<CONFIG>")
endif()
add_custom_command(TARGET run_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${OPENCV_BUILD_DIR}/bin/."
"${OPENCV_BIN_SOURCE}"
"${CMAKE_BINARY_DIR}/bin/")
endif()

Expand Down
Loading