Skip to content
This repository was archived by the owner on Apr 30, 2020. It is now read-only.

Commit fda254a

Browse files
committed
Fix issue where multiple HSA Queues are not shown correctly in the timeline. CODEXL-4012
1 parent 57b5472 commit fda254a

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

CodeXL/Components/GpuProfiling/AMDTGpuProfiling/TraceView.cpp

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

CodeXL/Components/GpuProfiling/AMDTGpuProfiling/TraceView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ private slots:
323323
std::vector<HSADataTransferBranchInfo> m_hsaDataTransferBranches; ///< the HSA src and destination branches in the timeline
324324
QMap<unsigned int, acTimelineBranch*> m_oclCtxMap; ///< map from OCL context id to the branch for that context
325325
QMap<unsigned int, OCLQueueBranchInfo*> m_oclQueueMap; ///< map from OCL queue id to the QueueBranchInfo for that queue
326-
QMap<QString, acTimelineBranch*> m_hsaQueueMap; ///< map from HSA queue handle string to the branch for that queue
326+
QMap<unsigned int, acTimelineBranch*> m_hsaQueueMap; ///< map from HSA queue index to the branch for that queue
327327
QMap<osThreadId, int> m_oclThreadOccIndexMap; ///< map from thread id to the current occupancy index for that thread (for OCL)
328328
QMap<osThreadId, int> m_hsaThreadOccIndexMap; ///< map from thread id to the current occupancy index for that thread (for HSA)
329329
QStack<unsigned long long> m_timestampStack; ///< stack of timestamps - used when handling perf markers

0 commit comments

Comments
 (0)