Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress some warnings in WebGPU EP generated by GCC 13 #23445

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/buffer_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <iosfwd>

#include <webgpu/webgpu_cpp.h>
#include "core/providers/webgpu/webgpu_external_header.h"

#include "core/framework/execution_provider.h"

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/compute_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include <webgpu/webgpu_cpp.h>
#include "core/providers/webgpu/webgpu_external_header.h"

#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/program_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <string>
#include <unordered_map>

#include <webgpu/webgpu_cpp.h>
#include "core/providers/webgpu/webgpu_external_header.h"

#include "core/common/common.h"

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/shader_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <sstream>

#include <webgpu/webgpu_cpp.h>
#include "core/providers/webgpu/webgpu_external_header.h"

#include "core/framework/tensor_shape.h"

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/webgpu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <memory>
#include <mutex>

#include <webgpu/webgpu_cpp.h>
#include "core/providers/webgpu/webgpu_external_header.h"

#include "core/common/common.h"
#include "core/framework/library_handles.h"
Expand Down
15 changes: 15 additions & 0 deletions onnxruntime/core/providers/webgpu/webgpu_external_header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we no longer need to use macro HAS_* like this

check_cxx_compiler_flag(-Wdeprecated-anon-enum-enum-conversion HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only support GCC 11 and above. "--strict-aliasing" is available in these GCC versions.

#endif

#include <webgpu/webgpu_cpp.h>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is for suppressing strict-aliasing warnings from the 3rd-party webgpu source code, not ours.


#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
Loading