Initialization and Finalization

Initialization and Finalization#

AMD Debugger API: Initialization and Finalization
Initialization and Finalization

Operations to control initializing and finalizing the library. More...

Functions

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_initialize (amd_dbgapi_callbacks_t *callbacks) AMD_DBGAPI_VERSION_0_76
 Initialize the library. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_finalize (void) AMD_DBGAPI_VERSION_0_54
 Finalize the library. More...
 

Detailed Description

Operations to control initializing and finalizing the library.

When the library is first loaded it is in the uninitialized state. Before any operation can be used, the library must be initialized. The exception is the status operation in Status Codes and the version operations in Versioning which can be used regardless of whether the library is initialized.

Function Documentation

◆ amd_dbgapi_finalize()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_finalize ( void  )

Finalize the library.

Finalizing the library invalidates all handles previously returned by any operation. It is undefined to use any such handle even if the library is subsequently initialized with amd_dbgapi_initialize. Finalizing the library implicitly detaches from any processes currently attached. It is allowed to initialize and finalize the library multiple times. Finalizing the library does not changed the logging level (see Logging).

Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the library is now uninitialized.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if any of the amd_dbgapi_callbacks_s callbacks used return an error. The library is still left uninitialized, but the client may be in an inconsistent state.

◆ amd_dbgapi_initialize()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_initialize ( amd_dbgapi_callbacks_t callbacks)

Initialize the library.

Initialize the library so that the library functions can be used to control the AMD GPU devices accessed by processes.

Initializing the library does not change the logging level (see Logging).

Parameters
[in]callbacksA set of callbacks must be provided. These are invoked by certain operations. They are described in amd_dbgapi_callbacks_t.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the library is now initialized.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library remains uninitialized.
AMD_DBGAPI_STATUS_ERROR_ALREADY_INITIALIZEDThe library is already initialized. The library is left initialized and the callbacks are not changed.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTcallbacks is NULL or has fields that are NULL. The library remains uninitialized.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if any of the amd_dbgapi_callbacks_s callbacks used return an error. The library remains uninitialized.