Skip to content

Commit

Permalink
Merge pull request #2519 from psychocrypt/topic-optimizeUnrollrx5700
Browse files Browse the repository at this point in the history
AMD: optimize unroll for rx5700
  • Loading branch information
fireice-uk authored Oct 13, 2019
2 parents ab65c97 + f626f07 commit ae15a68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xmrstak/backend/amd/autoAdjust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,26 @@ class autoAdjust
}

uint32_t numUnroll = 8;
uint32_t numThreads = 1u;

if(useCryptonight_gpu)
{
// 6 waves per compute unit are a good value (based on profiling)
// @todo check again after all optimizations
maxThreads = ctx.computeUnits * 6 * 8;
ctx.stridedIndex = 0;
numUnroll = 1;
// do not change unroll for AMD RX5700 but set 2 threads per gpu
if(ctx.name.compare("gfx1010") == 0)
numThreads = 2;
else
numUnroll = 1;
}

// keep 128MiB memory free (value is randomly chosen) from the max available memory
const size_t maxAvailableFreeMem = ctx.freeMem - minFreeMem;

size_t memPerThread = std::min(ctx.maxMemPerAlloc, maxAvailableFreeMem);

uint32_t numThreads = 1u;
if(ctx.isAMD && !useCryptonight_gpu)
{
numThreads = 2;
Expand Down

0 comments on commit ae15a68

Please sign in to comment.