Skip to content
Snippets Groups Projects
Commit 746037d8 authored by psychocrypt's avatar psychocrypt
Browse files

OpenCL: fix definition range for unroll

fix #1870

- remove zero from the valod definition range for the loop unroll option
parent b0ccccf3
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ R"===(// generated by XMRSTAK_VERSION
* mem_chunk - range 0 to 18: set the number of elements (16byte) per chunk
* this value is only used if 'strided_index' == 2
* element count is computed with the equation: 2 to the power of 'mem_chunk' e.g. 4 means a chunk of 16 elements(256byte)
* unroll - allow to control how often the POW main loop is unrolled; valid range [0;128) - for most OpenCL implementations it must be a power of two.
* unroll - allow to control how often the POW main loop is unrolled; valid range [1;128) - for most OpenCL implementations it must be a power of two.
* comp_mode - Compatibility enable/disable the automatic guard around compute kernel which allows
* to use a intensity which is not the multiple of the worksize.
* If you set false and the intensity is not multiple of the worksize the miner can crash:
......
......@@ -151,9 +151,9 @@ bool jconf::GetThreadConfig(size_t id, thd_cfg &cfg)
cfg.memChunk = (int)memChunk->GetInt64();
if(!unroll->IsUint64() || (int)unroll->GetInt64() >= 128)
if(!unroll->IsUint64() || (int)unroll->GetInt64() >= 128 || (int)unroll->GetInt64() == 0)
{
printer::inst()->print_msg(L0, "ERROR: unroll must be smaller than 128 and a power of two");
printer::inst()->print_msg(L0, "ERROR: unroll must be smaller than 128 and not zero");
return false;
}
cfg.unroll = (int)unroll->GetInt64();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment