Skip to content

Commit 8f47975

Browse files
committed
Add CPU/GPU information to Qt
1 parent 4f684d9 commit 8f47975

File tree

4 files changed

+184
-70
lines changed

4 files changed

+184
-70
lines changed

src/qt/clientmodel.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,43 @@ BanTableModel* ClientModel::getBanTableModel()
245245
return banTableModel;
246246
}
247247

248+
QString ClientModel::CPUAVXMode() const
249+
{
250+
#if defined(__AVX512F__)
251+
return QString("AVX512");
252+
#elif defined(__AVX2__)
253+
return QString("AVX2");
254+
#elif !defined(__AVX2__) && !defined(__AVX512F__)
255+
return QString("Normal");
256+
#else
257+
return QString("Normal");
258+
#endif
259+
}
260+
261+
QString ClientModel::GPUMode() const
262+
{
263+
#if defined(HAVE_CUDA)
264+
return QString("CUDA");
265+
#elif !defined(HAVE_CUDA) && defined(ENABLE_GPU)
266+
return QString("OpenCL");
267+
#elif !defined(HAVE_CUDA) && !defined(ENABLE_GPU)
268+
return QString("N/A");
269+
#else
270+
return QString("N/A");
271+
#endif
272+
}
273+
274+
QString ClientModel::GPUState() const
275+
{
276+
#if defined(ENABLE_GPU)
277+
return QString("Enabled");
278+
#elif !defined(ENABLE_GPU)
279+
return QString("Disabled");
280+
#else
281+
return QString("Disabled");
282+
#endif
283+
}
284+
248285
QString ClientModel::formatFullVersion() const
249286
{
250287
return QString::fromStdString(FormatFullVersion());

src/qt/clientmodel.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ class ClientModel : public QObject
7777
//! Return warnings to be displayed in status bar
7878
QString getStatusBarWarnings() const;
7979

80+
//! Return CPU and GPU states
81+
QString CPUAVXMode() const;
82+
QString GPUMode() const;
83+
QString GPUState() const;
84+
8085
QString formatFullVersion() const;
8186
QString formatSubVersion() const;
8287
bool isReleaseVersion() const;

0 commit comments

Comments
 (0)