Skip to content

Commit

Permalink
[OS][ww32] - Upstreaming compiler repository (#37)
Browse files Browse the repository at this point in the history
* [OS][ww32] - Publish new content

* [OS][ww32] - Publish new content - fix cmake build
  • Loading branch information
DariaMityagina authored Aug 9, 2024
1 parent 81f44e4 commit 593bbd4
Show file tree
Hide file tree
Showing 3,873 changed files with 90,192 additions and 68,678 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 0 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ Aids the generation of release notes
- [ ] BUG
- [ ] Feature

## Related PRs

* [PR-xxx](https://github.com/intel-innersource/applications.ai.vpu-accelerators.vpux-plugin/pull/xxx) description

## Code Review Survey (Copy and Complete in your code review)

- number_minutes_spent_on_review[0]
Expand Down
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ if (ENABLE_NPU_MONO)
set (NPU_MONO_ROOT ${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/..)
endif()

find_package(OpenVINODeveloperPackage REQUIRED
PATHS "${InferenceEngineDeveloperPackage_DIR}")
find_package(OpenVINODeveloperPackage REQUIRED)

get_directory_property(defs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
set(OV_BUILD_POSTFIX_VAR)
Expand All @@ -90,7 +89,7 @@ include(cmake/embed_bin_file.cmake)
include(cmake/add_tool_target.cmake)
include(cmake/coverage.cmake)

if(ENABLE_TESTS)
if(ENABLE_PRIVATE_TESTS)
enable_testing()
endif()

Expand Down Expand Up @@ -158,7 +157,7 @@ endif()

add_subdirectory(src)

if(ENABLE_TESTS)
if(ENABLE_PRIVATE_TESTS)
include(cmake/lit_tests.cmake)
add_subdirectory(tests)
endif()
Expand Down
143 changes: 142 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"hidden": true,
"cacheVariables": {
"ENABLE_TESTS": true,
"ENABLE_PRIVATE_TESTS": true,
"ENABLE_FUNCTIONAL_TESTS": true
}
},
Expand Down Expand Up @@ -109,10 +110,35 @@

"CMAKE_EXPORT_COMPILE_COMMANDS" : true,

"ENABLE_DEVELOPER_BUILD": true,
"ENABLE_IMD_BACKEND": false,

"ENABLE_VPUX_DOCS": false
}
},
{
"name": "vpuxRelWithDebInfoDeveloper",
"description": "Release with debug info configuration preset for VPUX Compiler development. Enables VPUX compiler and generic OV tests, and disables plugin specific builds. Also, enables IMD backend",
"inherits": ["BuildOptimization", "EnableTests", "Disabler"],
"binaryDir": "${sourceDir}/build-x86_64/RelWithDebInfo",
"displayName": "vpuxRelWithDebInfoDeveloper",

"cacheVariables": {
"OpenVINODeveloperPackage_DIR": {
"type": "FILEPATH",
"value": "$env{OPENVINO_HOME}/build-x86_64/RelWithDebInfo"
},

"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "RelWithDebInfo"
},

"CMAKE_EXPORT_COMPILE_COMMANDS" : true,

"ENABLE_DEVELOPER_BUILD": true,
"ENABLE_IMD_BACKEND": true,

"ENABLE_ZEROAPI_BACKEND": true,
"ENABLE_VPUX_DOCS": false
}
},
Expand Down Expand Up @@ -163,6 +189,7 @@
"ENABLE_OPENCV": true,

"ENABLE_TESTS": true,
"ENABLE_PRIVATE_TESTS": true,
"ENABLE_FUNCTIONAL_TESTS": true,

"OPENVINO_EXTRA_MODULES": {
Expand All @@ -185,6 +212,120 @@
"binaryDir": "${sourceDir}/build-x86_64/Release",
"displayName": "ovVpuxRelease",
"inherits": ["OpenVINOWithVPUX", "vpuxRelease"]
},

{
"name": "Cid",
"hidden": true,
"description": "Cid build necessary options. Please note the path of NPU plugin when use.",
"cacheVariables": {
"BUILD_SHARED_LIBS": false,
"ENABLE_OV_IR_FRONTEND": true,
"THREADING": {
"type": "STRING",
"value": "TBB"
},
"ENABLE_TBBBIND_2_5": false,
"BUILD_COMPILER_FOR_DRIVER": true,

"OPENVINO_EXTRA_MODULES": {
"type": "FILEPATH",
"value": "$env{NPU_PLUGIN_HOME}"
}
}
},
{
"name": "NpuCidRelease",
"description": "Default configuration for NPU Driver Compiler target build. Please note: 1) Please make sure that NPU_PLUGIN_HOME environment variable is set to NPU plugin path. 2) build Cid is a static build which only build related targets and not include other unrelated options and targets to avoid getting big generated files.",
"binaryDir": "${sourceDir}/build-x86_64/Release",
"displayName": "NpuCidRelease",
"inherits": ["Cid", "BuildOptimization", "Disabler"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Release"
},

"ENABLE_MULTI": false,
"ENABLE_AUTO": false,
"ENABLE_AUTO_BATCH": false,
"ENABLE_PROXY": false,
"ENABLE_HETERO": false,
"ENABLE_INTEL_CPU": false,
"ENABLE_INTEL_GPU": false,
"ENABLE_TEMPLATE": false,

"ENABLE_OV_ONNX_FRONTEND": false,
"ENABLE_OV_PADDLE_FRONTEND": false,
"ENABLE_OV_PYTORCH_FRONTEND": false,
"ENABLE_OV_TF_FRONTEND": false,
"ENABLE_OV_TF_LITE_FRONTEND": false,

"ENABLE_OPENCV": false,

"ENABLE_BLOB_DUMP": false,
"ENABLE_TESTS": false,
"ENABLE_FUNCTIONAL_TESTS": false,

"ENABLE_SYSTEM_TBB": false,
"ENABLE_TBB_RELEASE_ONLY": false,
"ENABLE_JS": false,
"ENABLE_NPU_PROTOPIPE": false
}
},
{
"name": "ovNpuCidRelease",
"description": "Default configuration for NPU Driver Compiler target build. Please note: 1) it builds NPU plugin in OpenVINO project tree. Please make sure that NPU plugin is located inside OpenVINO repo in modules/vpux folder. 2) build Cid is a static build which only build related targets and not include other unrelated options and targets to avoid getting big generated files.",
"binaryDir": "${sourceDir}/build-x86_64/Release",
"displayName": "ovNpuCidRelease",
"inherits": ["Cid", "BuildOptimization", "Disabler"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Release"
},

"ENABLE_MULTI": false,
"ENABLE_AUTO": false,
"ENABLE_AUTO_BATCH": false,
"ENABLE_PROXY": false,
"ENABLE_HETERO": false,
"ENABLE_INTEL_CPU": false,
"ENABLE_INTEL_GPU": false,
"ENABLE_TEMPLATE": false,

"ENABLE_OV_ONNX_FRONTEND": false,
"ENABLE_OV_PADDLE_FRONTEND": false,
"ENABLE_OV_PYTORCH_FRONTEND": false,
"ENABLE_OV_TF_FRONTEND": false,
"ENABLE_OV_TF_LITE_FRONTEND": false,

"ENABLE_OPENCV": false,

"ENABLE_BLOB_DUMP": false,
"ENABLE_TESTS": false,
"ENABLE_FUNCTIONAL_TESTS": false,

"ENABLE_SYSTEM_TBB": false,
"ENABLE_TBB_RELEASE_ONLY": false,
"ENABLE_JS": false,
"ENABLE_NPU_PROTOPIPE": false,

"OPENVINO_EXTRA_MODULES": {
"type": "FILEPATH",
"value": "./modules/vpux"
}
}
},
{
"name": "npuFuzzingBuild",
"displayName": "npuFuzzingBuild",
"inherits": ["vpuxDeveloper", "EnableClang", "NinjaClangColors", "LinkerLLD"],
"cacheVariables": {
"ENABLE_SANITIZER": true,
"ENABLE_FUZZING": true,
"ENABLE_NPU_FUZZ_TESTS": true
}
}
],
"testPresets": [
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 Intel Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions SourcePackageConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"^/\\.editorconfig*",
"^/\\.infrastructure/.*",
"^/\\.vscode/.*",
"^/artifacts/.*",
"^/cmake/dependencies\\.cmake",
"^/cmake/source_package\\.cmake",
"^/cmake/lit.*",
Expand Down Expand Up @@ -36,6 +37,7 @@
"^/guides/how-to-use-profiling.md",
"^/guides/how-to-use-tbh-bypass.md",

"^/sw_runtime_kernels/jtag_tests/.*",
"^/sw_runtime_kernels/firmware_vpu_revision\\.txt",
"^/sw_runtime_kernels/kernels/3720/.*",
"^/sw_runtime_kernels/kernels/act_runtime/.*",
Expand Down
24 changes: 0 additions & 24 deletions cmake/compile_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,30 +94,6 @@ function(enable_warnings_as_errors TARGET_NAME)
endif()
endfunction()

# Links provided libraries and include their INTERFACE_INCLUDE_DIRECTORIES as SYSTEM
function(link_system_libraries TARGET_NAME)
set(MODE PRIVATE)

foreach(arg IN LISTS ARGN)
if(arg MATCHES "(PRIVATE|PUBLIC|INTERFACE)")
set(MODE ${arg})
else()
if(TARGET "${arg}")
target_include_directories(${TARGET_NAME}
SYSTEM ${MODE}
$<TARGET_PROPERTY:${arg},INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:${arg},INTERFACE_SYSTEM_INCLUDE_DIRECTORIES>
)
endif()

target_link_libraries(${TARGET_NAME}
${MODE}
${arg}
)
endif()
endforeach()
endfunction()

macro(set_llvm_flags)
set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "")
set(LLVM_ENABLE_BINDINGS OFF CACHE BOOL "" FORCE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/embed_shave_binaries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function(create_resources dir output)
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," filedata ${filedata})
# Append data to output file
file(APPEND ${output} "static const uint8_t ${filename}[] = {${filedata}};\n")
string(APPEND map_sym "{\"${filename}\", {${filename}, ${hex_string_length}}},\n")
string(APPEND map_sym "{\"${filename}\", {${filename}, sizeof(${filename})}},\n")
endif()
endforeach()

Expand Down
13 changes: 10 additions & 3 deletions cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@
# SPDX-License-Identifier: Apache 2.0
#

# private tests should be disabled when building in OV CI
if(NOT ENABLE_TESTS)
set(ENABLE_TESTS OFF)
set(ENABLE_PRIVATE_TESTS OFF)
else()
if (NOT ENABLE_PRIVATE_TESTS AND ${PROJECT_BINARY_DIR} MATCHES "build-modules")
set(ENABLE_PRIVATE_TESTS OFF)
else()
set(ENABLE_PRIVATE_TESTS ON)
endif()
endif()
ov_dependent_option(ENABLE_TESTS "Unit, behavior and functional tests" ${ENABLE_TESTS} "ENABLE_TESTS" OFF)
ov_option(ENABLE_PRIVATE_TESTS "NPU private unit, behavior and functional tests" OFF)

ov_dependent_option(ENABLE_VPUX_FUZZ_TESTS "NPU Fuzz tests" OFF "ENABLE_TESTS" OFF)
ov_dependent_option(ENABLE_NPU_FUZZ_TESTS "NPU Fuzz tests" OFF "ENABLE_TESTS" OFF)

if(NOT ENABLE_LTO)
set(ENABLE_LTO OFF)
Expand Down
4 changes: 1 addition & 3 deletions src/vpux_compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,9 @@ target_link_libraries(${COMPILER_TARGET}
PRIVATE
npu_profiling_utils
)
link_system_libraries(${COMPILER_TARGET}
ov_link_system_libraries(${COMPILER_TARGET}
PRIVATE
openvino::reference
openvino::runtime
openvino::runtime::dev
)
target_link_libraries(${COMPILER_TARGET} PUBLIC ${VPU_SRC_LIBS})

Expand Down
Loading

0 comments on commit 593bbd4

Please sign in to comment.