Move callback_table.h to the util directory
The CallbackTable utility is shared by multiple APIs, so move it out of the roctracer directory. Change-Id: Ie2378dca8a4f90bd334dbe2d39ced37c9e790ed0
This commit is contained in:
+5
-5
@@ -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<ACTIVITY_DOMAIN_HSA_API, HSA_API_ID_NUMBER> cb_table_t;\n'
|
||||
self.content += 'typedef util::CallbackTable<ACTIVITY_DOMAIN_HSA_API, HSA_API_ID_NUMBER> cb_table_t;\n'
|
||||
self.content += 'extern cb_table_t cb_table;\n'
|
||||
self.content += '\n'
|
||||
if call != '-':
|
||||
|
||||
@@ -159,7 +159,7 @@ set_target_properties(roctx PROPERTIES
|
||||
|
||||
target_include_directories(roctx
|
||||
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/inc>
|
||||
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)
|
||||
|
||||
|
||||
@@ -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<ACTIVITY_DOMAIN_ROCTX, ROCTX_API_ID_NUMBER> callbacks;
|
||||
roctracer::util::CallbackTable<ACTIVITY_DOMAIN_ROCTX, ROCTX_API_ID_NUMBER> callbacks;
|
||||
thread_local int nested_range_level(0);
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -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 <mutex>
|
||||
#include <utility>
|
||||
|
||||
namespace roctracer {
|
||||
namespace roctracer::util {
|
||||
|
||||
// Generic callbacks table
|
||||
template <activity_domain_t Domain, uint32_t N> class CallbackTable {
|
||||
@@ -65,6 +65,6 @@ template <activity_domain_t Domain, uint32_t N> class CallbackTable {
|
||||
mutable std::mutex mutex_;
|
||||
};
|
||||
|
||||
} // namespace roctracer
|
||||
} // namespace roctracer::util
|
||||
|
||||
#endif // CALLBACK_TABLE_H_
|
||||
#endif // UTIL_CALLBACK_TABLE_H_
|
||||
Reference in New Issue
Block a user