| # Copyright 2025 Google LLC |
| # |
| # This source code is licensed under the BSD-style license found in the |
| # LICENSE file in the root directory of this source tree. |
| # |
| # Description: |
| # XNNPACK - optimized floating-point neural network operators library |
| |
| ## MODULE.bazel |
| module( |
| name = "xnnpack", |
| ) |
| |
| # Bazel rule definitions |
| bazel_dep(name = "rules_cc", version = "0.0.15") |
| bazel_dep(name = "rules_license", version = "1.0.0") |
| bazel_dep(name = "rules_python", version = "1.0.0") |
| |
| pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") |
| pip.parse( |
| hub_name = "pip", |
| python_version = "3.11", |
| requirements_lock = "//:requirements_lock.txt", |
| ) |
| use_repo(pip, "pip") |
| |
| # Bazel Skylib. |
| bazel_dep(name = "bazel_skylib", version = "1.7.1") |
| |
| # Bazel Platforms |
| bazel_dep(name = "platforms", version = "0.0.10") |
| |
| # TODO: some (most? all?) of the http_archive() calls below could become bazel_dep() calls, |
| # but it would require verifying that the semver provided by the Bazel registry matches the hash |
| # that we expect in CMake; it's not clear that it is a big win to do so given the modest |
| # complexity of our deps, so I'm leaving it like this for now to ensure that the Bazel and CMake |
| # builds are using identical dependencies. |
| |
| http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| # LINT.IfChange(googletest) |
| # Google Test framework, used by most unit-tests. |
| http_archive( |
| name = "com_google_googletest", |
| sha256 = "648b9430fca63acc68c59ee98f624dcbcd9c24ea6b278c306ab6b7f49f62034a", |
| strip_prefix = "googletest-d144031940543e15423a25ae5a8a74141044862f", |
| urls = ["https://github.com/google/googletest/archive/d144031940543e15423a25ae5a8a74141044862f.zip"], |
| ) |
| # LINT.ThenChange(cmake/DownloadGoogleTest.cmake,WORKSPACE:googletest) |
| |
| # LINT.IfChange(benchmark) |
| # Google Benchmark library, used in micro-benchmarks. |
| http_archive( |
| name = "com_google_benchmark", |
| sha256 = "28c7cac12cc25d87d3dcc8c5fb7d1bd0971b41a599a5c4787f8742cb39ca47db", |
| strip_prefix = "benchmark-8d4fdd6e6e003867045e0bb3473b5b423818e4b7", |
| urls = ["https://github.com/google/benchmark/archive/8d4fdd6e6e003867045e0bb3473b5b423818e4b7.zip"], |
| ) |
| # LINT.ThenChange(cmake/DownloadGoogleBenchmark.cmake,WORKSPACE:benchmark) |
| |
| # LINT.IfChange(FXdiv) |
| # FXdiv library, used for repeated integer division by the same factor |
| http_archive( |
| name = "FXdiv", |
| sha256 = "ab7dfb08829bee33dca38405d647868fb214ac685e379ec7ef2bebcd234cd44d", |
| strip_prefix = "FXdiv-b408327ac2a15ec3e43352421954f5b1967701d1", |
| urls = ["https://github.com/Maratyszcza/FXdiv/archive/b408327ac2a15ec3e43352421954f5b1967701d1.zip"], |
| ) |
| # LINT.ThenChange(cmake/DownloadFXdiv.cmake,WORKSPACE:FXdiv) |
| |
| # LINT.IfChange(pthreadpool) |
| # pthreadpool library, used for parallelization |
| http_archive( |
| name = "pthreadpool", |
| sha256 = "f602ab141bdc5d5872a79d6551e9063b5bfa7ad6ad60cceaa641de5c45c86d70", |
| strip_prefix = "pthreadpool-0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e", |
| urls = ["https://github.com/google/pthreadpool/archive/0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e.zip"], |
| ) |
| # LINT.ThenChange(cmake/DownloadPThreadPool.cmake,WORKSPACE:pthreadpool) |
| |
| # LINT.IfChange(cpuinfo) |
| # cpuinfo library, used for detecting processor characteristics |
| http_archive( |
| name = "cpuinfo", |
| sha256 = "c0254ce97f7abc778dd2df0aaca1e0506dba1cd514fdb9fe88c07849393f8ef4", |
| strip_prefix = "cpuinfo-8a9210069b5a37dd89ed118a783945502a30a4ae", |
| urls = [ |
| "https://github.com/pytorch/cpuinfo/archive/8a9210069b5a37dd89ed118a783945502a30a4ae.zip", |
| ], |
| ) |
| # LINT.ThenChange(cmake/DownloadCpuinfo.cmake,WORKSPACE:cpuinfo) |
| |
| # LINT.IfChange(kleidiai) |
| # KleidiAI library, used for ARM microkernels. |
| http_archive( |
| name = "KleidiAI", |
| sha256 = "5e922c9afb7a0c881fc4359b58488f3faa840e8435de1a2207a6525935ed83c2", |
| strip_prefix = "kleidiai-63205aa90afa6803d8f58bc3081b69288e9f1906", |
| urls = [ |
| "https://github.com/ARM-software/kleidiai/archive/63205aa90afa6803d8f58bc3081b69288e9f1906.zip", |
| ], |
| ) |
| # LINT.ThenChange(cmake/DownloadKleidiAI.cmake,WORKSPACE:kleidiai) |
| |
| # Ruy library, used to benchmark against |
| http_archive( |
| name = "ruy", |
| sha256 = "fe8345f521bb378745ebdd0f8c5937414849936851d2ec2609774eb2d7098e54", |
| strip_prefix = "ruy-9f53ba413e6fc879236dcaa3e008915973d67a4f", |
| urls = [ |
| "https://github.com/google/ruy/archive/9f53ba413e6fc879236dcaa3e008915973d67a4f.zip", |
| ], |
| ) |
| |
| http_archive( |
| name = "slinky", |
| sha256 = "4c0b19e58706c44336c573a0ba9fdf0e412b23670cac6a3df95525a0909a0360", |
| strip_prefix = "slinky-2afe84b39f0d097ecd70fc44a9e0e39782cee6a3", |
| urls = [ |
| "https://github.com/dsharlet/slinky/archive/2afe84b39f0d097ecd70fc44a9e0e39782cee6a3.zip", |
| ], |
| ) |