Skip to content

[Driver][SYCL] Set /Zc:__cplusplus default for MSVC host compilation #7406

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 2 commits into from
Nov 17, 2022

Conversation

hchilama
Copy link
Contributor

By default, we pass the /Zc:__cplusplus to host compiler(cl)
When user passes /Zc:__cplusplus- on the icx/icpx commandline, we override the option to the host compiler to disable the default.
When user passes /Zc:_cplusplus- (OR) /Zc:_cplusplus through -fsycl-host-compiler-options, we pass such option as-is. This will have higher priority.

@hchilama hchilama requested a review from a team as a code owner November 15, 2022 23:41
@hchilama hchilama requested a review from mdtoguchi November 15, 2022 23:44
@hchilama hchilama changed the title [Driver]Support for /Zc:__cplusplus- to disable the default setting for host compiler [Driver][SYCL] Set /Zc:__cplusplus default for MSVC host compilation Nov 15, 2022

// Zc:__cplusplus, Zc:__cplusplus- check
// RUN: %clang_cl -### -fsycl-host-compiler=cl -fsycl %s 2>&1 | FileCheck -check-prefix=CHECK-ZC-CPLUSPLUS %s
// RUN: %clang_cl -### -fsycl-host-compiler=cl -fsycl /fsycl-host-compiler-options=/Zc:__cplusplus- %s 2>&1 | FileCheck -check-prefix=CHECK-ZC-CPLUSPLUS-MINUS %s
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// RUN: %clang_cl -### -fsycl-host-compiler=cl -fsycl /fsycl-host-compiler-options=/Zc:__cplusplus- %s 2>&1 | FileCheck -check-prefix=CHECK-ZC-CPLUSPLUS-MINUS %s
// RUN: %clang_cl -### -fsycl-host-compiler=cl -fsycl -fsycl-host-compiler-options=/Zc:__cplusplus- %s 2>&1 | FileCheck -check-prefix=CHECK-ZC-CPLUSPLUS-MINUS %s

@hchilama hchilama requested a review from mdtoguchi November 16, 2022 04:17
Copy link
Contributor

@mdtoguchi mdtoguchi left a comment

Choose a reason for hiding this comment

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

LGTM

@pvchupin pvchupin merged commit e7ed860 into intel:sycl Nov 17, 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.

3 participants