Skip to content

Conversation

@ayylol
Copy link
Contributor

@ayylol ayylol commented Jul 22, 2024

This patch adds the -Werror flag to all SYCL e2e tests to stop the introduction of new warnings.

Added -Wno-error= to existing tests that have warnings (Or made changes to resolve the warnings).

@ayylol ayylol requested review from a team as code owners July 22, 2024 21:03
@ayylol ayylol requested a review from maarquitos14 July 22, 2024 21:03
@ayylol ayylol temporarily deployed to WindowsCILock July 22, 2024 21:05 — with GitHub Actions Inactive
Copy link
Contributor

@maarquitos14 maarquitos14 left a comment

Choose a reason for hiding this comment

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

Most of the tests have -Wno-error=.... Can we try and fix any of these warnings? Maybe in separate PRs?

@@ -1,5 +1,5 @@
// REQUIRES: opencl
// RUN: %{build} -o %t.out
// RUN: %{build} -std=c++20 -o %t.out
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This warning is generated without it:

# .---command stderr------------
# | /localdisk2/dgarciao/llvm/sycl/test-e2e/Regression/check_vector_of_opencl_event.cpp:21:38: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [-Wc++20-extensions]
# |    21 |   std::vector<cl_event> ClEventVec = get_native<sycl::backend::opencl>(event);
# |       |                                      ^
# | 1 warning generated.
# | /localdisk2/dgarciao/llvm/sycl/test-e2e/Regression/check_vector_of_opencl_event.cpp:21:38: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [-Wc++20-extensions]
# |    21 |   std::vector<cl_event> ClEventVec = get_native<sycl::backend::opencl>(event);
# |       |                                      ^
# | 1 warning generated.
# \`-----------------------------

Copy link
Contributor

Choose a reason for hiding this comment

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

Folks this is the wrong way to fix this warning. The test is not supposed to use C++20 features.

Please replace get_native<sycl::backend::opencl>(event) to sycl::get_native<sycl::backend::opencl>(event) at line 20.

@ayylol
Copy link
Contributor Author

ayylol commented Jul 23, 2024

Most of the tests have -Wno-error=.... Can we try and fix any of these warnings? Maybe in separate PRs?

@maarquitos14
From what I found 20 of these tests were explicitly testing deprecated functionality (I can give more info on these, if you'd like). The tests in syclcompat mainly have issues because including some syclcompat files creates warnings. For the rest I could take a better look at to see if they could be resolved. However I thought it might be a good idea to add the flag before doing so because it would add a visible marker in the code base of the tests that need work.

@maarquitos14
Copy link
Contributor

Most of the tests have -Wno-error=.... Can we try and fix any of these warnings? Maybe in separate PRs?

@maarquitos14 From what I found 20 of these tests were explicitly testing deprecated functionality (I can give more info on these, if you'd like). The tests in syclcompat mainly have issues because including some syclcompat files creates warnings. For the rest I could take a better look at to see if they could be resolved. However I thought it might be a good idea to add the flag before doing so because it would add a visible marker in the code base of the tests that need work.

It's definitely a good idea. On a side note, just wondering if having tests for deprecated functionalities makes sense or those should be dropped.

Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

tools/esimd LGTM! I agree we should see if we can fix some of the warnings that are not expected as part of the test in a separate PR

Should fix the errors on ARC
Copy link
Contributor

@AllanZyne AllanZyne left a comment

Choose a reason for hiding this comment

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

LGTM on asan part

@ayylol ayylol temporarily deployed to WindowsCILock July 29, 2024 20:00 — with GitHub Actions Inactive
@ayylol ayylol temporarily deployed to WindowsCILock July 29, 2024 22:48 — with GitHub Actions Inactive
@againull
Copy link
Contributor

againull commented Jul 30, 2024

@intel/unified-runtime-reviewers Friendly ping.

@againull againull merged commit e0a222f into intel:sycl Jul 30, 2024
@ayylol ayylol deleted the add-Werror branch July 30, 2024 18:13
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.

8 participants