summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/amd
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-10-11 16:35:07 +0100
committerGitHub <noreply@github.com>2017-10-11 16:35:07 +0100
commit0c332962d970aec73f07747c0134695e42d5518b (patch)
tree08e2c9a8ae9ffe9ca7144c8f81a24ac7b6961d77 /xmrstak/backend/amd
parent984ddf9ebbb9e0e06917253964238f0d743cb815 (diff)
parente0b93c221698620bf4f14572f255317bceea7008 (diff)
downloadxmr-stak-0c332962d970aec73f07747c0134695e42d5518b.zip
xmr-stak-0c332962d970aec73f07747c0134695e42d5518b.tar.gz
Merge pull request #27 from psychocrypt/topic-improveAmdAutoAdjust
improve AMD auto suggestion
Diffstat (limited to 'xmrstak/backend/amd')
-rw-r--r--xmrstak/backend/amd/autoAdjust.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmrstak/backend/amd/autoAdjust.hpp b/xmrstak/backend/amd/autoAdjust.hpp
index 6157b25..ebe59df 100644
--- a/xmrstak/backend/amd/autoAdjust.hpp
+++ b/xmrstak/backend/amd/autoAdjust.hpp
@@ -79,6 +79,8 @@ private:
configEditor configTpl{};
configTpl.set( std::string(tpl) );
+ constexpr size_t byteToMiB = 1024u * 1024u;
+
std::string conf;
int i = 0;
for(auto& ctx : devVec)
@@ -89,8 +91,11 @@ private:
size_t perThread = (size_t(1u)<<21) + 224u;
size_t max_intensity = availableMem / perThread;
// 1000 is a magic selected limit \todo select max intensity depending of the gpu type
- size_t intensity = std::min( size_t(1000u) , max_intensity );
- conf += std::string(" // gpu: ") + ctx.name + "\n";
+ size_t possibleIntensity = std::min( size_t(1000u) , max_intensity );
+ // map intensity to a multiple of the compute unit count, 8 is the number of threads per work group
+ size_t intensity = (possibleIntensity / (8 * ctx.computeUnits)) * ctx.computeUnits * 8;
+ conf += std::string(" // gpu: ") + ctx.name + " memory:" + std::to_string(availableMem / byteToMiB) + "\n";
+ conf += std::string(" // compute units: ") + std::to_string(ctx.computeUnits) + "\n";
// set 8 threads per block (this is a good value for the most gpus)
conf += std::string(" { \"index\" : ") + std::to_string(ctx.deviceIdx) + ",\n" +
" \"intensity\" : " + std::to_string(intensity) + ", \"worksize\" : " + std::to_string(8) + ",\n" +
OpenPOWER on IntegriCloud