Src/GPUPerfAPIGL/ASICInfo.cpp
//=========================================================================================================
/// Get the group ID for the given string
/// \param pGroupStr Pointer to group string name
/// \return -1 if group not found, group ID otherwise
//=========================================================================================================
Get the group ID for the given string
\param pGroupStr Pointer to group string name
\return -1 if group not found, group ID otherwise
Get the group ID for the given string \ param pGroupStr Pointer to group string name \ return - 1 if group not found group ID otherwise
GLint GetGroupID(const char* pGroupStr)
{
    GLint nNumGroups;
    _oglGetPerfMonitorGroupsAMD(&nNumGroups, 0, nullptr);
    if (nNumGroups > 0)
    {
        GLuint* pPerfGroups = new(std::nothrow) GLuint[nNumGroups];
        if (nullptr != pPerfGroups)
        {
            _oglGetPerfMonitorGroupsAMD(nullptr, nNumGroups, pPerfGroups);
            for (int i = 0; i < nNumGroups; i++)
            {
                char groupStr[256];
                _oglGetPerfMonitorGroupStringAMD(pPerfGroups[i], 255, nullptr, groupStr);
                if (!strcmp(groupStr, pGroupStr))
                {
                    GLint nGroupID = pPerfGroups[i];
                    delete[] pPerfGroups;
                    return nGroupID;
                }
            }
            delete[] pPerfGroups;
        }
    }
    return -1;
}
GLint GetGroupID ( const char * pGroupStr ) { GLint nNumGroups ; _oglGetPerfMonitorGroupsAMD ( & nNumGroups , 0 , nullptr ) ; if ( nNumGroups > 0 ) { GLuint * pPerfGroups = new ( std :: nothrow ) GLuint [ nNumGroups ] ; if ( nullptr != pPerfGroups ) { _oglGetPerfMonitorGroupsAMD ( nullptr , nNumGroups , pPerfGroups ) ; for ( int i = 0 ; i < nNumGroups ; i ++ ) { char groupStr [ 256 ] ; _oglGetPerfMonitorGroupStringAMD ( pPerfGroups [ i ] , 255 , nullptr , groupStr ) ; if ( ! strcmp ( groupStr , pGroupStr ) ) { GLint nGroupID = pPerfGroups [ i ] ; delete [ ] pPerfGroups ; return nGroupID ; } } delete [ ] pPerfGroups ; } } return -1 ; }
Get the group ID for the given string
\param pGroupStr Pointer to group string name
\return -1 if group not found, group ID otherwise
Get the group ID for the given string \ param pGroupStr Pointer to group string name \ return - 1 if group not found group ID otherwise
// Get the number of performance counter groups // Get the group Ids // Get the group name