Split hsa_prof_str.h

Split the public and private HSA profiler/tracer interfaces. Only the
public interface should be exposed in include/roctracer.

Change-Id: I7e4424cd90023693350c31e6b02caca8c984ba84


[ROCm/roctracer commit: 96bcac0f47]
This commit is contained in:
Laurent Morichetti
2022-06-13 08:20:11 -07:00
committed by Laurent Morichetti
vanhempi b1c2e08191
commit 71469dfc97
4 muutettua tiedostoa jossa 176 lisäystä ja 164 poistoa
+3 -3
Näytä tiedosto
@@ -54,12 +54,12 @@ get_filename_component(HSA_RUNTIME_INC_PATH ${HSA_H} DIRECTORY)
## Generate the HSA wrapper functions header
add_custom_command(
OUTPUT hsa_prof_str.h
OUTPUT hsa_prof_str.h hsa_prof_str.inline.h
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/script/hsaap.py ${CMAKE_CURRENT_BINARY_DIR} "${HSA_RUNTIME_INC_PATH}" > /dev/null
DEPENDS ${PROJECT_SOURCE_DIR}/script/hsaap.py
"${HSA_RUNTIME_INC_PATH}/hsa.h" "${HSA_RUNTIME_INC_PATH}/hsa_ext_amd.h"
"${HSA_RUNTIME_INC_PATH}/hsa_ext_image.h" "${HSA_RUNTIME_INC_PATH}/hsa_api_trace.h"
COMMENT "Generating hsa_prof_str.h...")
COMMENT "Generating hsa_prof_str.h,hsa_prof_str.inline.h...")
## Generate the HSA pretty printers
add_custom_command(
@@ -122,7 +122,7 @@ endforeach()
## Build the ROCtracer library
file(GLOB ROCTRACER_SOURCES "roctracer/*.cpp" "util/*.cpp")
add_library(roctracer ${LIBRARY_TYPE} ${ROCTRACER_SOURCES} ${GENERATED_HEADERS})
add_library(roctracer ${LIBRARY_TYPE} ${ROCTRACER_SOURCES} ${GENERATED_HEADERS} hsa_prof_str.inline.h)
set_target_properties(roctracer PROPERTIES
CXX_VISIBILITY_PRESET hidden
@@ -26,6 +26,7 @@
#include <assert.h>
#include <dirent.h>
#include <hsa/hsa_api_trace.h>
#include <string.h>
#include <sys/syscall.h>
#include <unistd.h>
@@ -43,6 +44,8 @@
#include "exception.h"
#include "util/logger.h"
#include "hsa_prof_str.inline.h"
#define CHECK_HSA_STATUS(msg, status) \
do { \
if ((status) != HSA_STATUS_SUCCESS) { \
@@ -124,17 +127,9 @@ void RestoreHsaApi() {
table->amd_ext_->hsa_amd_memory_async_copy_rect_fn = hsa_amd_memory_async_copy_rect_fn;
}
// callbacks table
cb_table_t cb_table;
// async copy activity callback
bool async_copy_callback_enabled = false;
MemoryPool* async_copy_callback_memory_pool = nullptr;
// Table of function pointers to HSA Core Runtime
CoreApiTable CoreApiTable_saved{};
// Table of function pointers to AMD extensions
AmdExtTable AmdExtTable_saved{};
// Table of function pointers to HSA Image Extension
ImageExtTable ImageExtTable_saved{};
} // namespace hsa_support