1"""Emscripten-specific build definitions for XNNPACK.""" 2 3def 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 11def 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 22def 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", 29 "-s TOTAL_MEMORY=436207616", # 416M 30 "--pre-js $(location :preamble.js.lds)", 31 ] 32 33def xnnpack_emscripten_deps(): 34 """Emscripten-specific dependencies for unit tests and benchmarks.""" 35 return [ 36 ":preamble.js.lds", 37 ] 38