Skip to content

[SYCL][NFC] Eliminate struct/class definition/declaration and static/static-inlined function warnings. #1027

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

Merged
merged 6 commits into from
Jan 26, 2020

Conversation

s-kanaev
Copy link
Contributor

Compiling user code with -Wall provides compilation warnings from SYCL headers.
In some cases (-Werror or smth like that is enabled) it may not allow to compile user code.

CL/sycl/detail/generic_type_traits.hpp:468:1: warning: 'TryToGetNumElements' defined as a struct template here but previously declared as a class template; this is valid,  but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
struct TryToGetNumElements<

It's common to #983

Also, a multiple of:

CL/__spirv/spirv_vars.hpp:36:1: warning: 'static' function 'getGlobalOffset' declared in header file should be declared 'static inline' [-Wunneeded-internal-declaration]

warnings was eliminated.

Signed-off-by: Sergey Kanaev [email protected]

@s-kanaev s-kanaev changed the title [SYCL] [NFC] Eliminate warnings from struct/class and static/static-inlined warnings. [SYCL] [NFC] Eliminate struct/class definition/declaration and static/static-inlined function warnings. Jan 20, 2020
@bader
Copy link
Contributor

bader commented Jan 20, 2020

Please, add -Wall to SYCL runtime build script and add a lit test with -Wall -Werror.

@bader bader changed the title [SYCL] [NFC] Eliminate struct/class definition/declaration and static/static-inlined function warnings. [SYCL][NFC] Eliminate struct/class definition/declaration and static/static-inlined function warnings. Jan 20, 2020
Sergey Kanaev added 5 commits January 23, 2020 13:40
…finition and declaration to avoid compiler warnings

Compiling user code with -Wall provides compilation warnings from SYCL headers.
In some cases (-Werror or smth like that is enabled) it may not allow to compile user code.

```
CL/sycl/detail/generic_type_traits.hpp:468:1: warning: 'TryToGetNumElements' defined as a struct template here but previously declared as a class template; this is valid,  but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
struct TryToGetNumElements<
```

Signed-off-by: Sergey Kanaev <[email protected]>
Signed-off-by: Sergey Kanaev <[email protected]>
Signed-off-by: Sergey Kanaev <[email protected]>
@s-kanaev s-kanaev force-pushed the private/s-kanaev/warnings branch from ffab137 to 1a009d2 Compare January 23, 2020 10:40
@s-kanaev
Copy link
Contributor Author

Please, add -Wall to SYCL runtime build script and add a lit test with -Wall -Werror.

Done.

Signed-off-by: Sergey Kanaev [email protected]

Co-Authored-By: Alexey Bader <[email protected]>
Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@s-kanaev
Copy link
Contributor Author

@asavonic It's your time to act, now.

@bader bader merged commit 6a77944 into intel:sycl Jan 26, 2020
@s-kanaev s-kanaev deleted the private/s-kanaev/warnings branch March 12, 2020 13:14
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