Stop all client contexts prior to finalization (#721)

* Stop all client contexts prior to finalization

* Update lib/common/container/static_vector.hpp

- improve emplace_back for non-{move,copy}-assignable object

* Update samples/intercept_table/client.cpp

- improve robustness against static object destruction

* Update lib/rocprofiler-sdk/context/context.cpp

- change storage of registered context array
  - stable_vector of optional contexts
  - common::static_object wrapper around stable_vector

* Update samples/intercept_table/client.cpp

- use variable template for underlying function pointer
Этот коммит содержится в:
Jonathan R. Madsen authored and GitHub committed 2024-04-02 03:05:11 -05:00
1 родитель e3c7eed7c0
Коммит 939e23e9d1
9 files changed
+115 -63

No files matched your search

+8 -5
Просмотреть файл
@@ -218,8 +218,10 @@ TEST(rocprofiler_lib, intercept_table_and_callback_tracing)
static fini_func_t tool_fini = [](void* client_data) -> void {
auto* cb_data = static_cast<callback_data_ext*>(client_data);
ROCPROFILER_CALL(rocprofiler_stop_context(cb_data->client_hsa_ctx),
"rocprofiler context stop failed");
int status = 0;
ROCPROFILER_CALL(rocprofiler_context_is_active(cb_data->client_hsa_ctx, &status),
"rocprofiler_context_is_active failed");
EXPECT_EQ(status, 0);
static_cast<callback_data_ext*>(client_data)->client_workflow_count++;
};
@@ -375,9 +377,10 @@ TEST(rocprofiler_lib, intercept_table_and_callback_tracing_disable_context)
static fini_func_t tool_fini = [](void* client_data) -> void {
auto* cb_data = static_cast<callback_data_ext*>(client_data);
ROCPROFILER_CALL_EXPECT(rocprofiler_stop_context(cb_data->client_hsa_ctx),
"rocprofiler context stop",
ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND);
int status = 0;
ROCPROFILER_CALL(rocprofiler_context_is_active(cb_data->client_hsa_ctx, &status),
"rocprofiler_context_is_active failed");
EXPECT_EQ(status, 0);
ROCPROFILER_CALL_EXPECT(rocprofiler_start_context(cb_data->client_hsa_ctx),
"rocprofiler context start",