From dfc1a8bd46d64f2f38437f2d849159e36f606146 Mon Sep 17 00:00:00 2001 From: Shkarupa Alex Date: Mon, 26 Sep 2022 08:54:05 +0300 Subject: [PATCH] Fix local build with GPU support Allow local build with GPU support against TF 2.10 Partly fixes #2712 To build locally it still required to manually replace crosstool_top value in .bazelrc with "@local_config_cuda//crosstool:toolchain" --- .../clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_deps/toolchains/gpu/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl b/build_deps/toolchains/gpu/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl index affc0be9fc..81c16c6125 100644 --- a/build_deps/toolchains/gpu/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl +++ b/build_deps/toolchains/gpu/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl @@ -167,7 +167,7 @@ def InvokeNvcc(argv, log=False): undefines = ''.join([' -U' + define for define in undefines]) std_options = GetOptionValue(argv, 'std') # Supported -std flags as of CUDA 9.0. Only keep last to mimic gcc/clang. - nvcc_allowed_std_options = ["c++03", "c++11", "c++14"] + nvcc_allowed_std_options = ["c++03", "c++11", "c++14", "c++17"] std_options = ''.join([' -std=' + define for define in std_options if define in nvcc_allowed_std_options]) @@ -205,7 +205,7 @@ def InvokeNvcc(argv, log=False): x.replace(".", "") for x in supported_cuda_compute_capabilities]) for capability in supported_cuda_compute_capabilities[:-1]: nvccopts += r'-gencode=arch=compute_%s,\"code=sm_%s\" ' % ( - capability, capability, capability) + capability, capability) if supported_cuda_compute_capabilities: capability = supported_cuda_compute_capabilities[-1] nvccopts += r'-gencode=arch=compute_%s,code=\"sm_%s,compute_%s\" ' % (