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 auto adjustment #2518

Merged
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
7 changes: 5 additions & 2 deletions xmrstak/backend/amd/autoAdjust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,11 @@ class autoAdjust
size_t possibleIntensity = std::min(maxThreads, maxIntensity);
// map intensity to a multiple of the compute unit count, default_workSize is the number of threads per work group
size_t intensity = (possibleIntensity / (default_workSize * ctx.computeUnits)) * ctx.computeUnits * default_workSize;
// in the case we use two threads per gpu we can be relax and need no multiple of the number of compute units
if(numThreads == 2)

size_t computeUnitUtilization = ((possibleIntensity * 100) / (default_workSize * ctx.computeUnits)) % 100;
// in the case we use two threads per gpu or if we can utilize over 75% of the compute units
// we can be relax and need no multiple of the number of compute units
if(numThreads == 2 || computeUnitUtilization >= 75)
intensity = (possibleIntensity / default_workSize) * default_workSize;

//If the intensity is 0, then it's because the multiple of the unit count is greater than intensity
Expand Down