Package RCCL headers to support adding RCCL support w/o installed headers (#1075)

- in ROCm CI, rocprofiler-sdk gets built before RCCL is installed, this is a workaround for this issue

[ROCm/rocprofiler-sdk commit: 8c1382fceb]
This commit is contained in:
Jonathan R. Madsen authored and GitHub committed 2024-09-12 18:24:50 -05:00
1 parent 3a5154c5ff
commit fcd6cc45bd
16 files changed
+1235 -102

No files matched your search

@@ -99,6 +99,13 @@ else()
add_library(@PACKAGE_NAME@::@PACKAGE_NAME@-external-nolink INTERFACE IMPORTED)
# if rccl not found or <rccl/amd_detail/api_trace.h> not found when rocprofiler-sdk
# was built, use the packaged rccl.h and api_trace.h
if(NOT @rccl_FOUND@ OR NOT @rccl_API_TRACE_FOUND@)
target_compile_definitions(@PACKAGE_NAME@::@PACKAGE_NAME@-external-nolink
INTERFACE ROCPROFILER_SDK_USE_SYSTEM_RCCL=0)
endif()
include("${@PACKAGE_NAME@_CMAKE_DIR}/@PACKAGE_NAME@-targets.cmake")
@PROJECT_NAME@_config_nolink_target(@PACKAGE_NAME@::@PACKAGE_NAME@-external-nolink hip::host)
@@ -301,9 +301,9 @@ target_link_libraries(rocprofiler-otf2 INTERFACE otf2::otf2)
# RCCL
#
# ----------------------------------------------------------------------------------------#
find_package(
rccl
REQUIRED
CONFIG
HINTS
${rocm_version_DIR}
@@ -314,4 +314,14 @@ find_package(
PATH_SUFFIXES
lib/cmake/rccl)
rocprofiler_config_nolink_target(rocprofiler-rccl-nolink rccl::rccl)
if(rccl_FOUND
AND rccl_INCLUDE_DIR
AND EXISTS "${rccl_INCLUDE_DIR}/rccl/amd_detail/api_trace.h")
set(rccl_API_TRACE_FOUND ON)
rocprofiler_config_nolink_target(rocprofiler-rccl-nolink rccl::rccl)
else()
set(rccl_API_TRACE_FOUND OFF)
target_compile_definitions(rocprofiler-rccl-nolink
INTERFACE ROCPROFILER_SDK_USE_SYSTEM_RCCL=0)
endif()