|
| 1 | +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_oss_build_kwargs", "runtime") |
| 2 | +load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision") |
| 3 | + |
| 4 | +def define_common_targets(): |
| 5 | + runtime.cxx_library( |
| 6 | + name = "runner_lib", |
| 7 | + srcs = glob( |
| 8 | + [ |
| 9 | + "runner/*.cpp", |
| 10 | + ], |
| 11 | + ), |
| 12 | + exported_headers = glob([ |
| 13 | + "runner/*.h", |
| 14 | + ]), |
| 15 | + compiler_flags = [ |
| 16 | + "-Wno-global-constructors", |
| 17 | + "-Wunused-command-line-argument", |
| 18 | + ], |
| 19 | + deps = [ |
| 20 | + "//executorch/extension/llm/runner:stats", |
| 21 | + "//executorch/extension/llm/sampler:sampler", |
| 22 | + "//executorch/extension/module:module", |
| 23 | + "//executorch/extension/tensor:tensor", |
| 24 | + "//executorch/extension/evalue_util:print_evalue", |
| 25 | + "//executorch/examples/models/llama/tokenizer:tiktoken", |
| 26 | + "//executorch/backends/qualcomm/runtime:runtime", |
| 27 | + "fbsource//third-party/qualcomm/qnn/qnn-{0}:api".format(get_qnn_library_verision()), |
| 28 | + ], |
| 29 | + external_deps = [ |
| 30 | + "gflags", |
| 31 | + ], |
| 32 | + **get_oss_build_kwargs() |
| 33 | + ) |
| 34 | + |
| 35 | + runtime.cxx_binary( |
| 36 | + name = "qnn_llama3_2_runner", |
| 37 | + srcs = [ |
| 38 | + "qnn_llama3_2_runner.cpp", |
| 39 | + ], |
| 40 | + compiler_flags = [ |
| 41 | + "-Wno-global-constructors", |
| 42 | + ], |
| 43 | + deps = [ |
| 44 | + ":runner_lib", |
| 45 | + "//executorch/extension/threadpool:threadpool", # this depeneency shouldn't be needed. But it fails to build.. |
| 46 | + "//executorch/extension/evalue_util:print_evalue", |
| 47 | + "//executorch/backends/qualcomm/runtime:runtime", |
| 48 | + ], |
| 49 | + **get_oss_build_kwargs() |
| 50 | + ) |
0 commit comments