Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,9 @@ endif()

if(EXECUTORCH_BUILD_PTHREADPOOL
AND EXECUTORCH_BUILD_CPUINFO
AND CMAKE_CXX_STANDARD GREATER_EQUAL 14
)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/threadpool)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/parallel)
endif()

if(EXECUTORCH_BUILD_PYBIND)
Expand Down
18 changes: 18 additions & 0 deletions build/cmake_deps.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ excludes = [
deps = [
"executorch",
"executorch_core",
"extension_parallel",
"extension_threadpool",
"portable_kernels",
]
Expand Down Expand Up @@ -115,6 +116,7 @@ excludes = [
deps = [
"executorch_core",
"executorch",
"extension_parallel",
]

[targets.optimized_native_cpu_ops]
Expand All @@ -129,6 +131,8 @@ excludes = [
deps = [
"executorch_core",
"executorch",
"extension_parallel",
"extension_threadpool",
"portable_kernels",
]
# ---------------------------------- core end ----------------------------------
Expand Down Expand Up @@ -208,6 +212,19 @@ deps = [
"extension_runner_util",
]

[targets.extension_parallel]
buck_targets = [
"//extension/parallel:thread_parallel",
]
filters = [
".cpp$",
]
deps = [
"executorch",
"executorch_core",
"extension_threadpool",
]

[targets.extension_tensor]
buck_targets = [
"//extension/tensor:tensor",
Expand Down Expand Up @@ -395,6 +412,7 @@ deps = [
"executorch",
"executorch_core",
"optimized_kernels",
"extension_parallel",
"extension_threadpool",
"xnnpack_backend",
]
Expand Down
25 changes: 25 additions & 0 deletions extension/parallel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# Please keep this file formatted by running:
# ~~~
# cmake-format -i CMakeLists.txt
# ~~~

if(NOT (EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO))
message(FATAL_ERROR "extension/parallel requires extension/threadpool")
endif()

add_library(extension_parallel thread_parallel.cpp)

target_link_libraries(extension_parallel PUBLIC executorch_core extension_threadpool)
target_compile_options(extension_parallel PUBLIC ${_common_compile_options})

install(
TARGETS extension_parallel
DESTINATION lib
INCLUDES
DESTINATION ${_common_include_directories})
2 changes: 1 addition & 1 deletion kernels/optimized/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif()
list(TRANSFORM _optimized_cpublas__srcs PREPEND "${EXECUTORCH_ROOT}/")
add_library(cpublas STATIC ${_optimized_cpublas__srcs})
target_link_libraries(
cpublas PRIVATE executorch_core eigen_blas extension_threadpool
cpublas PRIVATE executorch_core eigen_blas extension_parallel extension_threadpool
)
target_compile_options(cpublas PUBLIC ${_common_compile_options})

Expand Down
Loading