Skip to content

Commit

Permalink
Merge branch 'SYCLomatic' into cmake_script_migration_lit_part2
Browse files Browse the repository at this point in the history
  • Loading branch information
TejaX-Alaghari authored Jan 6, 2024
2 parents 1aa2d51 + 7a3205c commit 059caf8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
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-cmake-script-only
// 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
5 changes: 5 additions & 0 deletions clang/test/dpct/cmake_migration/case_007/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dpct_helper_compile_sycl_code(CUDA_FATBINS ${CUDA_FATBIN_SOURCE})

dpct_helper_compile_sycl_code(FATBINS main.dp.cpp)

dpct_helper_compile_sycl_code(${TARGET} ${CMAKE_SOURCE_DIR}/foo/bar/util.dp.cpp)
5 changes: 5 additions & 0 deletions clang/test/dpct/cmake_migration/case_007/input.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cuda_compile_fatbin(CUDA_FATBINS ${CUDA_FATBIN_SOURCE})

cuda_compile_fatbin(FATBINS main.cu OPTIONS -arch=sm80)

cuda_compile_fatbin(${TARGET} ${CMAKE_SOURCE_DIR}/foo/bar/util.cu)
21 changes: 21 additions & 0 deletions clang/tools/dpct/DpctOptRules/cmake_script_migration_rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,31 @@
MatchMode: Full
RuleId: "remove_-static-libstdc++"

- Rule: rule_cuda_compile_fatbin
Kind: CMakeRule
Priority: Fallback
CmakeSyntax: cuda_compile_fatbin
In: cuda_compile_fatbin(${value})
Out: dpct_helper_compile_sycl_code(${value})
Subrules:
value:
In: ${arg}.cu
Out: ${arg}.dp.cpp
MatchMode: Partial
RuleId: "replace_source_extension_with_dp_cpp"

- Rule: rule_cuda_compile_fatbin_remove_opts
Kind: CMakeRule
Priority: Fallback
CmakeSyntax: cuda_compile_fatbin_opts
In: dpct_helper_compile_sycl_code(${value} OPTIONS ${options})
Out: dpct_helper_compile_sycl_code(${value})

- Rule: rule_cuda_add_cufft_to_target
Kind: CMakeRule
Priority: Fallback
CmakeSyntax: cuda_add_cufft_to_target
In: cuda_add_cufft_to_target(${target})
Out: dpct_helper_add_mkl_to_target(${target})


0 comments on commit 059caf8

Please sign in to comment.