Src/GPUPerfAPIHSA/GPUPerfAPIHSA.cpp
// Note: this must be called before hsa_init in order for SoftCP mode to be used
this must be called before hsa_init in order for SoftCP mode to be used
this must be called before hsa_init in order for SoftCP mode to be used
GPA_Status GPA_IMP_Initialize()
{
    HSAGlobalFlags::Instance()->m_wasInitializeCalled = true;
    if (!HSAGlobalFlags::Instance()->m_softCPModeEnabled)
    {
        std::string strErrorMessage;
        if (!SetHSASoftCPEnvVar(strErrorMessage))
        {
            GPA_LogError(strErrorMessage.c_str());
            return GPA_STATUS_ERROR_FAILED;
        }
        HSAGlobalFlags::Instance()->m_softCPModeEnabled = true;
    }
    if (!HSAGlobalFlags::Instance()->m_isToolsLibSet)
    {
        if (!SetHSAToolsLibEnvVar())
        {
            return GPA_STATUS_ERROR_FAILED;
        }
        HSAGlobalFlags::Instance()->m_isToolsLibSet = true;
    }
    return GPA_STATUS_OK;
}
GPA_Status GPA_IMP_Initialize ( ) { HSAGlobalFlags :: Instance ( ) -> m_wasInitializeCalled = true ; if ( ! HSAGlobalFlags :: Instance ( ) -> m_softCPModeEnabled ) { std :: string strErrorMessage ; if ( ! SetHSASoftCPEnvVar ( strErrorMessage ) ) { GPA_LogError ( strErrorMessage . c_str ( ) ) ; return GPA_STATUS_ERROR_FAILED ; } HSAGlobalFlags :: Instance ( ) -> m_softCPModeEnabled = true ; } if ( ! HSAGlobalFlags :: Instance ( ) -> m_isToolsLibSet ) { if ( ! SetHSAToolsLibEnvVar ( ) ) { return GPA_STATUS_ERROR_FAILED ; } HSAGlobalFlags :: Instance ( ) -> m_isToolsLibSet = true ; } return GPA_STATUS_OK ; }
Note: this must be called before hsa_init in order for SoftCP mode to be used
Note : this must be called before hsa_init in order for SoftCP mode to be used