add benchmark to Bazel build (#71412)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71412

This is only in CMake and internal builds right now. Add to Bazel for
parity.
ghstack-source-id: 150235094

Test Plan: Built and ran locally. Rely on CI to verify.

Reviewed By: malfet

Differential Revision: D33635743

fbshipit-source-id: b9e5abbef5feabd52c53a9c2b95713b87ce81681
(cherry picked from commit 11700dbc80200093fdd74b1be066b4e740cee516)
This commit is contained in:
mikey dagitses
2022-03-02 02:49:38 -08:00
committed by PyTorch MergeBot
parent e9dfc61938
commit 4bf8a9b259
2 changed files with 18 additions and 0 deletions

View File

@ -33,6 +33,13 @@ http_archive(
],
)
http_archive(
name = "google_benchmark",
sha256 = "6132883bc8c9b0df5375b16ab520fac1a85dc9e4cf5be59480448ece74b278d4",
strip_prefix = "benchmark-1.6.1/",
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz"],
)
http_archive(
name = "pybind11_bazel",
strip_prefix = "pybind11_bazel-7f397b5d2cc2434bbd651e096548f7b40c128044",

11
c10/benchmark/BUILD.bazel Normal file
View File

@ -0,0 +1,11 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")
cc_binary(
name = "intrusive_ptr",
srcs = ["intrusive_ptr_benchmark.cpp"],
tags = ["benchmark"],
deps = [
"//c10/util:base",
"@google_benchmark//:benchmark",
],
)