Skip to content

Commit 9fdcd39

Browse files
alexander-shaposhnikovxnnpack-bot
authored andcommitted
Add PTHREADPOOL_NO_SANITIZE_FUNCTION macro.
PiperOrigin-RevId: 907968741
1 parent 85d1718 commit 9fdcd39

7 files changed

Lines changed: 267 additions & 218 deletions

File tree

BUILD.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
# This source code is licensed under the BSD-style license found in the
88
# LICENSE file in the root directory of this source tree.
99

10-
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
10+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
11+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
12+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
1113

1214
licenses(["notice"])
1315

MODULE.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ module(
44
)
55

66
# Bazel rule definitions
7-
bazel_dep(name = "rules_cc", version = "0.1.1")
7+
bazel_dep(name = "rules_cc", version = "0.2.17")
88
bazel_dep(name = "rules_license", version = "1.0.0")
9-
bazel_dep(name = "rules_python", version = "1.0.0")
9+
bazel_dep(name = "rules_python", version = "1.7.0")
1010

1111
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
1212
pip.parse(
@@ -17,10 +17,10 @@ pip.parse(
1717
use_repo(pip, "pip")
1818

1919
# Bazel Skylib.
20-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
20+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
2121

2222
# Bazel Platforms
23-
bazel_dep(name = "platforms", version = "0.0.10")
23+
bazel_dep(name = "platforms", version = "1.0.0")
2424

2525
# TODO: some (most? all?) of the http_archive() calls below could become bazel_dep() calls,
2626
# but it would require verifying that the semver provided by the Bazel registry matches the hash

WORKSPACE

Lines changed: 0 additions & 44 deletions
This file was deleted.

include/pthreadpool.h

Lines changed: 114 additions & 95 deletions
Large diffs are not rendered by default.

src/fastpath.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "threadpool-object.h"
3232
#include "threadpool-utils.h"
3333

34-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_1d_fastpath(
34+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_1d_fastpath(
3535
struct pthreadpool* threadpool, struct thread_info* thread) {
3636
assert(threadpool != NULL);
3737
assert(thread != NULL);
@@ -68,7 +68,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_1d_fastpath(
6868
pthreadpool_fence_release();
6969
}
7070

71-
PTHREADPOOL_INTERNAL void
71+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
7272
pthreadpool_thread_parallelize_1d_with_thread_fastpath(
7373
struct pthreadpool* threadpool, struct thread_info* thread) {
7474
assert(threadpool != NULL);
@@ -107,7 +107,7 @@ pthreadpool_thread_parallelize_1d_with_thread_fastpath(
107107
pthreadpool_fence_release();
108108
}
109109

110-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_1d_with_uarch_fastpath(
110+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_1d_with_uarch_fastpath(
111111
struct pthreadpool* threadpool, struct thread_info* thread) {
112112
assert(threadpool != NULL);
113113
assert(thread != NULL);
@@ -157,7 +157,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_1d_with_uarch_fastpath(
157157
pthreadpool_fence_release();
158158
}
159159

160-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_1d_tile_1d_fastpath(
160+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_1d_tile_1d_fastpath(
161161
struct pthreadpool* threadpool, struct thread_info* thread) {
162162
assert(threadpool != NULL);
163163
assert(thread != NULL);
@@ -202,7 +202,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_1d_tile_1d_fastpath(
202202
pthreadpool_fence_release();
203203
}
204204

205-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_2d_fastpath(
205+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_2d_fastpath(
206206
struct pthreadpool* threadpool, struct thread_info* thread) {
207207
assert(threadpool != NULL);
208208
assert(thread != NULL);
@@ -253,7 +253,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_2d_fastpath(
253253
pthreadpool_fence_release();
254254
}
255255

256-
PTHREADPOOL_INTERNAL void
256+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
257257
pthreadpool_thread_parallelize_2d_with_thread_fastpath(
258258
struct pthreadpool* threadpool, struct thread_info* thread) {
259259
assert(threadpool != NULL);
@@ -306,7 +306,7 @@ pthreadpool_thread_parallelize_2d_with_thread_fastpath(
306306
pthreadpool_fence_release();
307307
}
308308

309-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_2d_tile_1d_fastpath(
309+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_2d_tile_1d_fastpath(
310310
struct pthreadpool* threadpool, struct thread_info* thread) {
311311
assert(threadpool != NULL);
312312
assert(thread != NULL);
@@ -363,7 +363,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_2d_tile_1d_fastpath(
363363
pthreadpool_fence_release();
364364
}
365365

366-
PTHREADPOOL_INTERNAL void
366+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
367367
pthreadpool_thread_parallelize_2d_tile_1d_with_uarch_fastpath(
368368
struct pthreadpool* threadpool, struct thread_info* thread) {
369369
assert(threadpool != NULL);
@@ -435,7 +435,7 @@ pthreadpool_thread_parallelize_2d_tile_1d_with_uarch_fastpath(
435435
pthreadpool_fence_release();
436436
}
437437

438-
PTHREADPOOL_INTERNAL void
438+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
439439
pthreadpool_thread_parallelize_2d_tile_1d_with_uarch_with_thread_fastpath(
440440
struct pthreadpool* threadpool, struct thread_info* thread) {
441441
assert(threadpool != NULL);
@@ -508,7 +508,7 @@ pthreadpool_thread_parallelize_2d_tile_1d_with_uarch_with_thread_fastpath(
508508
pthreadpool_fence_release();
509509
}
510510

511-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_2d_tile_2d_fastpath(
511+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_2d_tile_2d_fastpath(
512512
struct pthreadpool* threadpool, struct thread_info* thread) {
513513
assert(threadpool != NULL);
514514
assert(thread != NULL);
@@ -569,7 +569,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_2d_tile_2d_fastpath(
569569
pthreadpool_fence_release();
570570
}
571571

572-
PTHREADPOOL_INTERNAL void
572+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
573573
pthreadpool_thread_parallelize_2d_tile_2d_with_uarch_fastpath(
574574
struct pthreadpool* threadpool, struct thread_info* thread) {
575575
assert(threadpool != NULL);
@@ -647,7 +647,7 @@ pthreadpool_thread_parallelize_2d_tile_2d_with_uarch_fastpath(
647647
pthreadpool_fence_release();
648648
}
649649

650-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_3d_fastpath(
650+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_3d_fastpath(
651651
struct pthreadpool* threadpool, struct thread_info* thread) {
652652
assert(threadpool != NULL);
653653
assert(thread != NULL);
@@ -709,7 +709,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_3d_fastpath(
709709
pthreadpool_fence_release();
710710
}
711711

712-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_3d_tile_1d_fastpath(
712+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_3d_tile_1d_fastpath(
713713
struct pthreadpool* threadpool, struct thread_info* thread) {
714714
assert(threadpool != NULL);
715715
assert(thread != NULL);
@@ -776,7 +776,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_3d_tile_1d_fastpath(
776776
pthreadpool_fence_release();
777777
}
778778

779-
PTHREADPOOL_INTERNAL void
779+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
780780
pthreadpool_thread_parallelize_3d_tile_1d_with_thread_fastpath(
781781
struct pthreadpool* threadpool, struct thread_info* thread) {
782782
assert(threadpool != NULL);
@@ -845,7 +845,7 @@ pthreadpool_thread_parallelize_3d_tile_1d_with_thread_fastpath(
845845
pthreadpool_fence_release();
846846
}
847847

848-
PTHREADPOOL_INTERNAL void
848+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
849849
pthreadpool_thread_parallelize_3d_tile_1d_with_uarch_fastpath(
850850
struct pthreadpool* threadpool, struct thread_info* thread) {
851851
assert(threadpool != NULL);
@@ -927,7 +927,7 @@ pthreadpool_thread_parallelize_3d_tile_1d_with_uarch_fastpath(
927927
pthreadpool_fence_release();
928928
}
929929

930-
PTHREADPOOL_INTERNAL void
930+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
931931
pthreadpool_thread_parallelize_3d_tile_1d_with_uarch_with_thread_fastpath(
932932
struct pthreadpool* threadpool, struct thread_info* thread) {
933933
assert(threadpool != NULL);
@@ -1010,7 +1010,7 @@ pthreadpool_thread_parallelize_3d_tile_1d_with_uarch_with_thread_fastpath(
10101010
pthreadpool_fence_release();
10111011
}
10121012

1013-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_3d_tile_2d_fastpath(
1013+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_3d_tile_2d_fastpath(
10141014
struct pthreadpool* threadpool, struct thread_info* thread) {
10151015
assert(threadpool != NULL);
10161016
assert(thread != NULL);
@@ -1082,7 +1082,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_3d_tile_2d_fastpath(
10821082
pthreadpool_fence_release();
10831083
}
10841084

1085-
PTHREADPOOL_INTERNAL void
1085+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
10861086
pthreadpool_thread_parallelize_3d_tile_2d_with_uarch_fastpath(
10871087
struct pthreadpool* threadpool, struct thread_info* thread) {
10881088
assert(threadpool != NULL);
@@ -1171,7 +1171,7 @@ pthreadpool_thread_parallelize_3d_tile_2d_with_uarch_fastpath(
11711171
pthreadpool_fence_release();
11721172
}
11731173

1174-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_4d_fastpath(
1174+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_4d_fastpath(
11751175
struct pthreadpool* threadpool, struct thread_info* thread) {
11761176
assert(threadpool != NULL);
11771177
assert(thread != NULL);
@@ -1244,7 +1244,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_4d_fastpath(
12441244
pthreadpool_fence_release();
12451245
}
12461246

1247-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_4d_tile_1d_fastpath(
1247+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_4d_tile_1d_fastpath(
12481248
struct pthreadpool* threadpool, struct thread_info* thread) {
12491249
assert(threadpool != NULL);
12501250
assert(thread != NULL);
@@ -1322,7 +1322,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_4d_tile_1d_fastpath(
13221322
pthreadpool_fence_release();
13231323
}
13241324

1325-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_4d_tile_2d_fastpath(
1325+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_4d_tile_2d_fastpath(
13261326
struct pthreadpool* threadpool, struct thread_info* thread) {
13271327
assert(threadpool != NULL);
13281328
assert(thread != NULL);
@@ -1404,7 +1404,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_4d_tile_2d_fastpath(
14041404
pthreadpool_fence_release();
14051405
}
14061406

1407-
PTHREADPOOL_INTERNAL void
1407+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void
14081408
pthreadpool_thread_parallelize_4d_tile_2d_with_uarch_fastpath(
14091409
struct pthreadpool* threadpool, struct thread_info* thread) {
14101410
assert(threadpool != NULL);
@@ -1504,7 +1504,7 @@ pthreadpool_thread_parallelize_4d_tile_2d_with_uarch_fastpath(
15041504
pthreadpool_fence_release();
15051505
}
15061506

1507-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_5d_fastpath(
1507+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_5d_fastpath(
15081508
struct pthreadpool* threadpool, struct thread_info* thread) {
15091509
assert(threadpool != NULL);
15101510
assert(thread != NULL);
@@ -1587,7 +1587,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_5d_fastpath(
15871587
pthreadpool_fence_release();
15881588
}
15891589

1590-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_5d_tile_1d_fastpath(
1590+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_5d_tile_1d_fastpath(
15911591
struct pthreadpool* threadpool, struct thread_info* thread) {
15921592
assert(threadpool != NULL);
15931593
assert(thread != NULL);
@@ -1676,7 +1676,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_5d_tile_1d_fastpath(
16761676
pthreadpool_fence_release();
16771677
}
16781678

1679-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_5d_tile_2d_fastpath(
1679+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_5d_tile_2d_fastpath(
16801680
struct pthreadpool* threadpool, struct thread_info* thread) {
16811681
assert(threadpool != NULL);
16821682
assert(thread != NULL);
@@ -1769,7 +1769,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_5d_tile_2d_fastpath(
17691769
pthreadpool_fence_release();
17701770
}
17711771

1772-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_6d_fastpath(
1772+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_6d_fastpath(
17731773
struct pthreadpool* threadpool, struct thread_info* thread) {
17741774
assert(threadpool != NULL);
17751775
assert(thread != NULL);
@@ -1863,7 +1863,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_6d_fastpath(
18631863
pthreadpool_fence_release();
18641864
}
18651865

1866-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_6d_tile_1d_fastpath(
1866+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_6d_tile_1d_fastpath(
18671867
struct pthreadpool* threadpool, struct thread_info* thread) {
18681868
assert(threadpool != NULL);
18691869
assert(thread != NULL);
@@ -1962,7 +1962,7 @@ PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_6d_tile_1d_fastpath(
19621962
pthreadpool_fence_release();
19631963
}
19641964

1965-
PTHREADPOOL_INTERNAL void pthreadpool_thread_parallelize_6d_tile_2d_fastpath(
1965+
PTHREADPOOL_INTERNAL PTHREADPOOL_NO_SANITIZE_FUNCTION void pthreadpool_thread_parallelize_6d_tile_2d_fastpath(
19661966
struct pthreadpool* threadpool, struct thread_info* thread) {
19671967
assert(threadpool != NULL);
19681968
assert(thread != NULL);

0 commit comments

Comments
 (0)