Skip to content

[SYCL][Windows] Fix DataMovement test #6790

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 1 commit into from
Sep 15, 2022
Merged

Conversation

npmiller
Copy link
Contributor

Using -g with the regular clang command line is not supported on Windows.

On Windows clang-cl and /Mdd should be used instead.

However it doesn't seem like this test is testing anything to do debug info and I couldn't find any reason for having it in the history, so removing -g is the simplest solution to make the test work on both Linux and Windows.

This should fix the post-commit issue that showed up in: #6721

Using `-g` with the regular `clang` command line is not supported on
Windows.

On Windows `clang-cl` and `/Mdd` should be used instead.

However it doesn't seem like this test is testing anything to do debug
info and I couldn't find any reason for having it in the history, so
removing `-g` is the simplest solution to make the test work on both
Linux and Windows.
@npmiller npmiller requested a review from a team as a code owner September 15, 2022 09:58
@bader
Copy link
Contributor

bader commented Sep 15, 2022

Using -g with the regular clang command line is not supported on Windows.

I'm looking at post-commit logs and I see that compilation passes successfully, but produced executable returns some error code (post-commit logs). I'm not sure what's going on. If clang produces invalid binary, I expect it to emit a warning or an error that command line options is not supported. If clang is supposed to ignore unrecognized/unsupported options, it should produce a valid executable, which should pass our testing.

I see most likely this option is left after some debugging by accident, but I think it exposes some bug, which we should investigate separately. What do you think?

Tagging @mdtoguchi.

@npmiller
Copy link
Contributor Author

The problem is that it will link against the release version of msvcrt and the debug version of sycl, and this mismatch only causes issues at runtime.

I tried to fix that originally as explained in #6721 but then other issues showed up such as clang not defining _DEBUG with -g which can cause issues with the MSVC headers.

So as far as I understand it, the regular clang command line is not really meant to be used on its own on Windows, or at least not on its own with an MSVC toolchain, clang-cl should be used for that, and so this is more of a clang problem and if we wanted to make it work we would have to duplicate some of the work done in clang-cl into the regular command line.

My patches specifically fixed the regular clang command line so it works with Windows-Clang.cmake which will link against the correct msvcrt and define _DEBUG and so on. Before the patch using -g on the command line would "work" but it would be sort of ignored and it would link against release msvcrt and sycl, which then when used with Windows-Clang.cmake would break in the same way as this test.

@bader
Copy link
Contributor

bader commented Sep 15, 2022

Thanks for clarification. We probably should think about using clang-cl instead of clang on Windows in our lit tests.

@pvchupin
Copy link
Contributor

@sergey-semenov, can you review please?

@bader bader merged commit 1ccfd51 into intel:sycl Sep 15, 2022
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.

4 participants