File tree 4 files changed +43
-0
lines changed
test/dpct/cmake_migation/case_012
4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
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 --rule-file=%S/../../../../tools/dpct/DpctOptRules/cmake_script_migration_rule.yaml --migrate-cmake-script-only --cuda-include-path="%cuda-path/include"
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
Original file line number Diff line number Diff line change
1
+ add_library(culib)
2
+ add_executable(cuexe)
3
+ dpct_add_mkl_to_target(culib)
4
+ dpct_add_mkl_to_target(
5
+ culib
6
+ )
7
+
8
+ dpct_add_mkl_to_target(cuexe)
9
+ dpct_add_mkl_to_target(
10
+ cuexe
11
+ )
Original file line number Diff line number Diff line change
1
+ add_library (culib)
2
+ add_executable (cuexe)
3
+ CUDA_ADD_CUFFT_TO_TARGET(culib)
4
+ cuda_add_cufft_to_target(
5
+ culib
6
+ )
7
+
8
+ CUDA_ADD_CUFFT_TO_TARGET(cuexe)
9
+ cuda_add_cufft_to_target(
10
+ cuexe
11
+ )
Original file line number Diff line number Diff line change @@ -78,3 +78,14 @@ endmacro()
78
78
# Always set SYCL_HAS_FP16 to true to assume SYCL device to support float16
79
79
message ("dpct.cmake: SYCL_HAS_FP16 is set true by default." )
80
80
set (SYCL_HAS_FP16 TRUE )
81
+
82
+ # Link MKL library to target
83
+ macro (DPCT_ADD_MKL_TO_TARGET target )
84
+ if (WIN32 )
85
+ target_link_libraries (${target} mkl_sycl_dll.lib mkl_intel_ilp64_dll.lib mkl_tbb_thread_dll.lib mkl_core_dll.lib OpenCL.lib)
86
+ elseif (UNIX AND NOT APPLE )
87
+ target_link_libraries (${target} -L${MKLROOT} /lib/intel64 -lmkl_intel_ilp64 -lmkl_tbb_thread -lmkl_core -lOpenCL -lmkl_sycl -lpthread -ldl)
88
+ else ()
89
+ message (FATAL_ERROR "Unsupported platform" )
90
+ endif ()
91
+ endmacro ()
You can’t perform that action at this time.
0 commit comments