Skip to content

Commit

Permalink
AMD: optimize unroll for rx5700
Browse files Browse the repository at this point in the history
solve fireice-uk#2509

- use unroll 8 for RX5700
- use 2 threads for cnr_gpu and RX5700
  • Loading branch information
psychocrypt committed Sep 22, 2019
1 parent bb189ad commit f626f07
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 @@ -181,22 +181,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 f626f07

Please sign in to comment.