From 748d8b5cec1c910a42df9d677ee2772ee6f8a95a Mon Sep 17 00:00:00 2001 From: Laurent Morichetti Date: Thu, 9 Jun 2022 22:02:00 -0700 Subject: [PATCH] Cleanup roctracer_hsa.h Remove declarations that are not meant to be part of the public API. Change-Id: I47d9e83bf41bdb2f7ac25a1507200b51c616049b [ROCm/roctracer commit: 05d3cf352902a88029dc220fded36890f76e9d7b] --- projects/roctracer/inc/roctracer_hsa.h | 28 +++---------------- projects/roctracer/script/hsaap.py | 8 ++++++ .../roctracer/src/tracer_tool/tracer_tool.cpp | 3 +- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/projects/roctracer/inc/roctracer_hsa.h b/projects/roctracer/inc/roctracer_hsa.h index bd5b9ef15b..777d4d8ba6 100644 --- a/projects/roctracer/inc/roctracer_hsa.h +++ b/projects/roctracer/inc/roctracer_hsa.h @@ -21,10 +21,12 @@ #ifndef INC_ROCTRACER_HSA_H_ #define INC_ROCTRACER_HSA_H_ +#include + #include #include +#include -#include #include // HSA OP ID enumeration @@ -36,31 +38,9 @@ enum hsa_op_id_t { HSA_OP_ID_NUMBER }; -#ifdef __cplusplus -#include -#include - -namespace roctracer { -namespace hsa_support { -enum { HSA_OP_ID_async_copy = 0 }; - -struct ops_properties_t { +struct hsa_ops_properties_t { void* table; void* reserved1[3]; }; -}; // namespace hsa_support - -typedef hsa_support::ops_properties_t hsa_ops_properties_t; -}; // namespace roctracer - -#include "hsa_ostream_ops.h" - - -#else // !__cplusplus -typedef void* hsa_amd_queue_intercept_handler; -typedef void* hsa_amd_runtime_queue_notifier; -#endif //! __cplusplus - -#include #endif // INC_ROCTRACER_HSA_H_ diff --git a/projects/roctracer/script/hsaap.py b/projects/roctracer/script/hsaap.py index dab2137c2f..113e005a66 100755 --- a/projects/roctracer/script/hsaap.py +++ b/projects/roctracer/script/hsaap.py @@ -318,6 +318,13 @@ class API_DescrParser: self.h_content += '#define ' + out_macro + '\n' self.h_content += self.add_section('API ID enumeration', ' ', self.gen_id_enum) + + self.h_content += '/* Declarations of APIs intended for use only by tools. */\n' + self.h_content += 'typedef void (*hsa_amd_queue_intercept_packet_writer)(const void*, uint64_t);\n' + self.h_content += 'typedef void (*hsa_amd_queue_intercept_handler)(const void*, uint64_t, uint64_t, void*,\n' + self.h_content += ' hsa_amd_queue_intercept_packet_writer);\n' + self.h_content += 'typedef void (*hsa_amd_runtime_queue_notifier)(const hsa_queue_t*, hsa_agent_t, void*);\n' + self.h_content += self.add_section('API arg structure', ' ', self.gen_arg_struct) self.h_content += self.add_section('API output stream', ' ', self.gen_out_stream) self.h_content += '#endif /* ' + out_macro + ' */\n' @@ -486,6 +493,7 @@ class API_DescrParser: content = '' if n == -1: content += '#ifdef __cplusplus\n' + content += '#include \n' content += 'typedef std::pair hsa_api_data_pair_t;\n' content += 'inline std::ostream& operator<< (std::ostream& out, const hsa_api_data_pair_t& data_pair) {\n' content += ' const uint32_t cid = data_pair.first;\n' diff --git a/projects/roctracer/src/tracer_tool/tracer_tool.cpp b/projects/roctracer/src/tracer_tool/tracer_tool.cpp index f627bf5f41..ce980fcad7 100644 --- a/projects/roctracer/src/tracer_tool/tracer_tool.cpp +++ b/projects/roctracer/src/tracer_tool/tracer_tool.cpp @@ -27,8 +27,9 @@ #include #include -#include /* names denangle */ +#include /* kernel name demangling */ #include +#include #include #include #include