Skip to content

Commit d4b7578

Browse files
committed
Update
[ghstack-poisoned]
1 parent fb432fa commit d4b7578

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

extension/threadpool/thread_parallel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bool parallel_for(
5454
const int64_t begin,
5555
const int64_t end,
5656
const int64_t grain_size,
57-
const std::function<void(int64_t, int64_t)>& f) {
57+
runtime::FunctionRef<void(int64_t, int64_t)> f) {
5858
ET_CHECK_OR_RETURN_FALSE(
5959
begin >= 0 && end >= 0 && end >= begin,
6060
"begin = %" PRId64 ", end = %" PRId64,

runtime/kernel/thread_parallel_interface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <c10/util/irange.h>
1515
#include <executorch/runtime/core/error.h>
16+
#include <executorch/runtime/core/function_ref.h>
1617
#include <executorch/runtime/platform/assert.h>
1718

1819
namespace executorch {
@@ -69,7 +70,7 @@ bool parallel_for(
6970
const int64_t begin,
7071
const int64_t end,
7172
const int64_t grain_size,
72-
const std::function<void(int64_t, int64_t)>& f);
73+
runtime::FunctionRef<void(int64_t, int64_t)> f);
7374

7475
int64_t get_thread_num();
7576

0 commit comments

Comments
 (0)