Skip to content

Commit 815eaff

Browse files
committed
Revert "Make serial parallel_for "polyfill" iterate backwards in debug builds (#9044)"
This reverts commit 8f7bc8d. ghstack-source-id: 83550a9616451cfc8b399607721e65db18dffce8 ghstack-comment-id: 2718557697 Pull Request resolved: #9188
1 parent 10bb615 commit 815eaff

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

runtime/kernel/targets.bzl

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def define_common_targets():
5656
exported_headers = ["thread_parallel_interface.h"],
5757
exported_deps = [
5858
"//executorch/runtime/core:core",
59-
"//executorch/runtime/core/portable_type/c10/c10:c10",
6059
"//executorch/runtime/platform:platform",
6160
],
6261
visibility = [

runtime/kernel/thread_parallel_interface.h

-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <cstdint>
1212
#include <functional>
1313

14-
#include <c10/util/irange.h>
1514
#include <executorch/runtime/core/error.h>
1615
#include <executorch/runtime/platform/assert.h>
1716

@@ -30,17 +29,7 @@ inline bool parallel_for_no_threadpool(
3029
begin,
3130
end);
3231
ET_CHECK_OR_RETURN_FALSE(grain_size > 0, "grain_size = %" PRId64, grain_size);
33-
#ifndef NDEBUG
34-
// Go backwards through the range elementwise to catch code that
35-
// assumes parallel_for is in order like a regular for loop.
36-
for (const auto i : c10::irange(begin, end)) {
37-
const auto offset = i - begin;
38-
const auto idx = end - offset - 1;
39-
f(idx, idx + 1);
40-
}
41-
#else // NDEBUG
4232
f(begin, end);
43-
#endif
4433
return true;
4534
}
4635

0 commit comments

Comments
 (0)