-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathbinding.gyp
More file actions
178 lines (178 loc) Β· 5.83 KB
/
Copy pathbinding.gyp
File metadata and controls
178 lines (178 loc) Β· 5.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{
"variables": {
"openssl_fips": ""
},
"targets": [
{
"target_name": "numkong",
"sources": [
"javascript/numkong.c",
"c/numkong.c",
"c/parallel.c",
"c/dispatch_f64.c",
"c/dispatch_f32.c",
"c/dispatch_f16.c",
"c/dispatch_bf16.c",
"c/dispatch_i8.c",
"c/dispatch_u8.c",
"c/dispatch_u1.c",
"c/dispatch_e4m3.c",
"c/dispatch_e5m2.c",
"c/dispatch_other.c",
"c/dispatch_f64c.c",
"c/dispatch_f32c.c",
"c/dispatch_f16c.c",
"c/dispatch_bf16c.c",
"c/dispatch_i16.c",
"c/dispatch_i32.c",
"c/dispatch_i64.c",
"c/dispatch_u16.c",
"c/dispatch_u32.c",
"c/dispatch_u64.c",
"c/dispatch_i4.c",
"c/dispatch_u4.c",
"c/dispatch_e2m3.c",
"c/dispatch_e3m2.c",
],
"include_dirs": [
"include",
"c"
],
"defines": [
"NK_NATIVE_F16=0",
"NK_NATIVE_BF16=0",
"NK_DYNAMIC_DISPATCH=1"
],
"cflags": [
"-std=c11",
"-O3",
"-Wno-unknown-pragmas",
"-Wno-maybe-uninitialized",
"-Wno-cast-function-type",
"-Wno-switch",
"-Wno-psabi",
"-include",
"<(module_root_dir)/nk_probes.h",
],
"msvs_settings": {
"VCCLCompilerTool": {
"ForcedIncludeFiles": [
"<(module_root_dir)/nk_probes.h"
],
"AdditionalOptions": [
"/Zc:preprocessor"
],
},
},
"conditions": [
# Only this branch gets OpenMP; macOS and Windows use their own pools.
[
"OS!='mac' and OS!='win'",
{
"cflags": [
"-fopenmp"
],
"ldflags": [
"-fopenmp"
]
}
],
# Pin TU baseline to each arch's ABI floor; SIMD kernels use per-function pragmas.
# Keep per-arch table in sync with cmake/nk_compiler_flags.cmake, build.rs, setup.py.
[
"OS!='win' and target_arch=='arm64'",
{
"cflags": [
"-march=armv8-a"
]
}
],
[
"OS!='win' and target_arch=='x64'",
{
"cflags": [
"-march=x86-64"
]
}
],
[
"OS!='win' and target_arch=='riscv64'",
{
"cflags": [
"-march=rv64gc"
]
}
],
[
"OS!='win' and target_arch=='ppc64'",
{
"cflags": [
"-mcpu=power8"
]
}
],
[
"OS!='win' and target_arch=='loong64'",
{
"cflags": [
"-march=loongarch64",
"-mlasx"
]
}
],
# Forbid auto-vectorization so serial fallbacks don't get silently
# promoted to NEON/SSE2/VSX. SIMD kernels use explicit intrinsics
# and per-function `target` pragmas; unaffected. MSVC has no
# command-line vectorizer toggle.
[
"OS!='win'",
{
"cflags": [
"-fno-tree-vectorize",
"-fno-tree-slp-vectorize"
]
}
],
[
"OS=='mac'",
{
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET": "11.0"
}
}
],
# MSVC: no per-function target pragma; these match defaults.
[
"OS=='win' and target_arch=='arm64'",
{
"defines": [
"_ARM64_"
],
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": [
"/arch:armv8.0"
]
}
}
}
],
[
"OS=='win' and target_arch=='x64'",
{
"defines": [
"_AMD64_"
],
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": [
"/arch:SSE2"
]
}
}
}
],
],
}
],
}