diff --git a/clang/test/dpct/python_migration/case_007/expected.py b/clang/test/dpct/python_migration/case_007/expected.py index c70078529f2b..92486c21ce2f 100644 --- a/clang/test/dpct/python_migration/case_007/expected.py +++ b/clang/test/dpct/python_migration/case_007/expected.py @@ -2,3 +2,4 @@ out = func("bar.dp.cpp", "baz.cpp") # foo.cpp is a C++ file with CUDA syntax out = func("foo.cpp.dp.cpp", "bar.dp.cpp") +out = func(["foo.cpp.dp.cpp", "bar.dp.cpp"]) diff --git a/clang/test/dpct/python_migration/case_007/input.py b/clang/test/dpct/python_migration/case_007/input.py index 87739d0c7783..75babf23b61a 100644 --- a/clang/test/dpct/python_migration/case_007/input.py +++ b/clang/test/dpct/python_migration/case_007/input.py @@ -2,3 +2,4 @@ out = func("bar.cu", "baz.cpp") # foo.cpp is a C++ file with CUDA syntax out = func("foo.cpp", "bar.cu") +out = func(["foo.cpp", "bar.cu"]) diff --git a/clang/tools/dpct/DpctOptRules/python_build_script_migration_rule_ipex.yaml b/clang/tools/dpct/DpctOptRules/python_build_script_migration_rule_ipex.yaml index f91fe5e94d28..f5b7a43b1dcf 100644 --- a/clang/tools/dpct/DpctOptRules/python_build_script_migration_rule_ipex.yaml +++ b/clang/tools/dpct/DpctOptRules/python_build_script_migration_rule_ipex.yaml @@ -133,11 +133,11 @@ In: BuildExtension Out: DpcppBuildExtension -- Rule: rule_cpp_file +- Rule: rule_cpp_file_in_func Kind: PythonRule Priority: Fallback MatchMode: Partial - PythonSyntax: cpp_file + PythonSyntax: cpp_file_in_func In: ${func_name}(${value}) Out: ${func_name}(${value}) Subrules: @@ -146,11 +146,24 @@ In: ${arg}.cpp Out: ${arg}.${rewrite_extention_name} -- Rule: rule_cu_file +- Rule: rule_cpp_file_in_list Kind: PythonRule Priority: Fallback MatchMode: Partial - PythonSyntax: cu_file + PythonSyntax: cpp_file_in_list + In: "[${value}]" + Out: "[${value}]" + Subrules: + value: + MatchMode: Full + In: ${arg}.cpp + Out: ${arg}.${rewrite_extention_name} + +- Rule: rule_cu_file_in_func + Kind: PythonRule + Priority: Fallback + MatchMode: Partial + PythonSyntax: cu_file_in_func In: ${func_name}(${value}) Out: ${func_name}(${value}) Subrules: @@ -159,6 +172,19 @@ In: ${arg}.cu Out: ${arg}.${rewrite_extention_name} +- Rule: rule_cu_file_in_list + Kind: PythonRule + Priority: Fallback + MatchMode: Partial + PythonSyntax: cu_file_in_list + In: "[${value}]" + Out: "[${value}]" + Subrules: + value: + MatchMode: Full + In: ${arg}.cu + Out: ${arg}.${rewrite_extention_name} + - Rule: rule_cuda_device_count Kind: PythonRule Priority: Fallback