diff --git a/script/hsaap.py b/script/hsaap.py index 9d93b65799..a046e4c962 100755 --- a/script/hsaap.py +++ b/script/hsaap.py @@ -273,7 +273,7 @@ class API_DescrParser: for i in range(0, len(api_headers)): (name, header) = api_headers[i] - + if i < len(api_headers) - 1: api = API_TableParser(hsa_dir + api_table_h, name) api_list = api.array @@ -304,7 +304,7 @@ class API_DescrParser: self.ns_calls = ns_calls self.content += "// automatically generated\n\n" + license + '\n' - + self.content += "/////////////////////////////////////////////////////////////////////////////\n" self.content += "//\n" self.content += "// HSA API tracing primitives\n" @@ -324,7 +324,7 @@ class API_DescrParser: self.content += '\n' self.content += '#if PROF_API_IMPL\n' - self.content += '#include \"callback_table.h\"\n'; + self.content += '#include \"util/callback_table.h\"\n'; self.content += 'namespace roctracer {\n' self.content += 'namespace hsa_support {\n' self.add_section('API callback functions', '', self.gen_callbacks) @@ -368,7 +368,7 @@ class API_DescrParser: self.content += ' HSA_API_ID_DISPATCH = ' + str(n) + ',\n' self.content += ' HSA_API_ID_NUMBER = ' + str(n + 1) + ',\n' self.content += '};\n' - + # generate API args structure def gen_arg_struct(self, n, name, call, struct): if n == -1: @@ -395,7 +395,7 @@ class API_DescrParser: # generate API callbacks def gen_callbacks(self, n, name, call, struct): if n == -1: - self.content += 'typedef CallbackTable cb_table_t;\n' + self.content += 'typedef util::CallbackTable cb_table_t;\n' self.content += 'extern cb_table_t cb_table;\n' self.content += '\n' if call != '-': diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 26f6c26888..3acae686da 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -159,7 +159,7 @@ set_target_properties(roctx PROPERTIES target_include_directories(roctx PUBLIC $ - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/roctracer ${CMAKE_CURRENT_SOURCE_DIR}) + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_options(roctx PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/roctx/exportmap -Wl,--no-undefined) diff --git a/src/roctx/roctx.cpp b/src/roctx/roctx.cpp index bb27b5850a..70c7c237c7 100644 --- a/src/roctx/roctx.cpp +++ b/src/roctx/roctx.cpp @@ -22,11 +22,11 @@ #include "roctracer_roctx.h" #include "ext/prof_protocol.h" -#include "callback_table.h" +#include "util/callback_table.h" namespace { -roctracer::CallbackTable callbacks; +roctracer::util::CallbackTable callbacks; thread_local int nested_range_level(0); } // namespace diff --git a/src/roctracer/callback_table.h b/src/util/callback_table.h similarity index 94% rename from src/roctracer/callback_table.h rename to src/util/callback_table.h index dc6793c282..5165ef549f 100644 --- a/src/roctracer/callback_table.h +++ b/src/util/callback_table.h @@ -18,8 +18,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef CALLBACK_TABLE_H_ -#define CALLBACK_TABLE_H_ +#ifndef UTIL_CALLBACK_TABLE_H_ +#define UTIL_CALLBACK_TABLE_H_ #include "ext/prof_protocol.h" @@ -29,7 +29,7 @@ #include #include -namespace roctracer { +namespace roctracer::util { // Generic callbacks table template class CallbackTable { @@ -65,6 +65,6 @@ template class CallbackTable { mutable std::mutex mutex_; }; -} // namespace roctracer +} // namespace roctracer::util -#endif // CALLBACK_TABLE_H_ +#endif // UTIL_CALLBACK_TABLE_H_