-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move threads spawning from cpu_module to runtime * Add thread affinity * Disable macos thread affinity * Fix macos thread affinity * Change nncase_cpu_runtime to OBJECT * Link pthread * Init cpu_mt * Fix win * Add cid * Use pthread key on Mac * Fix win&linux * Apply code-format changes --------- Co-authored-by: sunnycase <sunnycase@users.noreply.github.com>
- Loading branch information
Showing
30 changed files
with
462 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/compile_flags.cmake) | ||
|
||
if (BUILD_STANDALONE) | ||
add_executable(nncase_ntt_module ${CMAKE_CURRENT_LIST_DIR}/../src/dummy.cpp) | ||
else() | ||
add_library(nncase_ntt_module SHARED ${CMAKE_CURRENT_LIST_DIR}/../src/dummy.cpp) | ||
endif() | ||
|
||
target_compile_features(nncase_ntt_module PUBLIC cxx_std_20) | ||
target_include_directories(nncase_ntt_module PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../include) | ||
set_target_properties(nncase_ntt_module PROPERTIES PREFIX "" SUFFIX "") | ||
set_target_properties(nncase_ntt_module PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
target_compile_definitions(nncase_ntt_module PUBLIC -DNNCASE_CPU_MODULE=1) | ||
|
||
target_sources(nncase_ntt_module PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../src/cpu_runtime.cpp) | ||
|
||
if (BUILD_STANDALONE) | ||
target_compile_definitions(nncase_ntt_module PUBLIC -DNNCASE_STANDALONE=1) | ||
endif() | ||
|
||
if (MSVC) | ||
set_property(TARGET nncase_ntt_module PROPERTY | ||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
set_target_properties(nncase_ntt_module PROPERTIES LINK_FLAGS /SUBSYSTEM:CONSOLE) | ||
target_link_options(nncase_ntt_module PRIVATE /NODEFAULTLIB) | ||
target_link_libraries(nncase_ntt_module PRIVATE "libvcruntime$<$<CONFIG:Debug>:d>" | ||
"msvcrt$<$<CONFIG:Debug>:d>" | ||
"ucrt$<$<CONFIG:Debug>:d>" | ||
"libcpmt$<$<CONFIG:Debug>:d>") | ||
elseif(APPLE) | ||
target_link_options(nncase_ntt_module PRIVATE -ld_classic -lc) | ||
endif() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.