Add cuda_root filegroup target to the windows BUILD template.

When I added this to the linux BUILD template, I forgot to add it here, too.
Adjust cuda_configure.bzl.oss so that it copies the binaries with .exe
extension on Windows.

PiperOrigin-RevId: 317601952
Change-Id: I0712bcd926372cb9d067ead7f92270d52883bfd9
This commit is contained in:
Adrian Kuegel 2020-06-22 00:18:35 -07:00 committed by TensorFlower Gardener
parent 9f43ebd68c
commit 5229c77d94
2 changed files with 15 additions and 6 deletions

View File

@ -196,6 +196,14 @@ cc_library(
data = [":cuda-nvvm"],
)
filegroup(
name = "cuda_root",
srcs = [
"cuda/bin/fatbinary.exe",
"cuda/bin/bin2c.exe",
],
)
bzl_library(
name = "build_defs_bzl",
srcs = ["build_defs.bzl"],

View File

@ -1062,20 +1062,21 @@ def _create_local_cuda_repository(repository_ctx):
))
# copy files mentioned in third_party/nccl/build_defs.bzl.tpl
file_ext = ".exe" if is_windows(repository_ctx) else ""
copy_rules.append(make_copy_files_rule(
repository_ctx,
name = "cuda-bin",
srcs = [
cuda_config.cuda_toolkit_path + "/bin/" + "crt/link.stub",
cuda_config.cuda_toolkit_path + "/bin/" + "nvlink",
cuda_config.cuda_toolkit_path + "/bin/" + "fatbinary",
cuda_config.cuda_toolkit_path + "/bin/" + "bin2c",
cuda_config.cuda_toolkit_path + "/bin/" + "nvlink" + file_ext,
cuda_config.cuda_toolkit_path + "/bin/" + "fatbinary" + file_ext,
cuda_config.cuda_toolkit_path + "/bin/" + "bin2c" + file_ext,
],
outs = [
"cuda/bin/" + "crt/link.stub",
"cuda/bin/" + "nvlink",
"cuda/bin/" + "fatbinary",
"cuda/bin/" + "bin2c",
"cuda/bin/" + "nvlink" + file_ext,
"cuda/bin/" + "fatbinary" + file_ext,
"cuda/bin/" + "bin2c" + file_ext,
],
))