Skip to content

Commit

Permalink
Merge pull request #70 from janisozaur/missing-headers
Browse files Browse the repository at this point in the history
Add missing headers
  • Loading branch information
bjelich committed Sep 9, 2020
2 parents e04f97d + bdc93d9 commit 6874d57
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
65 changes: 33 additions & 32 deletions RadeonGPUAnalyzerGUI/Src/rgIsaDisassemblyView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <algorithm>

// Qt.
#include <QAction>
#include <QCheckBox>
#include <QListWidgetItem>

Expand Down Expand Up @@ -700,39 +701,39 @@ void rgIsaDisassemblyView::PopulateTargetGpuList(const rgBuildOutputsMap& buildO
assert(!targets.empty());

// Sort and choose the latest target.
std::sort(targets.begin(),
std::sort(targets.begin(),
targets.end(), [&](const std::string& a, const std::string& b)
{
const char* GFX_NOTATION_TOKEN = "gfx";
bool ret = true;
size_t szA = a.find(GFX_NOTATION_TOKEN);
size_t szB = b.find(GFX_NOTATION_TOKEN);
if (szA == std::string::npos && szB == std::string::npos)
{
// Neither name is in gfx-notation, compare using standard string logic.
ret = a.compare(b) < 0;
}
else if (!(szA != std::string::npos && szB != std::string::npos))
{
// Only one name has the gfx notation, assume that it is a newer generation.
ret = (szB != std::string::npos);
}
else
{
// Both names are in gfx notation, compare according to the number.
std::vector<std::string> splitA;
std::vector<std::string> splitB;
rgUtils::splitString(a, 'x', splitA);
rgUtils::splitString(b, 'x', splitB);
assert(splitA.size() > 1);
assert(splitB.size() > 1);
if (splitA.size() > 1 && splitB.size() > 1)
{
int numA = std::stoi(splitA[1], nullptr);
int numB = std::stoi(splitB[1], nullptr);
ret = ((numB - numA) > 0);
}
}
const char* GFX_NOTATION_TOKEN = "gfx";
bool ret = true;
size_t szA = a.find(GFX_NOTATION_TOKEN);
size_t szB = b.find(GFX_NOTATION_TOKEN);
if (szA == std::string::npos && szB == std::string::npos)
{
// Neither name is in gfx-notation, compare using standard string logic.
ret = a.compare(b) < 0;
}
else if (!(szA != std::string::npos && szB != std::string::npos))
{
// Only one name has the gfx notation, assume that it is a newer generation.
ret = (szB != std::string::npos);
}
else
{
// Both names are in gfx notation, compare according to the number.
std::vector<std::string> splitA;
std::vector<std::string> splitB;
rgUtils::splitString(a, 'x', splitA);
rgUtils::splitString(b, 'x', splitB);
assert(splitA.size() > 1);
assert(splitB.size() > 1);
if (splitA.size() > 1 && splitB.size() > 1)
{
int numA = std::stoi(splitA[1], nullptr);
int numB = std::stoi(splitB[1], nullptr);
ret = ((numB - numA) > 0);
}
}
return !ret;
});

Expand Down Expand Up @@ -1239,4 +1240,4 @@ void rgIsaDisassemblyView::HandleSelectNextGPUTargetAction()
currentRow = 0;
}
m_pTargetGpusListWidget->setCurrentRow(currentRow);
}
}
1 change: 1 addition & 0 deletions RadeonGPUAnalyzerGUI/Src/rgModePushButton.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Qt.
#include <QPainter>
#include <QPainterPath>
#include <QPoint>
#include <QStyle>
#include <QWidget>
Expand Down
3 changes: 2 additions & 1 deletion RadeonGPUAnalyzerGUI/Src/rgSettingsButtonsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// Qt.
#include <QApplication>
#include <QAction>
#include <QCheckBox>
#include <QFileDialog>
#include <QMessageBox>
Expand Down Expand Up @@ -112,4 +113,4 @@ void rgSettingsButtonsView::HideRestoreDefaultSettingsButton(bool isHidden)
void rgSettingsButtonsView::mousePressEvent(QMouseEvent *pEvent)
{
emit SettingsButtonsViewClickedSignal();
}
}

0 comments on commit 6874d57

Please sign in to comment.