summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/amd/jconf.cpp
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2018-02-12 20:39:49 +0100
committerpsychocrypt <psychocryptHPC@gmail.com>2018-02-19 22:13:49 +0100
commitcff6b6cbfbb3da44d85753885466de5122e20472 (patch)
treef08c352ae4261825dca47635c88b8e4a08d67bb7 /xmrstak/backend/amd/jconf.cpp
parentf785481bb7c1fb887a65a0b19c3e453904bb5474 (diff)
downloadxmr-stak-cff6b6cbfbb3da44d85753885466de5122e20472.zip
xmr-stak-cff6b6cbfbb3da44d85753885466de5122e20472.tar.gz
add OpenCL compatibility mode
- add new option `comp_mode` to the amd config - disable `if guards` within opencl kernel if `comp_mode : false`
Diffstat (limited to 'xmrstak/backend/amd/jconf.cpp')
-rw-r--r--xmrstak/backend/amd/jconf.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmrstak/backend/amd/jconf.cpp b/xmrstak/backend/amd/jconf.cpp
index 22381e1..93ba709 100644
--- a/xmrstak/backend/amd/jconf.cpp
+++ b/xmrstak/backend/amd/jconf.cpp
@@ -106,15 +106,17 @@ bool jconf::GetThreadConfig(size_t id, thd_cfg &cfg)
if(!oThdConf.IsObject())
return false;
- const Value *idx, *intensity, *w_size, *aff, *stridedIndex, *memChunk;
+ const Value *idx, *intensity, *w_size, *aff, *stridedIndex, *memChunk, *compMode;
idx = GetObjectMember(oThdConf, "index");
intensity = GetObjectMember(oThdConf, "intensity");
w_size = GetObjectMember(oThdConf, "worksize");
aff = GetObjectMember(oThdConf, "affine_to_cpu");
stridedIndex = GetObjectMember(oThdConf, "strided_index");
memChunk = GetObjectMember(oThdConf, "mem_chunk");
+ compMode = GetObjectMember(oThdConf, "comp_mode");
- if(idx == nullptr || intensity == nullptr || w_size == nullptr || aff == nullptr || stridedIndex == nullptr || memChunk == nullptr)
+ if(idx == nullptr || intensity == nullptr || w_size == nullptr || aff == nullptr || memChunk == nullptr ||
+ stridedIndex == nullptr || compMode == nullptr)
return false;
if(!idx->IsUint64() || !intensity->IsUint64() || !w_size->IsUint64())
@@ -148,9 +150,13 @@ bool jconf::GetThreadConfig(size_t id, thd_cfg &cfg)
return false;
}
+ if(!compMode->IsBool())
+ return false;
+
cfg.index = idx->GetUint64();
cfg.w_size = w_size->GetUint64();
cfg.intensity = intensity->GetUint64();
+ cfg.compMode = compMode->GetBool();
if(aff->IsNumber())
cfg.cpu_aff = aff->GetInt64();
OpenPOWER on IntegriCloud