File tree Expand file tree Collapse file tree
test/dpct/cmake_migation/case_012 Expand file tree Collapse file tree 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 --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
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 233233 MatchMode : Full
234234 RuleId : " adjust CUDA src file extension"
235235
236+ - Rule : rule_cuda_add_cufft_to_target
237+ Kind : CMakeRule
238+ Priority : Fallback
239+ CmakeSyntax : cuda_add_cufft_to_target
240+ In : cuda_add_cufft_to_target(${target})
241+ Out : dpct_add_mkl_to_target(${target})
242+
Original file line number Diff line number Diff line change @@ -78,3 +78,14 @@ endmacro()
7878# Always set SYCL_HAS_FP16 to true to assume SYCL device to support float16
7979message ("dpct.cmake: SYCL_HAS_FP16 is set true by default." )
8080set (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