Skip to content

[SYCL] Add -Wno-sycl-undefined-func-in-image to silence spurious undefined-function warnings - #23012

Open
bviyer wants to merge 5 commits into
syclfrom
bviyer-remove-unwanted-warnings
Open

[SYCL] Add -Wno-sycl-undefined-func-in-image to silence spurious undefined-function warnings#23012
bviyer wants to merge 5 commits into
syclfrom
bviyer-remove-unwanted-warnings

Conversation

@bviyer

@bviyer bviyer commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Silences sycl-post-link's "Undefined function found in " warning. Intended for symbols resolved by the GPU driver / JIT. Adds the SyclUndefinedFuncInImage DiagGroup; the driver forwards suppress-undefined-func-warnings to sycl-post-link.

@bviyer
bviyer requested review from a team as code owners August 24, 2026 21:02
Comment thread clang/include/clang/Basic/DiagnosticGroups.td
Comment thread sycl/test/warnings/undefined_functions.cpp

@srividya-sundaram srividya-sundaram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clang Driver changes LGTM. Thanks!

@@ -950,6 +945,8 @@ def Wno_nonportable_cfstrings : Joined<["-"], "Wno-nonportable-cfstrings">, Grou
def Wnonportable_cfstrings : Joined<["-"], "Wnonportable-cfstrings">, Group<W_Group>,
Visibility<[ClangOption, CC1Option]>;
def Wno_sycl_strict : Flag<["-"], "Wno-sycl-strict">, Group<W_Group>, Flags<[HelpHidden]>, HelpText<"Disable warnings which enforce strict SYCL language compatibility.">;
def Wsycl_undefined_func_in_image : Flag<["-"], "Wsycl-undefined-func-in-image">, Group<W_Group>, Flags<[HelpHidden]>, HelpText<"Warn when a device-code function is referenced but has no definition in the linked device image. By default they are enabled.">;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit - The warning is enabled by default.

I think you can remove the "By default.." line for Wno_sycl_undefined_func_in_image

// -Wno-sycl-undefined-func-in-image silences sycl-post-link's "Undefined
// function ... found in ..." warning. No clang-side diagnostic uses this
// group; the driver forwards the -Wno-... form to sycl-post-link.
def SyclUndefinedFuncInImage : DiagGroup<"sycl-undefined-func-in-image">;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you verify if this is required? What happens when this code is not added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants