[rocm-libraries] ROCm/rocm-libraries#7760 (commit a61bc76)

[CK] suppress compiler warnings while building pytorch. (#7760)

## Motivation

Recently added compiler flags that are required to suppress false
warnings by latest staging compiler are not recognized by older compiler
versions and are triggering an avalanche of warnings. Previous attempt
to suppress them by using -Wno-unknown-warning-option flag didn't help,
because that flag wasn't recognized either and just added more warnings.
I've verified that current approach by checking the clang version
actually works as intended and makes the warnings go away.

## Technical Details

<!-- Explain the changes along with any relevant GitHub links. -->

## Test Plan

<!-- Explain any relevant testing done to verify this PR. -->

## Test Result

<!-- Briefly summarize test outcomes. -->

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
This commit is contained in:
Illia Silin
2026-05-27 06:56:58 -07:00
committed by GitHub
parent 60df79085d
commit c24e528481
255 changed files with 1049 additions and 457 deletions

View File

@@ -7,11 +7,14 @@
namespace ck {
namespace host {
#if __clang_major__ >= 23
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wno-unknown-warning-option"
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
const std::string config_header = "";
#if __clang_major__ >= 23
#pragma clang diagnostic pop
#endif
std::unordered_map<std::string_view, std::string_view> GetHeaders()
{