From 074306d997a8dcbc3e8a414ca0849c61bf11f544 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 18 May 2020 15:34:40 -0500 Subject: [PATCH] SWDEV-236864 : packaging of generated headers Change-Id: Ifda69eecf3697f6b69c978b3c4c2ffe9835edeb8 --- .gitignore | 5 ----- CMakeLists.txt | 15 +++++++++++--- doc/roctracer_spec.md | 8 ++++---- inc/roctracer.h | 2 +- inc/{cb_table.h => roctracer_cb_table.h} | 2 +- inc/roctracer_ext.h | 2 +- inc/roctracer_hcc.h | 2 +- inc/roctracer_hip.h | 4 ++-- inc/roctracer_hsa.h | 4 ++-- inc/roctracer_kfd.h | 8 ++++---- inc/roctracer_roctx.h | 2 +- script/kfdap.py | 6 +++--- test/CMakeLists.txt | 2 +- test/MatrixTranspose/MatrixTranspose.cpp | 2 +- test/MatrixTranspose_test/MatrixTranspose.cpp | 14 ++++++------- test/tool/tracer_tool.cpp | 20 +++++++++---------- 16 files changed, 51 insertions(+), 47 deletions(-) rename inc/{cb_table.h => roctracer_cb_table.h} (98%) diff --git a/.gitignore b/.gitignore index 446848fea5..331d63fdd6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,12 +4,7 @@ *.exe *.swp *.Po -b build -inc/hsa_prof_str.h -inc/kfd_prof_str.h -inc/basic_ostream_ops.h -inc/kfd_ostream_ops.h test/hsa test/MatrixTranspose/MatrixTranspose test/MatrixTranspose_test/MatrixTranspose diff --git a/CMakeLists.txt b/CMakeLists.txt index 81d467b782..db3cb3fb9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,13 +89,22 @@ add_subdirectory ( ${TEST_DIR} ${PROJECT_BINARY_DIR}/test ) ## pbulic headers set ( PUBLIC_HEADERS + roctx.h roctracer.h - roctracer_hip.h - roctracer_hcc.h roctracer_ext.h + roctracer_hcc.h + roctracer_hip.h + roctracer_hsa.h + roctracer_kfd.h + roctracer_roctx.h + roctracer_cb_table.h + basic_ostream_ops.h + hip_ostream_ops.h + hsa_prof_str.h + kfd_ostream_ops.h + kfd_prof_str.h ext/prof_protocol.h ext/hsa_rt_utils.hpp - roctx.h ) ## Installation and packaging diff --git a/doc/roctracer_spec.md b/doc/roctracer_spec.md index 28f8ffcc27..33666bd97d 100644 --- a/doc/roctracer_spec.md +++ b/doc/roctracer_spec.md @@ -389,8 +389,8 @@ void roctracer_stop(); ## 4. rocTracer Usage Code Examples ### 4.1. HIP API and HCC ops, GPU Activity Tracing ``` -#include -#include +#include +#include // HIP API callback function void hip_api_callback( @@ -610,8 +610,8 @@ int main() { ///////////////////////////////////////////////////////////////////////////// // HIP/HCC Callbacks/Activity tracing ///////////////////////////////////////////////////////////////////////////// -#include -#include +#include +#include // Macro to check ROC-tracer calls status #define ROCTRACER_CALL(call) \ diff --git a/inc/roctracer.h b/inc/roctracer.h index 67fe3f5a3d..cc96b455d9 100644 --- a/inc/roctracer.h +++ b/inc/roctracer.h @@ -42,7 +42,7 @@ THE SOFTWARE. #include #endif -#include "ext/prof_protocol.h" +#include #define ROCTRACER_VERSION_MAJOR 3 #define ROCTRACER_VERSION_MINOR 0 diff --git a/inc/cb_table.h b/inc/roctracer_cb_table.h similarity index 98% rename from inc/cb_table.h rename to inc/roctracer_cb_table.h index 5d10f5b8ba..cda8b90606 100644 --- a/inc/cb_table.h +++ b/inc/roctracer_cb_table.h @@ -23,7 +23,7 @@ THE SOFTWARE. #ifndef CB_TABLE_H_ #define CB_TABLE_H_ -#include "ext/prof_protocol.h" +#include #include diff --git a/inc/roctracer_ext.h b/inc/roctracer_ext.h index 172966af6d..4525e6414e 100644 --- a/inc/roctracer_ext.h +++ b/inc/roctracer_ext.h @@ -32,7 +32,7 @@ THE SOFTWARE. #ifndef INC_ROCTRACER_EXT_H_ #define INC_ROCTRACER_EXT_H_ -#include "roctracer.h" +#include typedef void (*roctracer_start_cb_t)(); typedef void (*roctracer_stop_cb_t)(); diff --git a/inc/roctracer_hcc.h b/inc/roctracer_hcc.h index 0781460145..2133617945 100644 --- a/inc/roctracer_hcc.h +++ b/inc/roctracer_hcc.h @@ -40,6 +40,6 @@ typedef const char* (hipGetOpName_t)(unsigned op); } #endif -#include "roctracer.h" +#include #endif // INC_ROCTRACER_HCC_H_ diff --git a/inc/roctracer_hip.h b/inc/roctracer_hip.h index d6ce158d14..86ffc1ae31 100644 --- a/inc/roctracer_hip.h +++ b/inc/roctracer_hip.h @@ -23,11 +23,11 @@ THE SOFTWARE. #ifndef INC_ROCTRACER_HIP_H_ #define INC_ROCTRACER_HIP_H_ -#include "inc/hip_ostream_ops.h" +#include #include #include -#include "roctracer.h" +#include #ifdef __cplusplus extern "C" { diff --git a/inc/roctracer_hsa.h b/inc/roctracer_hsa.h index 625fa0b760..2704850646 100644 --- a/inc/roctracer_hsa.h +++ b/inc/roctracer_hsa.h @@ -26,7 +26,7 @@ THE SOFTWARE. #include #include -#include "roctracer.h" +#include // HSA OP ID enumeration enum hsa_op_id_t { @@ -143,5 +143,5 @@ typedef void* hsa_amd_queue_intercept_handler; typedef void* hsa_amd_runtime_queue_notifier; #endif //! __cplusplus -#include "inc/hsa_prof_str.h" +#include #endif // INC_ROCTRACER_HSA_H_ diff --git a/inc/roctracer_kfd.h b/inc/roctracer_kfd.h index fcc1e3cd87..dd407588b2 100644 --- a/inc/roctracer_kfd.h +++ b/inc/roctracer_kfd.h @@ -23,12 +23,12 @@ THE SOFTWARE. ///////////////////////////////////////////////////////////////////////////// #ifndef INC_ROCTRACER_KFD_H_ #define INC_ROCTRACER_KFD_H_ -#include "roctracer.h" -#include "hsakmt.h" +#include +#include #ifdef __cplusplus -#include "inc/kfd_ostream_ops.h" +#include #endif -#include "inc/kfd_prof_str.h" +#include #endif // INC_ROCTRACER_KFD_H_ diff --git a/inc/roctracer_roctx.h b/inc/roctracer_roctx.h index accec45255..2ce749c2bc 100644 --- a/inc/roctracer_roctx.h +++ b/inc/roctracer_roctx.h @@ -59,7 +59,7 @@ typedef struct roctx_api_data_s { } roctx_api_data_t; #ifdef __cplusplus -#include "cb_table.h" +#include namespace roctx { // ROCTX callbacks table type typedef roctracer::CbTable cb_table_t; diff --git a/script/kfdap.py b/script/kfdap.py index a9c6defb5f..e920bbf6d9 100755 --- a/script/kfdap.py +++ b/script/kfdap.py @@ -283,8 +283,8 @@ class API_DescrParser: self.content_h += '#include \n' self.content_h += '#include \n' - self.content_h += '#include \"roctracer_kfd.h\"\n' - self.content_h += '#include \"hsakmt.h\"\n' + self.content_h += '#include \n' + self.content_h += '#include \n' self.content_h += '#define PUBLIC_API __attribute__((visibility(\"default\")))\n' @@ -293,7 +293,7 @@ class API_DescrParser: self.content_h += '\n' self.content_h += '#if PROF_API_IMPL\n' - self.content_h += '#include \"cb_table.h\"\n' + self.content_h += '#include \n' self.content_h += 'namespace roctracer {\n' self.content_h += 'namespace kfd_support {\n' diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9d78fd4025..d0d18b4da5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -55,7 +55,7 @@ file( GLOB UTIL_SRC "${HSA_TEST_DIR}/util/*.cpp" ) set ( TEST_LIB "tracer_tool" ) set ( TEST_LIB_SRC ${TEST_DIR}/tool/tracer_tool.cpp ${UTIL_SRC} ) add_library ( ${TEST_LIB} SHARED ${TEST_LIB_SRC} ) -target_include_directories ( ${TEST_LIB} PRIVATE ${HSA_TEST_DIR} ${ROOT_DIR} ${HSA_RUNTIME_INC_PATH} ${HSA_RUNTIME_HSA_INC_PATH} ${HIP_INC_DIR} ${HCC_INC_DIR} ${HSA_KMT_INC_PATH} ) +target_include_directories ( ${TEST_LIB} PRIVATE ${HSA_TEST_DIR} ${ROOT_DIR} ${ROOT_DIR}/inc ${HSA_RUNTIME_INC_PATH} ${HSA_RUNTIME_HSA_INC_PATH} ${HIP_INC_DIR} ${HCC_INC_DIR} ${HSA_KMT_INC_PATH} ) target_link_libraries ( ${TEST_LIB} ${ROCTRACER_TARGET} ${HSA_RUNTIME_LIB} c stdc++ dl pthread rt ) ## Build HSA test diff --git a/test/MatrixTranspose/MatrixTranspose.cpp b/test/MatrixTranspose/MatrixTranspose.cpp index 264cf2d93b..cb7430b8b2 100644 --- a/test/MatrixTranspose/MatrixTranspose.cpp +++ b/test/MatrixTranspose/MatrixTranspose.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include #include "roctracer_ext.h" // roctx header file -#include +#include #define WIDTH 1024 diff --git a/test/MatrixTranspose_test/MatrixTranspose.cpp b/test/MatrixTranspose_test/MatrixTranspose.cpp index e023e7f6d0..18adbcfb1e 100644 --- a/test/MatrixTranspose_test/MatrixTranspose.cpp +++ b/test/MatrixTranspose_test/MatrixTranspose.cpp @@ -32,9 +32,9 @@ using namespace std; #endif // roctx header file -#include +#include // roctracer extension API -#include +#include const size_t msg_size = 512; char* msg_buf = NULL; @@ -225,11 +225,11 @@ int main() { // HIP Callbacks/Activity tracing // #if 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include /* For SYS_xxx definitions */ diff --git a/test/tool/tracer_tool.cpp b/test/tool/tracer_tool.cpp index b4a0064a72..dea72aa8d3 100644 --- a/test/tool/tracer_tool.cpp +++ b/test/tool/tracer_tool.cpp @@ -32,18 +32,18 @@ THE SOFTWARE. #include #include /* usleep */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include "src/core/loader.h" +#include "src/core/trace_buffer.h" #include "util/hsa_rsrc_factory.h" +#include "util/xml.h" #define PUBLIC_API __attribute__((visibility("default"))) #define CONSTRUCTOR_API __attribute__((constructor))