SWDEV-373173 - Correct max VGPRs and VGPR Granularity in Occupancy calculation for different asics

Change-Id: Ib213ed8767a793a832776fba7c0811c2f023a8ad
Этот коммит содержится в:
Anusha GodavarthySurya
2022-12-23 10:37:48 +00:00
коммит произвёл Anusha Godavarthy Surya
родитель 38ad6234f9
Коммит 067c7316ba
+55 -13
Просмотреть файл
@@ -333,20 +333,62 @@ hipError_t ihipOccupancyMaxActiveBlocksPerMultiprocessor(
MaxWavesPerSimd = 16;
}
size_t VgprWaves = MaxWavesPerSimd;
size_t maxVGPRs;
uint32_t VgprGranularity;
if (device.isa().versionMajor() <= 9) {
if (device.isa().versionMajor() == 9 && device.isa().versionMinor() == 0 &&
device.isa().versionStepping() == 10) {
maxVGPRs = 512;
VgprGranularity = 8;
} else {
maxVGPRs = 256;
uint32_t VgprGranularity = 0;
size_t maxVGPRs = 0;
size_t wavefrontSize = wrkGrpInfo->wavefrontSize_;
switch (device.isa().versionMajor()) {
case (11):
if (device.isa().versionMinor() == 0) {
switch (device.isa().versionStepping()) {
case (0):
case (1):
VgprGranularity = (wavefrontSize == 32) ? 24 : 12;
maxVGPRs = (wavefrontSize == 32) ? 1536 : 768;
break;
case (2):
case (3):
VgprGranularity = (wavefrontSize == 32) ? 16 : 8;
maxVGPRs = (wavefrontSize == 32) ? 1024 : 512;
break;
default:
VgprGranularity = 8;
maxVGPRs = 1024;
break;
}
}
break;
case (10):
switch (device.isa().versionMinor()) {
case (0):
case (1):
VgprGranularity = (wavefrontSize == 32) ? 8 : 4;
maxVGPRs = (wavefrontSize == 32) ? 1024 : 512;
break;
case (3):
VgprGranularity = (wavefrontSize == 32) ? 16 : 8;
maxVGPRs = (wavefrontSize == 32) ? 1024 : 512;
break;
default:
VgprGranularity = 8;
maxVGPRs = 1024;
break;
}
break;
case (9):
if ((device.isa().versionMinor() == 0 && device.isa().versionStepping() == 10) ||
(device.isa().versionMinor() == 4 && device.isa().versionStepping() == 0)) {
VgprGranularity = 8;
maxVGPRs = 512;
} else {
VgprGranularity = 4;
maxVGPRs = 256;
}
break;
default:
// For gfx<=8
VgprGranularity = 4;
}
} else {
maxVGPRs = 1024;
VgprGranularity = 8;
maxVGPRs = 256;
break;
}
if (wrkGrpInfo->usedSGPRs_ > 0) {
VgprWaves = maxVGPRs / amd::alignUp(wrkGrpInfo->usedVGPRs_, VgprGranularity);