Don't generate CUDA config on fly.

This commit is contained in:
XMRig 2019-10-28 01:47:55 +07:00
parent 7889634b40
commit 99fe304c1f

View file

@ -35,6 +35,7 @@
namespace xmrig {
static bool generated = false;
static const char *kDevicesHint = "devices-hint";
static const char *kEnabled = "enabled";
static const char *kLoader = "loader";
@ -113,6 +114,10 @@ void xmrig::CudaConfig::read(const rapidjson::Value &value)
void xmrig::CudaConfig::generate()
{
if (generated) {
return;
}
if (!isEnabled() || m_threads.has("*")) {
return;
}
@ -138,6 +143,7 @@ void xmrig::CudaConfig::generate()
count += xmrig::generate<Algorithm::CN_PICO>(m_threads, devices);
count += xmrig::generate<Algorithm::RANDOM_X>(m_threads, devices);
generated = true;
m_shouldSave = count > 0;
}