File tree 5 files changed +61
-3
lines changed
5 files changed +61
-3
lines changed Original file line number Diff line number Diff line change @@ -749,9 +749,9 @@ endif()
749
749
750
750
if (EXECUTORCH_BUILD_PTHREADPOOL
751
751
AND EXECUTORCH_BUILD_CPUINFO
752
- AND CMAKE_CXX_STANDARD GREATER_EQUAL 14
753
752
)
754
753
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/threadpool)
754
+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/parallel)
755
755
endif ()
756
756
757
757
if (EXECUTORCH_BUILD_PYBIND)
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ excludes = [
73
73
deps = [
74
74
" executorch" ,
75
75
" executorch_core" ,
76
+ " extension_parallel" ,
76
77
" extension_threadpool" ,
77
78
" portable_kernels" ,
78
79
]
@@ -115,6 +116,7 @@ excludes = [
115
116
deps = [
116
117
" executorch_core" ,
117
118
" executorch" ,
119
+ " extension_parallel" ,
118
120
]
119
121
120
122
[targets .optimized_native_cpu_ops ]
@@ -129,6 +131,8 @@ excludes = [
129
131
deps = [
130
132
" executorch_core" ,
131
133
" executorch" ,
134
+ " extension_parallel" ,
135
+ " extension_threadpool" ,
132
136
" portable_kernels" ,
133
137
]
134
138
# ---------------------------------- core end ----------------------------------
@@ -208,6 +212,19 @@ deps = [
208
212
" extension_runner_util" ,
209
213
]
210
214
215
+ [targets .extension_parallel ]
216
+ buck_targets = [
217
+ " //extension/parallel:thread_parallel" ,
218
+ ]
219
+ filters = [
220
+ " .cpp$" ,
221
+ ]
222
+ deps = [
223
+ " executorch" ,
224
+ " executorch_core" ,
225
+ " extension_threadpool" ,
226
+ ]
227
+
211
228
[targets .extension_tensor ]
212
229
buck_targets = [
213
230
" //extension/tensor:tensor" ,
@@ -395,6 +412,7 @@ deps = [
395
412
" executorch" ,
396
413
" executorch_core" ,
397
414
" optimized_kernels" ,
415
+ " extension_parallel" ,
398
416
" extension_threadpool" ,
399
417
" xnnpack_backend" ,
400
418
]
@@ -431,6 +449,7 @@ deps = [
431
449
" executorch_core" ,
432
450
" extension_data_loader" ,
433
451
" extension_module" ,
452
+ " extension_parallel" ,
434
453
" portable_kernels" ,
435
454
" quantized_kernels" ,
436
455
" xnnpack_backend" ,
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ set(lib_list
67
67
portable_ops_lib
68
68
extension_module
69
69
extension_module_static
70
+ extension_parallel
70
71
extension_runner_util
71
72
extension_tensor
72
73
extension_threadpool
@@ -114,3 +115,16 @@ foreach(lib ${lib_list})
114
115
list (APPEND EXECUTORCH_LIBRARIES ${lib} )
115
116
endif ()
116
117
endforeach ()
118
+
119
+ # TODO: investigate use of install(EXPORT) to cleanly handle
120
+ # target_compile_options/target_compile_definitions for everything.
121
+ if (TARGET extension_parallel)
122
+ set_target_properties (
123
+ extension_parallel PROPERTIES INTERFACE_LINK_LIBRARIES extension_threadpool
124
+ )
125
+ endif ()
126
+ if (TARGET cpublas)
127
+ set_target_properties (
128
+ cpublas PROPERTIES INTERFACE_LINK_LIBRARIES extension_parallel
129
+ )
130
+ endif ()
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+ #
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ # Please keep this file formatted by running:
8
+ # ~~~
9
+ # cmake-format -i CMakeLists.txt
10
+ # ~~~
11
+
12
+ if (NOT (EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO))
13
+ message (FATAL_ERROR "extension/parallel requires extension/threadpool" )
14
+ endif ()
15
+
16
+ add_library (extension_parallel thread_parallel.cpp)
17
+
18
+ target_link_libraries (extension_parallel PUBLIC executorch_core extension_threadpool)
19
+ target_compile_options (extension_parallel PUBLIC ${_common_compile_options} )
20
+
21
+ install (
22
+ TARGETS extension_parallel
23
+ DESTINATION lib
24
+ INCLUDES
25
+ DESTINATION ${_common_include_directories} )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ endif()
43
43
list (TRANSFORM _optimized_cpublas__srcs PREPEND "${EXECUTORCH_ROOT} /" )
44
44
add_library (cpublas STATIC ${_optimized_cpublas__srcs} )
45
45
target_link_libraries (
46
- cpublas PRIVATE executorch_core eigen_blas extension_threadpool
46
+ cpublas PUBLIC executorch_core eigen_blas extension_parallel extension_threadpool
47
47
)
48
48
target_compile_options (cpublas PUBLIC ${_common_compile_options} )
49
49
@@ -63,7 +63,7 @@ list(TRANSFORM _optimized_kernels__srcs PREPEND "${EXECUTORCH_ROOT}/")
63
63
add_library (optimized_kernels ${_optimized_kernels__srcs} )
64
64
target_include_directories (optimized_kernels PRIVATE ${TORCH_INCLUDE_DIRS} "${EXECUTORCH_ROOT} /third-party/pocketfft" )
65
65
target_link_libraries (
66
- optimized_kernels PRIVATE executorch_core cpublas extension_threadpool
66
+ optimized_kernels PUBLIC executorch_core cpublas extension_threadpool
67
67
)
68
68
target_compile_options (optimized_kernels PUBLIC ${_common_compile_options} )
69
69
# Build a library for _optimized_kernels_srcs
You can’t perform that action at this time.
0 commit comments