forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move CUDA flags out of --per_file_copts into the cu_library macro
Summary: This has a few advantages: * changes do not discard the Bazel analysis cache * allows for per-target overrides Test Plan: Verified with `bazel build --subcommands`. Reviewers: seemethere Subscribers: Tasks: Tags: Pull Request resolved: pytorch#79414 Approved by: https://github.com/malfet
- Loading branch information
1 parent
9cca8ae
commit 9c6579f
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
load("@rules_cuda//cuda:defs.bzl", "cuda_library") | ||
|
||
NVCC_COPTS = ["--expt-relaxed-constexpr", "--expt-extended-lambda"] | ||
NVCC_COPTS = [ | ||
"--expt-relaxed-constexpr", | ||
"--expt-extended-lambda", | ||
"--compiler-options=-Werror=type-limits", | ||
"--compiler-options=-Werror=unused-function", | ||
"--compiler-options=-Werror=unused-variable", | ||
] | ||
|
||
def cu_library(name, srcs, copts = [], **kwargs): | ||
cuda_library(name, srcs = srcs, copts = NVCC_COPTS + copts, **kwargs) |