Skip to content

Commit ae2836a

Browse files
UD08 OpenSource Release (#19)
* code update ud44 os release * by bind * added missing files * prepared code for ud48 * removed all NPU5 embargo tags from .h .cpp files and cmake files (ud48 update) * deleted file (was a local file) * UD08 code
1 parent bbdb8b7 commit ae2836a

File tree

143 files changed

+5899
-23744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+5899
-23744
lines changed

.gitattributes

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
*.vpunn filter=lfs diff=lfs merge=lfs -text
2-
*.dmann filter=lfs diff=lfs merge=lfs -text
3-
models/vpu_4_0.vpunn filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,5 @@ doxy.warn
159159
/.vscode
160160
/build2
161161
_skbuild
162+
_codeql_build_dir/
163+
_codeql_detected_source_root

CMakeLists.txt

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,22 @@ option(GENERATE_PYTHON_BINDING "Generate the python bindings code" OFF)
4141
option(VPUNN_BUILD_HTTP_CLIENT "Build support for cost provider http service" OFF)
4242
option(VPUNN_OPT_LEGACY_ZTILING "Use legacy ZTiling mechanism" ON)
4343
option(VPUNN_OPT_LEGACY_DMA_TH_4 "Use legacy Theoretical DMA for Gen4" OFF)
44-
option(ENABLE_FLATBUFFERS_INSTALLATION "Install flatbuffers and its dependency ProjectConfig" ON)
4544

4645
# Detect JavaScript build env
4746
if(DEFINED ENV{EMSDK} AND DEFINED ENV{EMSCRIPTEN})
48-
set(JS_BUILD ON)
49-
else()
50-
set(JS_BUILD OFF)
47+
message(STATUS "VPUNN -- JavaScript support was removed from Cost Model interface")
5148
endif()
49+
set(JS_BUILD OFF) # Explicitly set to OFF since JS build is no longer supported
5250

5351
# Global settings
5452
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
5553
set(COST_MODEL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
5654
set(COST_MODEL_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
5755
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/external)
5856

57+
# Add cmake directory to module path for consistent cmake/<cmake_module> includes
58+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
59+
5960
# Output directory setup
6061
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
6162
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
@@ -64,7 +65,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
6465
# Flatbuffers is included in the root because subdirectories
6566
# and directories of subdirectories needs this target and
6667
# certain flatbuffers variables.
67-
include(cmake/FlatbuffersSetup.cmake)
68+
include(cmake/FlatbuffersSetup)
6869

6970
# Common settings library
7071
# Consumer libs should always link this as PRIVATE to avoid transitive propagation.
@@ -75,7 +76,6 @@ target_sources(vpunn_common_settings PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/com
7576
# Apply C++ standard requirement to this target and (optionally) to dependents
7677
target_compile_features(vpunn_common_settings PUBLIC cxx_std_17)
7778

78-
7979
if(VPUNN_OPT_LEGACY_DMA_TH_4)
8080
target_compile_definitions(vpunn_common_settings PUBLIC VPUNN_OPT_LEGACY_DMA_TH_4)
8181
message(STATUS "-- Enable Legacy Gen4 DMA Theoretical")
@@ -116,45 +116,43 @@ if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
116116
endif()
117117
endif()
118118

119-
# Non JS builds
120-
if(NOT JS_BUILD)
121-
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
122-
# lots of warnings and all warnings as errors
123-
message(STATUS "Setting GCC/Clang specific flags for common settings")
124-
target_compile_options(vpunn_common_settings PUBLIC
125-
-Wall -Wextra -Werror -pedantic -Wdouble-promotion -Wfloat-conversion
126-
$<$<CONFIG:Debug>:-g>
127-
$<$<CONFIG:Release>:-O3>
128-
)
129-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
130-
message(STATUS "Setting Visual Studio specific flags for common settings")
131-
target_compile_options(vpunn_common_settings PUBLIC
132-
# Enable /bigobj for debug build type with MSVC - remove after vpunn headers are cleaned up
133-
$<$<CONFIG:Debug>:/bigobj>
134-
/W4 /WX
135-
)
136-
# TODO figure out why it propagates to VPUx even though it is linked as PRIVATE in other libs
137-
# and re-enable
138-
# target_link_options(vpunn_common_settings PUBLIC
139-
# /WX
140-
# )
141-
142-
# Disable dll build
143-
set(VPUNN_BUILD_SHARED_LIB OFF)
144-
else()
145-
message(WARNING "-- Building with unrecognised compiler, not setting any specific flags")
146-
endif()
119+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
120+
# lots of warnings and all warnings as errors
121+
message(STATUS "Setting GCC/Clang specific flags for common settings")
122+
target_compile_options(vpunn_common_settings PUBLIC
123+
-Wall -Wextra -Werror -pedantic -Wdouble-promotion -Wfloat-conversion
124+
$<$<CONFIG:Debug>:-g>
125+
$<$<CONFIG:Release>:-O3>
126+
)
127+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
128+
message(STATUS "Setting Visual Studio specific flags for common settings")
129+
target_compile_options(vpunn_common_settings PUBLIC
130+
# Enable /bigobj for debug build type with MSVC - remove after vpunn headers are cleaned up
131+
$<$<CONFIG:Debug>:/bigobj>
132+
/W4 /WX
133+
)
134+
# TODO figure out why it propagates to VPUx even though it is linked as PRIVATE in other libs
135+
# and re-enable
136+
# target_link_options(vpunn_common_settings PUBLIC
137+
# /WX
138+
# )
139+
140+
# Disable dll build
141+
set(VPUNN_BUILD_SHARED_LIB OFF)
142+
else()
143+
message(WARNING "-- Building with unrecognised compiler, not setting any specific flags")
147144
endif()
148145

146+
149147
# Add subdirectories
150148
add_subdirectory(src)
151-
add_subdirectory(js)
152149

153150
# Optional subdirectories based on build options
154151
if(VPUNN_BUILD_EXAMPLES)
155152
add_subdirectory(example)
156153
endif()
157154

155+
158156
if(VPUNN_BUILD_APPS)
159157
add_subdirectory(apps/cache_app)
160158
endif()

0 commit comments

Comments
 (0)