pytorch

Форк
0
/
bazel.bzl 
39 строк · 1.3 Кб
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")
7

8
def _genrule(**kwds):
9
    if _enabled(**kwds):
10
        native.genrule(**kwds)
11

12
def _is_cpu_static_dispatch_build():
13
    return False
14

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.
18
rules = struct(
19
    cc_binary = cc_binary,
20
    cc_library = cc_library,
21
    cc_test = cc_test,
22
    cmake_configure_file = cmake_configure_file,
23
    cuda_library = cuda_library,
24
    filegroup = native.filegroup,
25
    genrule = _genrule,
26
    glob = native.glob,
27
    if_cuda = if_cuda,
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,
33
    select = select,
34
    test_suite = native.test_suite,
35
)
36

37
def _enabled(tags = [], **_kwds):
38
    """Determines if the target is enabled."""
39
    return "-bazel" not in tags
40

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.