Skip to content

Commit

Permalink
[SYCLomatic][CMake] Add rule to migrate cuda_compile without libtype (#…
Browse files Browse the repository at this point in the history
…2523)

Signed-off-by: Ahmed, Daiyaan <[email protected]>
  • Loading branch information
daiyaan-ahmed6 authored Nov 29, 2024
1 parent de1cfa3 commit 8a5563b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions clang/test/dpct/cmake_migration/case_018/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ dpct_helper_sycl_compile(obj3 f1.dp.cpp f2.dp.cpp f3.dp.cpp)
dpct_helper_sycl_compile(obj4 a.dp.cpp b.dp.cpp)

dpct_helper_sycl_compile(obj5 a.dp.cpp b.dp.cpp)

dpct_helper_sycl_compile(obj6 a.dp.cpp b.dp.cpp)
2 changes: 2 additions & 0 deletions clang/test/dpct/cmake_migration/case_018/input.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ cuda_compile(obj3 f1.cu f2.cu f3.cu SHARED)
cuda_compile(obj4 a.cu b.cu STATIC OPTIONS -O3 --profile)

cuda_compile(obj5 a.cu b.cu SHARED OPTIONS -O3 --profile)

cuda_compile(obj6 a.cu b.cu OPTIONS -O3 --profile)
10 changes: 9 additions & 1 deletion clang/tools/dpct/DpctOptRules/cmake_script_migration_rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,19 @@
In: cuda_compile(${libname} ${srcs} SHARED)
Out: dpct_helper_sycl_compile(${libname} ${srcs})

- Rule: rule_cuda_compile_with_no_opts
- Rule: rule_cuda_compile_with_opts_without_lib_type
Kind: CMakeRule
Priority: Fallback
MatchMode: Partial
CmakeSyntax: rule_cuda_compile_05
In: cuda_compile(${libname} ${srcs} OPTIONS ${opts})
Out: dpct_helper_sycl_compile(${libname} ${srcs})

- Rule: rule_cuda_compile
Kind: CMakeRule
Priority: Fallback
MatchMode: Partial
CmakeSyntax: rule_cuda_compile_06
In: cuda_compile(${libname} ${srcs})
Out: dpct_helper_sycl_compile(${libname} ${srcs})

Expand Down

0 comments on commit 8a5563b

Please sign in to comment.