1
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
2
load("@rules_cuda//cuda:defs.bzl", "cuda_library", "requires_cuda_enabled")
3
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
4
load("@pip_deps//:requirements.bzl", "requirement")
5
load("@pytorch//c10/macros:cmake_configure_file.bzl", "cmake_configure_file")
6
load("@pytorch//tools/config:defs.bzl", "if_cuda")
10
native.genrule(**kwds)
12
def _is_cpu_static_dispatch_build():
15
# Rules implementation for the Bazel build system. Since the common
16
# build structure aims to replicate Bazel as much as possible, most of
17
# the rules simply forward to the Bazel definitions.
19
cc_binary = cc_binary,
20
cc_library = cc_library,
22
cmake_configure_file = cmake_configure_file,
23
cuda_library = cuda_library,
24
filegroup = native.filegroup,
28
is_cpu_static_dispatch_build = _is_cpu_static_dispatch_build,
29
py_binary = py_binary,
30
py_library = py_library,
31
requirement = requirement,
32
requires_cuda_enabled = requires_cuda_enabled,
34
test_suite = native.test_suite,
37
def _enabled(tags = [], **_kwds):
38
"""Determines if the target is enabled."""
39
return "-bazel" not in tags