start/stop API

[ROCm/roctracer commit: 72b5494f0b]
This commit is contained in:
Evgeny
2019-10-09 01:00:05 -05:00
والد 70c748bdda
کامیت 3f73d90d61
4فایلهای تغییر یافته به همراه229 افزوده شده و 21 حذف شده
@@ -164,9 +164,9 @@ int main() {
free(Matrix);
free(TransposeMatrix);
free(cpuTransposeMatrix);
}
stop_tracing();
}
return errors;
}
@@ -290,23 +290,26 @@ void activity_callback(const char* begin, const char* end, void* arg) {
// Init tracing routine
void init_tracing() {
std::cout << "# START #############################" << std::endl << std::flush;
std::cout << "# INIT #############################" << std::endl << std::flush;
// Allocating tracing pool
roctracer_properties_t properties{};
properties.buffer_size = 0x1000;
properties.buffer_callback_fun = activity_callback;
ROCTRACER_CALL(roctracer_open_pool(&properties));
}
// Start tracing routine
void start_tracing() {
std::cout << "# START #############################" << std::endl << std::flush;
// Enable HIP API callbacks
ROCTRACER_CALL(roctracer_enable_callback(api_callback, NULL));
// Enable HIP activity tracing
ROCTRACER_CALL(roctracer_enable_activity());
}
// Start tracing routine
void start_tracing() {
std::cout << "# START (" << iterations << ") #############################" << std::endl << std::flush;
// Start
if ((iterations & 1) == 1) roctracer_start();
else roctracer_stop();
}
// Stop tracing routine
void stop_tracing() {
ROCTRACER_CALL(roctracer_disable_callback());