Skip to content

Commit

Permalink
PR #20340: Fix missing template value
Browse files Browse the repository at this point in the history
Imported from GitHub PR #20340

Fixes a bug introduced in this change: google/tsl#2944

The change makes use of a template variable `%{compiler}`, that is not defined for this file. This causes the `-fno-canonical-system-headers` option to be set for Clang builds, and Clang will fail with an error about that command line flag not being defined.
Copybara import of the project:

--
75a3d3f by Charles Hofer <[email protected]>:

Fix missing template value

--
e08537b by Charles Hofer <[email protected]>:

Change flag to compiler_is_clang

--
373f359 by Charles Hofer <[email protected]>:

Fix typo

--
2be3c30 by Harsha HS <[email protected]>:

[ROCm] Add cuda-only tags for nvidia profiler test

Merging this change closes #20340

COPYBARA_INTEGRATE_REVIEW=#20340 from ROCm:fix-missing-template-value 2be3c30
PiperOrigin-RevId: 714293326
  • Loading branch information
charleshofer authored and Google-ML-Automation committed Jan 11, 2025
1 parent 724919f commit f78a406
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import pipes

# Template values set by rocm_configure.bzl.
CPU_COMPILER = ('%{cpu_compiler}')
USE_CLANG = ('%{compiler}' == 'clang')
USE_CLANG = ('%{compiler_is_clang}' == 'True')
HOST_COMPILER_PATH = ('%{host_compiler_path}')

HIPCC_PATH = '%{hipcc_path}'
Expand Down
2 changes: 1 addition & 1 deletion third_party/tsl/third_party/gpus/rocm_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ def _create_local_rocm_repository(repository_ctx):
tpl_paths["crosstool:clang/bin/crosstool_wrapper_driver_rocm"],
{
"%{cpu_compiler}": str(cc),
"%{compiler}": rocm_defines["%{compiler}"],
"%{compiler_is_clang}": "True" if is_rocm_clang else "False",
"%{hipcc_path}": str(repository_ctx.path(rocm_config.rocm_toolkit_path + "/bin/hipcc")),
"%{hipcc_env}": _hipcc_env(repository_ctx),
"%{rocm_path}": str(repository_ctx.path(rocm_config.rocm_toolkit_path)),
Expand Down
7 changes: 5 additions & 2 deletions xla/backends/profiler/gpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ cuda_library(
"ptxas-options=-v",
]),
local_defines = if_oss(["NVTX_VERSION_3_1=1"]),
tags = ["requires-gpu-nvidia"],
tags = ["cuda-only"],
visibility = ["//visibility:public"],
)

Expand All @@ -445,7 +445,10 @@ xla_test(
srcs = ["nvtx_with_cuda_kernels_test.cc"],
backends = ["gpu"],
copts = tf_profiler_copts() + tsl_copts(),
tags = ["no_mac"],
tags = [
"cuda-only",
"no_mac",
],
deps = [
":nvtx_with_cuda_kernels",
"@com_google_googletest//:gtest_main",
Expand Down

0 comments on commit f78a406

Please sign in to comment.