@@ -1653,30 +1653,21 @@ void TraceView::HandleHSAAPIInfo(IHSAAPIInfoDataHandler* phsaApiInfo)
16531653 m_pHSABranch->setText (GPU_STR_TraceViewHSA);
16541654 }
16551655
1656- QString handleStr = QString::fromStdString ( dispatchInfo->GetHSAQueueHandleString () );
1656+ unsigned int hsaQueueIndex = dispatchInfo->GetHSAQueueIndex ( );
16571657
1658- if (m_hsaQueueMap.contains (handleStr ))
1658+ if (m_hsaQueueMap.contains (hsaQueueIndex ))
16591659 {
1660- deviceBranch = m_hsaQueueMap[handleStr ];
1660+ deviceBranch = m_hsaQueueMap[hsaQueueIndex ];
16611661 }
16621662 else
16631663 {
16641664 deviceBranch = new acTimelineBranch ();
16651665 deviceBranch->SetBGColor (QColor::fromRgb (230 , 230 , 230 ));
1666- QString queueBranchText;
1667-
1668- if (handleStr == " <UnknownQueue>" )
1669- {
1670- queueBranchText = deviceNameStr;
1671- }
1672- else
1673- {
1674- unsigned int hsaQueueIndex = dispatchInfo->GetHSAQueueIndex ();
1675- queueBranchText = QString (tr (GPU_STR_HSATraceViewQueueRow)).arg (hsaQueueIndex).arg (handleStr).arg (deviceNameStr);
1676- }
1666+ QString deviceIndexStr = dispatchInfo->GetHSAQueueHandleString (); // "GetHSAQueueHandleString" is a misnomer. This function returns the device index
1667+ QString queueBranchText = QString (tr (GPU_STR_HSATraceViewQueueRow)).arg (hsaQueueIndex).arg (deviceIndexStr).arg (deviceNameStr);
16771668
16781669 deviceBranch->setText (queueBranchText);
1679- m_hsaQueueMap[handleStr ] = deviceBranch;
1670+ m_hsaQueueMap[hsaQueueIndex ] = deviceBranch;
16801671 }
16811672
16821673 unsigned int uiSeqId = pApiInfo->GetApiSequenceId ();
@@ -1981,7 +1972,7 @@ void TraceView::DoneParsingATPFile()
19811972 timelineDataLoaded = true ;
19821973 bool anySubBranchAdded = false ;
19831974
1984- for (QMap<QString , acTimelineBranch*>::const_iterator i = m_hsaQueueMap.begin (); i != m_hsaQueueMap.end (); ++i)
1975+ for (QMap<unsigned int , acTimelineBranch*>::const_iterator i = m_hsaQueueMap.begin (); i != m_hsaQueueMap.end (); ++i)
19851976 {
19861977 m_pHSABranch->addSubBranch (*i);
19871978 anySubBranchAdded = true ;
0 commit comments