Files
rocm-systems/source/lib/rocprofiler/CMakeLists.txt
T
Giovanni Lenzi Baraldi 07aa54c5aa Gbaraldi/pcparser (#58)
* Sample PC sampling parser library

* Fixed error message

* Added correlation_id tests. Fixed correlation_id.

* Fixed some tests.

* Added read_index to dispatch_pkt_id

* Added some comments

* Added more comments

* Moved test.cpp to a move descriptive file

* Added gfxip selection

* Added parser checks. Added GFXIP selection switch.

* Fixed dispatch_pkt_wrap with Joe's comments

* Performance improvement of 25%~100%

* Attempt at reducing overhead of dispatch bookkeeping

* Fixed cache invalidate

* Fixed error message descriptions

* Added GFX12

* Renamed files. Create C-only header.

* Formatting

* Other performance improvement

* source formatting (clang-format v11) (#63)

Co-authored-by: ApoKalipse-V <ApoKalipse-V@users.noreply.github.com>

* Added copyright

* Format-11

* Performance improvement. Added some GFX9 snap tests. Fixed hostTrap selector.

* Clang format.

* Added more gfx9 field tests

* Clang format

* Added parserv2 for pcsampling

* Added multibuffer test

* Created records processor

* Changed bFlipBuffer name

* pcs parser moved to lib/rocprofiler dir

* pcs parser compiles; one test moved

* pcs parser: tests copied from samples folder

The tests currently reside in the single .cpp.
They should be modularized and refactored to distinct unit tests
from integration test.

gfx9 test can fail sometimes. I did not have time
to deal with it.

Since Giovanni will continue working on this, I did not remove
pcs parser from the samples folder.

* cmake formatting (cmake-format) (#149)

Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>

* source formatting (clang-format v11) (#150)

Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>

* pcs parser: failing test removed for now

* pcs parser: fixing static errors and separating template definitions from implementation

* cmake formatting (cmake-format) (#152)

Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>

* source formatting (clang-format v11) (#153)

Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>

* pcs parser: fixing CI/CD errors

* source formatting (clang-format v11) (#154)

Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>

* pcs parser: parsers removed from samples

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ApoKalipse-V <ApoKalipse-V@users.noreply.github.com>
Co-authored-by: vlaindic <vladimir.indic@amd.com>
Co-authored-by: vlaindic <vlaindic@users.noreply.github.com>
2023-10-26 08:14:02 -07:00

127 lines
4.6 KiB
CMake

#
#
#
rocprofiler_activate_clang_tidy()
set(ROCPROFILER_LIB_HEADERS agent.hpp buffer.hpp external_correlation.hpp
internal_threading.hpp registration.hpp)
set(ROCPROFILER_LIB_SOURCES
agent.cpp
buffer.cpp
buffer_tracing.cpp
callback_tracing.cpp
context.cpp
counters.cpp
dispatch_profile.cpp
external_correlation.cpp
internal_threading.cpp
pc_sampling.cpp
profile_config.cpp
rocprofiler.cpp
registration.cpp)
# ----------------------------------------------------------------------------------------#
#
# object library allows us to compile rocprofiler code once and generate both a shared and
# static library
#
# ----------------------------------------------------------------------------------------#
add_library(rocprofiler-object-library OBJECT)
add_library(rocprofiler::rocprofiler-object-library ALIAS rocprofiler-object-library)
target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_SOURCES}
${ROCPROFILER_LIB_HEADERS})
add_subdirectory(hsa)
add_subdirectory(context)
add_subdirectory(counters)
add_subdirectory(aql)
add_subdirectory(pc_sampling)
target_link_libraries(
rocprofiler-object-library
PUBLIC rocprofiler::rocprofiler-headers rocprofiler::rocprofiler-hsa-runtime
rocprofiler::rocprofiler-hip
PRIVATE rocprofiler::rocprofiler-build-flags rocprofiler::rocprofiler-memcheck
rocprofiler::rocprofiler-common-library rocprofiler::rocprofiler-stdcxxfs
rocprofiler::rocprofiler-dl rocprofiler::rocprofiler-amd-comgr)
target_compile_definitions(rocprofiler-object-library PRIVATE rocprofiler_EXPORTS=1)
set_target_properties(rocprofiler-object-library PROPERTIES POSITION_INDEPENDENT_CODE ON)
# ----------------------------------------------------------------------------------------#
#
# shared library
#
# ----------------------------------------------------------------------------------------#
add_library(rocprofiler-shared-library SHARED)
add_library(rocprofiler::rocprofiler-shared-library ALIAS rocprofiler-shared-library)
target_sources(rocprofiler-shared-library
PRIVATE $<TARGET_OBJECTS:rocprofiler::rocprofiler-object-library>)
target_link_libraries(
rocprofiler-shared-library
INTERFACE rocprofiler::rocprofiler-headers rocprofiler::rocprofiler-hsa-runtime
rocprofiler::rocprofiler-hip
PRIVATE rocprofiler::rocprofiler-build-flags
rocprofiler::rocprofiler-memcheck
rocprofiler::rocprofiler-common-library
rocprofiler::rocprofiler-stdcxxfs
rocprofiler::rocprofiler-dl
rocprofiler::rocprofiler-amd-comgr
rocprofiler::rocprofiler-object-library)
set_target_properties(
rocprofiler-shared-library
PROPERTIES OUTPUT_NAME rocprofiler64
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION}
SKIP_BUILD_RPATH OFF
BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
DEFINE_SYMBOL rocprofiler_EXPORTS)
add_library(rocprofiler::rocprofiler-library ALIAS rocprofiler-shared-library)
add_library(rocprofiler::rocprofiler ALIAS rocprofiler-shared-library)
install(
TARGETS rocprofiler-shared-library
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT core
EXPORT ${PROJECT_NAME}-library-targets)
# ----------------------------------------------------------------------------------------#
#
# static library (only built if another target links to it)
#
# ----------------------------------------------------------------------------------------#
add_library(rocprofiler-static-library EXCLUDE_FROM_ALL STATIC)
add_library(rocprofiler::rocprofiler-static-library ALIAS rocprofiler-static-library)
target_sources(rocprofiler-static-library
PRIVATE $<TARGET_OBJECTS:rocprofiler::rocprofiler-object-library>)
target_link_libraries(
rocprofiler-static-library
PUBLIC rocprofiler::rocprofiler-headers rocprofiler::rocprofiler-hsa-runtime
rocprofiler::rocprofiler-hip
PRIVATE rocprofiler::rocprofiler-common-library
rocprofiler::rocprofiler-object-library)
set_target_properties(
rocprofiler-static-library PROPERTIES OUTPUT_NAME rocprofiler64 DEFINE_SYMBOL
rocprofiler_EXPORTS)
# ----------------------------------------------------------------------------------------#
#
# testing
#
# ----------------------------------------------------------------------------------------#
if(ROCPROFILER_BUILD_TESTS)
add_subdirectory(tests)
endif()