@@ -23,19 +23,27 @@ else()
23
23
)
24
24
endif ()
25
25
26
- if (SYCL_ENABLE_XPTI_TRACING )
27
- set (XPTI_PROXY_SRC "${CMAKE_SOURCE_DIR} /../xpti/src/xpti_proxy.cpp" )
28
- endif ()
26
+ if (SYCL_ENABLE_XPTI_TRACING )
27
+ # The following two if's can be removed when FindCUDA -> FindCUDAToolkit.
28
+ # CUDA_CUPTI_INCLUDE_DIR -> CUDAToolkit_CUPTI_INCLUDE_DIR
29
+ include (FindCUDACupti )
30
+ if (NOT CUDA_CUPTI_INCLUDE_DIR )
31
+ find_cuda_cupti_include_dir ()
32
+ endif ()
33
+ # CUDA_cupti_LIBRARY -> CUDAToolkit_cupti_LIBRARY
34
+ if (NOT CUDA_cupti_LIBRARY )
35
+ find_cuda_cupti_library ()
36
+ endif ()
29
37
30
- # The following two if's can be removed when FindCUDA -> FindCUDAToolkit.
31
- # CUDA_CUPTI_INCLUDE_DIR -> CUDAToolkit_CUPTI_INCLUDE_DIR
32
- include ( FindCUDACupti )
33
- if ( NOT CUDA_CUPTI_INCLUDE_DIR )
34
- find_cuda_cupti_include_dir ( )
35
- endif ()
36
- # CUDA_cupti_LIBRARY -> CUDAToolkit_cupti_LIBRARY
37
- if ( NOT CUDA_cupti_LIBRARY )
38
- find_cuda_cupti_library ( )
38
+ set ( XPTI_PROXY_SRC " ${CMAKE_SOURCE_DIR} /../xpti/src/xpti_proxy.cpp" )
39
+ set ( XPTI_INCLUDE
40
+ " ${CMAKE_SOURCE_DIR} /../xpti/ include"
41
+ " ${ CUDA_CUPTI_INCLUDE_DIR} "
42
+ )
43
+ set ( XPTI_LIBS
44
+ " ${CMAKE_DL_LIBS} "
45
+ " ${ CUDA_cupti_LIBRARY} "
46
+ )
39
47
endif ()
40
48
41
49
add_sycl_plugin (cuda
@@ -46,26 +54,20 @@ add_sycl_plugin(cuda
46
54
"pi_cuda.cpp"
47
55
"tracing.cpp"
48
56
${XPTI_PROXY_SRC}
57
+ INCLUDE_DIRS
58
+ ${sycl_inc_dir}
59
+ ${XPTI_INCLUDE}
49
60
LIBRARIES
50
61
cudadrv
51
- ${CUDA_cupti_LIBRARY }
62
+ ${XPTI_LIBS }
52
63
)
53
64
54
65
if (SYCL_ENABLE_XPTI_TRACING )
55
66
target_compile_definitions (pi_cuda PRIVATE
56
67
XPTI_ENABLE_INSTRUMENTATION
57
68
XPTI_STATIC_LIBRARY
58
69
)
59
- target_include_directories (pi_cuda PRIVATE "${CMAKE_SOURCE_DIR} /../xpti/include" )
60
- target_link_libraries (pi_cuda PRIVATE ${CMAKE_DL_LIBS} )
61
70
endif ()
62
71
63
-
64
- target_include_directories (pi_cuda
65
- PRIVATE
66
- ${sycl_inc_dir}
67
- ${CUDA_CUPTI_INCLUDE_DIR}
68
- )
69
-
70
72
set_target_properties (pi_cuda PROPERTIES LINKER_LANGUAGE CXX )
71
73
0 commit comments