Skip to content

Commit

Permalink
[SYCLomaitc][Python script migration]Adding extension migration to fi…
Browse files Browse the repository at this point in the history
…les inside list (#2557)
  • Loading branch information
TejaX-Alaghari authored Dec 13, 2024
1 parent 05336ee commit 3afdb88
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions clang/test/dpct/python_migration/case_007/expected.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
1 change: 1 addition & 0 deletions clang/test/dpct/python_migration/case_007/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 3afdb88

Please sign in to comment.