File: cu.bzl

package info (click to toggle)
pytorch-cuda 2.6.0%2Bdfsg-7
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 161,620 kB
  • sloc: python: 1,278,832; cpp: 900,322; ansic: 82,710; asm: 7,754; java: 3,363; sh: 2,811; javascript: 2,443; makefile: 597; ruby: 195; xml: 84; objc: 68
file content (42 lines) | stat: -rw-r--r-- 1,965 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
load("@rules_cuda//cuda:defs.bzl", "cuda_library")

NVCC_COPTS = [
    "--expt-relaxed-constexpr",
    "--expt-extended-lambda",
    "--compiler-options=-Werror=all",
    # The following warnings come from -Wall. We downgrade them from
    # error to warnings here.
    #
    # sign-compare has a tremendous amount of violations in the
    # codebase. It will be a lot of work to fix them, just disable it
    # for now.
    "--compiler-options=-Wno-sign-compare",
    # We intentionally use #pragma unroll, which is compiler specific.
    "--compiler-options=-Wno-error=unknown-pragmas",
    "--compiler-options=-Werror=extra",
    # The following warnings come from -Wextra. We downgrade them from
    # error to warnings here.
    #
    # unused-parameter-compare has a tremendous amount of violations
    # in the codebase. It will be a lot of work to fix them, just
    # disable it for now.
    "--compiler-options=-Wno-unused-parameter",
    # missing-field-parameters has both a large number of violations
    # in the codebase, but it also is used pervasively in the Python C
    # API. There are a couple of catches though:
    # * we use multiple versions of the Python API and hence have
    #   potentially multiple different versions of each relevant
    #   struct. They may have different numbers of fields. It will be
    #   unwieldy to support multiple versions in the same source file.
    # * Python itself for many of these structs recommends only
    #   initializing a subset of the fields. We should respect the API
    #   usage conventions of our dependencies.
    #
    # Hence, we just disable this warning altogether. We may want to
    # clean up some of the clear-cut cases that could be risky, but we
    # still likely want to have this disabled for the most part.
    "-Wno-missing-field-initializers",
]

def cu_library(name, srcs, copts = [], **kwargs):
    cuda_library(name, srcs = srcs, copts = NVCC_COPTS + copts, **kwargs)