Skip to content

Commit 059caf8

Browse files
Merge branch 'SYCLomatic' into cmake_script_migration_lit_part2
2 parents 1aa2d51 + 7a3205c commit 059caf8

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: rm -rf %T && mkdir -p %T
2+
// RUN: cd %T
3+
// RUN: cp %S/input.cmake ./input.cmake
4+
// RUN: dpct -in-root ./ -out-root out ./input.cmake --migrate-cmake-script-only
5+
// RUN: echo "begin" > %T/diff.txt
6+
// RUN: diff --strip-trailing-cr %S/expected.txt %T/out/input.cmake >> %T/diff.txt
7+
// RUN: echo "end" >> %T/diff.txt
8+
9+
// CHECK: begin
10+
// CHECK-NEXT: end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dpct_helper_compile_sycl_code(CUDA_FATBINS ${CUDA_FATBIN_SOURCE})
2+
3+
dpct_helper_compile_sycl_code(FATBINS main.dp.cpp)
4+
5+
dpct_helper_compile_sycl_code(${TARGET} ${CMAKE_SOURCE_DIR}/foo/bar/util.dp.cpp)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cuda_compile_fatbin(CUDA_FATBINS ${CUDA_FATBIN_SOURCE})
2+
3+
cuda_compile_fatbin(FATBINS main.cu OPTIONS -arch=sm80)
4+
5+
cuda_compile_fatbin(${TARGET} ${CMAKE_SOURCE_DIR}/foo/bar/util.cu)

clang/tools/dpct/DpctOptRules/cmake_script_migration_rule.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,31 @@
509509
MatchMode: Full
510510
RuleId: "remove_-static-libstdc++"
511511

512+
- Rule: rule_cuda_compile_fatbin
513+
Kind: CMakeRule
514+
Priority: Fallback
515+
CmakeSyntax: cuda_compile_fatbin
516+
In: cuda_compile_fatbin(${value})
517+
Out: dpct_helper_compile_sycl_code(${value})
518+
Subrules:
519+
value:
520+
In: ${arg}.cu
521+
Out: ${arg}.dp.cpp
522+
MatchMode: Partial
523+
RuleId: "replace_source_extension_with_dp_cpp"
524+
525+
- Rule: rule_cuda_compile_fatbin_remove_opts
526+
Kind: CMakeRule
527+
Priority: Fallback
528+
CmakeSyntax: cuda_compile_fatbin_opts
529+
In: dpct_helper_compile_sycl_code(${value} OPTIONS ${options})
530+
Out: dpct_helper_compile_sycl_code(${value})
531+
512532
- Rule: rule_cuda_add_cufft_to_target
513533
Kind: CMakeRule
514534
Priority: Fallback
515535
CmakeSyntax: cuda_add_cufft_to_target
516536
In: cuda_add_cufft_to_target(${target})
517537
Out: dpct_helper_add_mkl_to_target(${target})
518538

539+

0 commit comments

Comments
 (0)