Add RSMI ref manual to packages
Also,
* remove extraneous test files
* fix Doxygen docs. issues
* fix whitespace issues
Change-Id: I9b58b0d68bd125a34f4fe0dc84d609c7b0b6e30e
[ROCm/amdsmi commit: 8ced9c986a]
Этот коммит содержится в:
@@ -200,6 +200,38 @@ install(FILES ${SOURCE_DIR}/include/rocm_smi/rocm_smi.h
|
||||
install(FILES ${SOURCE_DIR}/include/rocm_smi/kfd_ioctl.h
|
||||
DESTINATION rocm_smi/include/rocm_smi)
|
||||
|
||||
# Generate Doxygen documentation
|
||||
find_package(Doxygen)
|
||||
find_package(LATEX COMPONENTS PDFLATEX)
|
||||
if (DOXYGEN_FOUND AND LATEX_FOUND)
|
||||
set (RSMI_MANUAL_NAME "ROCm_SMI_Manual")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/rsmi_doxygen.cfg
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.tex
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/docs/rsmi_doxygen.cfg
|
||||
"${INC_DIR}/rocm_smi.h"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/docs/README.md
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf
|
||||
COMMAND make > /dev/null
|
||||
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/docs/${RSMI_MANUAL_NAME}.pdf
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.tex
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/latex)
|
||||
|
||||
add_custom_target(docs DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf)
|
||||
|
||||
add_dependencies(${ROCM_SMI_TARGET} docs)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf
|
||||
DESTINATION ${ROCM_SMI}/docs/${RSMI_MANUAL_NAME}.pdf)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/docs/README.md
|
||||
DESTINATION ${ROCM_SMI}/docs/)
|
||||
else()
|
||||
message("Doxygen or Latex is not found. Will not generate documents.")
|
||||
endif(DOXYGEN_FOUND AND LATEX_FOUND)
|
||||
|
||||
## Add the packaging directives for the runtime library.
|
||||
|
||||
# TODO set(CPACK_DEBIAN_PACKAGE_HOMEPAGE <GITHUB URL> )
|
||||
@@ -219,16 +251,4 @@ set (CPACK_RPM_PACKAGE_VERSION ${PKG_VERSION_STR})
|
||||
|
||||
include (CPack)
|
||||
|
||||
# Generate Doxygen documentation
|
||||
find_package(Doxygen)
|
||||
if (DOXYGEN_FOUND)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/rsmi_doxygen.cfg
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
||||
add_custom_target(doc
|
||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating API documentation with Doxygen" VERBATIM)
|
||||
else()
|
||||
message("Doxygen is not found. Will not generate documents.")
|
||||
endif(DOXYGEN_FOUND)
|
||||
|
||||
|
||||
Двоичные данные
Двоичный файл не отображается.
@@ -256,9 +256,8 @@ typedef struct {
|
||||
uint64_t time_running; //!< Time that che counter was running
|
||||
} rsmi_counter_value_t;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Event notification event types
|
||||
* See <linux/kfd_ioctl.h>
|
||||
*/
|
||||
typedef enum {
|
||||
RSMI_EVT_NOTIF_VMFAULT = KFD_SMI_EVENT_VMFAULT, //!< VM page fault
|
||||
@@ -276,7 +275,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
uint32_t dv_ind; //!< Index of device that corresponds to the event
|
||||
rsmi_evt_notification_type_t event; //!< Event type
|
||||
char message[MAX_EVENT_NOTIFICATION_MSG_SIZE]; // Event message
|
||||
char message[MAX_EVENT_NOTIFICATION_MSG_SIZE]; //!< Event message
|
||||
} rsmi_evt_notification_data_t;
|
||||
|
||||
/**
|
||||
@@ -2933,15 +2932,13 @@ rsmi_func_iter_value_get(rsmi_func_id_iter_handle_t handle,
|
||||
/**
|
||||
* @brief Prepare to collect event notifications for a GPU
|
||||
*
|
||||
* @param dv_ind a device index corresponding to the device on which to
|
||||
* listen for events
|
||||
*
|
||||
* @details This function prepares to collect events for the GPU with device
|
||||
* ID @p dv_ind, by initializing any required system parameters. This call
|
||||
* may open files which will remain open until ::rsmi_event_notification_stop()
|
||||
* is called.
|
||||
*
|
||||
* @param[in] unused The parameter is currently ignored
|
||||
*
|
||||
* @param dv_ind a device index corresponding to the device on which to
|
||||
* listen for events
|
||||
*
|
||||
* @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.
|
||||
*/
|
||||
@@ -2950,7 +2947,7 @@ rsmi_event_notification_init(uint32_t dv_ind);
|
||||
|
||||
/**
|
||||
* @brief Specify which events to collect for a device
|
||||
*
|
||||
*
|
||||
* @details Given a device index @p dv_ind and a @p mask consisting of
|
||||
* elements of ::rsmi_evt_notification_type_t OR'd together, this function
|
||||
* will listen for the events specified in @p mask on the device
|
||||
@@ -2962,7 +2959,7 @@ rsmi_event_notification_init(uint32_t dv_ind);
|
||||
* @param mask 0 or more elements of ::rsmi_evt_notification_type_t OR'd
|
||||
* together that indicate which event types to listen for.
|
||||
*
|
||||
* @retval ::RSMI_INITIALIZATION_ERROR is returned if
|
||||
* @retval ::RSMI_STATUS_INIT_ERROR is returned if
|
||||
* ::rsmi_event_notification_init() has not been called before a call to this
|
||||
* function
|
||||
*
|
||||
@@ -2990,6 +2987,9 @@ rsmi_event_notification_mask_set(uint32_t dv_ind, uint64_t mask);
|
||||
* occurrance of the events on the respective devices that were previously
|
||||
* specified by ::rsmi_event_notification_mask_set().
|
||||
*
|
||||
* @param[in] timeout_ms number of milliseconds to wait for an event
|
||||
* to occur
|
||||
*
|
||||
* @param[inout] num_elem pointer to uint32_t, provided by the caller. On
|
||||
* input, this value tells how many ::rsmi_evt_notification_data_t elements
|
||||
* are being provided by the caller with @p data. On output, the location
|
||||
@@ -3009,10 +3009,10 @@ rsmi_event_notification_mask_set(uint32_t dv_ind, uint64_t mask);
|
||||
*
|
||||
*/
|
||||
rsmi_status_t
|
||||
rsmi_event_notification_get(int timout_ms,
|
||||
rsmi_event_notification_get(int timeout_ms,
|
||||
uint32_t *num_elem, rsmi_evt_notification_data_t *data);
|
||||
|
||||
/*
|
||||
/**
|
||||
* @brief Close any file handles and free any resources used by event
|
||||
* notification for a GPU
|
||||
*
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
|
||||
# these are required:
|
||||
ROCM_DIR=/home/cfreehil/github/rocm_smi_lib/build
|
||||
#ROCM_DIR=/opt/rocm
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
cmake -DROCRTST_BLD_TYPE=$ROCRTST_BLD_TYPE \
|
||||
-DROCM_DIR=$ROCM_DIR \
|
||||
-DROCRTST_BLD_TYPE="Debug" \
|
||||
..
|
||||
|
||||
echo "Executing \"make\"..."
|
||||
make
|
||||
|
||||
cd ..
|
||||
Ссылка в новой задаче
Block a user