Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(roctxconnector): link rocprofiler-sdk-roctx as of ROCm 6.2 #278

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-with-kokkos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- image: rocm/dev-ubuntu-22.04:5.4
preset: ROCm
compiler: default
- image: rocm/dev-ubuntu-22.04:5.7
- image: rocm/dev-ubuntu-22.04:6.3
preset: ROCm
compiler: default
container:
Expand Down
19 changes: 14 additions & 5 deletions profiling/roctx-connector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
find_library(ROCM_ROCTX_LIB roctx64 REQUIRED HINTS $ENV{ROCM_PATH}/lib)
find_path(ROCM_ROCTX_INCLUDE roctx.h REQUIRED HINTS $ENV{ROCM_PATH}/include/roctracer)

kp_add_library(kp_roctx_connector kp_roctx_connector.cpp)

target_include_directories(kp_roctx_connector PRIVATE ${ROCM_ROCTX_INCLUDE})
target_link_libraries(kp_roctx_connector PRIVATE ${ROCM_ROCTX_LIB})
# As of ROCm 6.2, it is recommended to use ROCtx provided by rocprofiler-sdk-roctx
# instead of the "old" one provided by roctracer.
#
# See also: https://rocm.docs.amd.com/projects/rocprofiler-sdk/en/amd-mainline/how-to/using-rocprofv3.html
find_package(rocprofiler-sdk-roctx CONFIG PATHS $ENV{ROCM_PATH})
if(rocprofiler-sdk-roctx_FOUND)
target_link_libraries(kp_roctx_connector PRIVATE rocprofiler-sdk-roctx::rocprofiler-sdk-roctx)
else()
find_library(ROCM_ROCTX_LIB roctx64 REQUIRED HINTS $ENV{ROCM_PATH}/lib)
find_path(ROCM_ROCTX_INCLUDE roctx.h REQUIRED HINTS $ENV{ROCM_PATH}/include/roctracer)

target_include_directories(kp_roctx_connector PRIVATE ${ROCM_ROCTX_INCLUDE})
target_link_libraries(kp_roctx_connector PRIVATE ${ROCM_ROCTX_LIB})
endif()
4 changes: 4 additions & 0 deletions profiling/roctx-connector/kp_roctx_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
//
//@HEADER

#if __has_include(<rocprofiler-sdk-roctx/roctx.h>)
#include <rocprofiler-sdk-roctx/roctx.h>
#else
#include <roctx.h>
#endif

#include <cstdint>
#include <iostream>
Expand Down
Loading