Marat Dukhan | 08c4a43 | 2019-10-03 09:29:21 -0700 | [diff] [blame] | 1 | """Emscripten-specific build definitions for XNNPACK.""" |
| 2 | |
| 3 | def xnnpack_emscripten_minimal_linkopts(): |
| 4 | """Minimal Emscripten-specific linkopts for binaries.""" |
| 5 | return [ |
| 6 | "-s ASSERTIONS=0", |
| 7 | "-s ERROR_ON_UNDEFINED_SYMBOLS=1", |
| 8 | "-s EXIT_RUNTIME=1", |
| 9 | ] |
| 10 | |
| 11 | def xnnpack_emscripten_test_linkopts(): |
| 12 | """Emscripten-specific linkopts for unit tests.""" |
| 13 | return [ |
| 14 | "-s ASSERTIONS=2", |
| 15 | "-s ERROR_ON_UNDEFINED_SYMBOLS=1", |
| 16 | "-s DEMANGLE_SUPPORT=1", |
| 17 | "-s EXIT_RUNTIME=1", |
| 18 | "-s ALLOW_MEMORY_GROWTH=1", |
| 19 | "--pre-js $(location :preamble.js.lds)", |
| 20 | ] |
| 21 | |
| 22 | def xnnpack_emscripten_benchmark_linkopts(): |
| 23 | """Emscripten-specific linkopts for benchmarks.""" |
| 24 | return [ |
| 25 | "-s ASSERTIONS=1", |
| 26 | "-s ERROR_ON_UNDEFINED_SYMBOLS=1", |
| 27 | "-s EXIT_RUNTIME=1", |
| 28 | "-s ALLOW_MEMORY_GROWTH=1", |
Marat Dukhan | 12f1dea | 2019-10-04 14:44:59 -0700 | [diff] [blame^] | 29 | "-s TOTAL_MEMORY=134217728", # 128M |
Marat Dukhan | 08c4a43 | 2019-10-03 09:29:21 -0700 | [diff] [blame] | 30 | "--pre-js $(location :preamble.js.lds)", |
| 31 | ] |
| 32 | |
| 33 | def xnnpack_emscripten_deps(): |
| 34 | """Emscripten-specific dependencies for unit tests and benchmarks.""" |
| 35 | return [ |
| 36 | ":preamble.js.lds", |
| 37 | ] |