Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMD: optimize unroll for rx5700 #2519

Merged
merged 1 commit into from
Oct 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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