-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCLomatic][CMake]Added rules to remove unsupported compiler flags (#…
- Loading branch information
1 parent
b370ea5
commit a467bac
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
clang/test/dpct/cmake_migration/case_066/case_066_optional_rules.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: rm -rf %T && mkdir -p %T | ||
// RUN: cd %T | ||
// RUN: cp %S/input.cmake ./input.cmake | ||
// RUN: dpct -in-root ./ -out-root out ./input.cmake --migrate-build-script-only --cuda-include-path="%cuda-path/include" --rule-file=%T/../../../../../../../extensions/cmake_rules/cmake_script_migration_rule_optional.yaml | ||
// RUN: echo "begin" > %T/diff.txt | ||
// RUN: diff --strip-trailing-cr %S/expected.txt %T/out/input.cmake >> %T/diff.txt | ||
// RUN: echo "end" >> %T/diff.txt | ||
|
||
// CHECK: begin | ||
// CHECK-NEXT: end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
string(APPEND CMAKE_C_FLAGS " ") | ||
string(APPEND CMAKE_CXX_FLAGS " ") | ||
string(APPEND CMAKE_CXX_FLAGS " ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
string(APPEND CMAKE_C_FLAGS " -prec_div") | ||
string(APPEND CMAKE_CXX_FLAGS " -parallel") | ||
string(APPEND CMAKE_CXX_FLAGS " -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
clang/tools/dpct/DpctOptRules/cmake_script_migration_rule_optional.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright (C) Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
|
||
# This file will be installed to folder: | ||
# {dpct_install_folder}/extensions/opt_rules. | ||
# The rule specified in this file can be imported with commandline option: | ||
# --rule-file={dpct_install_folder}/extensions/opt_rules/cmake_rules/cmake_script_migration_rule_optional.yaml | ||
|
||
- Rule: rule_unsupported_flags_prec_div | ||
Kind: CMakeRule | ||
Priority: Fallback | ||
CmakeSyntax: unsupported_flags_prec_div | ||
In: ${func_name}(${args}) | ||
Out: ${func_name}(${args}) | ||
Subrules: | ||
args: | ||
MatchMode: Full | ||
In: -prec_div | ||
Out: "" | ||
RuleId: "remove_prec_div" | ||
|
||
- Rule: rule_unsupported_flags_parallel | ||
Kind: CMakeRule | ||
Priority: Fallback | ||
CmakeSyntax: unsupported_flags_parallel | ||
In: ${func_name}(${args}) | ||
Out: ${func_name}(${args}) | ||
Subrules: | ||
args: | ||
MatchMode: Full | ||
In: -parallel | ||
Out: "" | ||
RuleId: "remove_parallel" | ||
|
||
- Rule: rule_unsupported_flags_wd | ||
Kind: CMakeRule | ||
Priority: Fallback | ||
CmakeSyntax: unsupported_flags_wd | ||
In: ${func_name}(${args}) | ||
Out: ${func_name}(${args}) | ||
Subrules: | ||
args: | ||
MatchMode: Full | ||
In: -wd${warnings} | ||
Out: "" | ||
RuleId: "remove_wd" |