Check to force tools to initialize the ctx id to zero. (#1135)

* Check to force tool to initialize the ctx id to zero.

* initialize rocprofiler_context_id_t with 0 in units tests

* changelog

---------

Co-authored-by: Gopesh Bhardwaj <gopesh.bhardwaj@amd.com>
This commit is contained in:
venkat1361
2024-10-22 07:39:25 -05:00
committed by GitHub
parent a92fa8f071
commit 3f91d90bbc
36 changed files with 66 additions and 61 deletions
+1
View File
@@ -41,6 +41,7 @@ extern "C" {
rocprofiler_status_t
rocprofiler_create_context(rocprofiler_context_id_t* context_id)
{
if(context_id->handle != 0) return ROCPROFILER_STATUS_ERROR_CONTEXT_ID_NOT_ZERO;
// context already registered
if(rocprofiler::context::get_registered_context(*context_id))
return ROCPROFILER_STATUS_ERROR_CONTEXT_INVALID;