Fichiers
rocm-systems/source/docs/CMakeLists.txt
T
Jonathan R. Madsen 9a8b6f6b7b Counter API and Samples Updates (#410)
* Update include/rocprofiler-sdk/{counters,profile_config}.h

- use rocprofiler_agent_id_t instead of rocprofiler_agent_t

* Update samples

- use rocprofiler-sdk::rocprofiler-sdk instead of rocprofiler::rocprofiler in cmake
- api_callback_tracing sample roctxProfiler{Pause,Resume}
- api_callback_tracing sample uses ROCTx
- updates to use rocprofiler_agent_id_t

* Update run-ci.py

- exclude rocprofiler-sdk-tool from samples (no sample uses that code)

* Update lib/rocprofiler-sdk-tool/tool.cpp

- Update rocprofiler_iterate_agent_supported_counters to use agent ID

* Update lib/rocprofiler-sdk/counters/core.*

- profile_config has pointer to agent instead of copy

* Update lib/rocprofiler-sdk/agent.*

- provide get_agent(...) func via rocp agent id

* Update lib/rocprofiler-sdk/{buffer,callback}_tracing.cpp

- return ROCPROFILER_STATUS_ERROR_NOT_IMPLEMENTED for enums missing implementation

* Update lib/rocprofiler-sdk/counters.cpp

- update to use rocprofiler_agent_id_t instead of rocprofiler_agent_t

* Update lib/rocprofiler-sdk/profile_config.cpp

- update to use rocprofiler_agent_id_t instead of rocprofiler_agent_t

* Update source/docs

- requirements.txt + install reqs in cmake

* Bump version to 0.1.0

* Update samples/api_callback_tracing/CMakeLists.txt

- LD_LIBRARY_PATH for test

* Update test/rocprofv3/tracing/CMakeLists.txt

- reorder validation files so memory copy comes first

* Update lib/rocprofiler-sdk-tool/tool.cpp

- logging for flushing buffers
- variables for buffer_size and buffer_watermark
  - increase the watermark to a full buffer
- use dedicated threads for each buffer

* Update lib/rocprofiler-sdk-tool/CMakeLists.txt

- test sets ROCPROF_LOG_LEVEL and ROCPROFILER_LOG_LEVEL to info

* Remove lib/rocprofiler-sdk-tool/trace_buffer.hpp

* Update lib/rocprofiler-sdk-tool/CMakeLists.txt

- drop log level to warning when leak sanitizer is enabled (produces small memory leak)
2024-01-25 23:47:40 -06:00

80 lignes
2.4 KiB
CMake

#
#
if(NOT ROCPROFILER_BUILD_DOCS)
return()
endif()
set(PACKAGE_NAME ${PROJECT_NAME}-sdk)
include(FetchContent)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
cmake_policy(SET CMP0135 NEW)
endif()
if(NOT EXISTS ${PROJECT_BINARY_DIR}/external/miniconda.sh)
file(DOWNLOAD https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
${PROJECT_BINARY_DIR}/external/miniconda.sh)
endif()
find_program(SHELL_CMD NAME bash sh REQUIRED)
function(DOCS_EXECUTE_PROCESS)
string(REPLACE ";" " " _MSG "${ARGN}")
message(STATUS "[rocprofiler][docs] Executing: ${_MSG}")
execute_process(
COMMAND ${ARGN}
RESULT_VARIABLE _RET
OUTPUT_VARIABLE _OUT
ERROR_VARIABLE _ERR
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external)
if(NOT _RET EQUAL 0)
message(STATUS "docs command failed: ${_RET}")
message(STATUS "stderr:\n${_ERR}")
message(STATUS "stdout:\n${_OUT}")
string(REPLACE ";" " " _CMD "${ARGN}")
message(WARNING "command failure: ${_CMD}")
endif()
endfunction()
set(CONDA_ROOT ${PROJECT_BINARY_DIR}/external/miniconda)
if(NOT EXISTS ${CONDA_ROOT})
docs_execute_process(${SHELL_CMD} ${PROJECT_BINARY_DIR}/external/miniconda.sh -b -p
${CONDA_ROOT})
docs_execute_process(${CONDA_ROOT}/bin/conda config --set always_yes yes)
docs_execute_process(${CONDA_ROOT}/bin/conda update -c defaults -n base conda)
endif()
if(NOT EXISTS ${CONDA_ROOT}/envs/rocprofiler-docs)
docs_execute_process(${CONDA_ROOT}/bin/conda env create -n rocprofiler-docs -f
${CMAKE_CURRENT_LIST_DIR}/environment.yml)
docs_execute_process(${CONDA_ROOT}/envs/rocprofiler-docs/bin/python -m pip install -r
${CMAKE_CURRENT_LIST_DIR}/requirements.txt)
endif()
file(
WRITE "${CMAKE_CURRENT_BINARY_DIR}/build-docs.sh"
"#!${SHELL_CMD} -e
PATH=${CONDA_ROOT}/bin:\${PATH}
export PATH
source activate
conda activate rocprofiler-docs
${PROJECT_SOURCE_DIR}/source/scripts/update-docs.sh 1> /dev/null
rm -r ${PROJECT_SOURCE_DIR}/build-docs
")
add_custom_target(docs ALL ${SHELL_CMD} ${CMAKE_CURRENT_BINARY_DIR}/build-docs.sh)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/_build/html/
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/html/${PACKAGE_NAME}
COMPONENT docs
USE_SOURCE_PERMISSIONS FILES_MATCHING
PATTERN "*")