P4 to Git Change 1535437 by asalmanp@asalmanp-ocl-stg on 2018/04/02 10:42:28

SWDEV-79278 - [OCL][PAL] don’t report gfx902/gfx903 into the offline device list twice.
	Both Raven and Raven2 are exposed as gfx902/gfx903, so we ended up reporting each gfx902 and gfx903 twice for the offline devices list. To avoid this issue, check the list and if a device is already reported don’t add it into the list.

	http://ocltc.amd.com/reviews/r/14523/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#78 edit
Tá an tiomantas seo le fáil i:
foreman
2018-04-02 11:17:14 -04:00
tuismitheoir de2ddfbee4
tiomantas 3f4e9566b7
+21
Féach ar an gComhad
@@ -109,6 +109,7 @@ bool NullDevice::init() {
for (uint id = 0;
id < sizeof(Gfx9PlusSubDeviceInfo)/sizeof(AMDDeviceInfo); ++id) {
bool foundActive = false;
bool foundDuplicate = false;
uint gfxipVersion = pal::Gfx9PlusSubDeviceInfo[id].gfxipVersion_;
if (pal::Gfx9PlusSubDeviceInfo[id].targetName_[0] == '\0') {
@@ -132,6 +133,26 @@ bool NullDevice::init() {
continue;
}
// Loop through all previous devices in the Gfx9PlusSubDeviceInfo list
// and compare them with the current entry to see if the current entry
// was listed previously in the Gfx9PlusSubDeviceInfo, if so, then it
// means the current entry already has been added in the offline device list
for (uint j = 0; j < id; ++j) {
if (pal::Gfx9PlusSubDeviceInfo[j].targetName_[0] == '\0') {
continue;
}
if (strcmp(pal::Gfx9PlusSubDeviceInfo[j].targetName_,
pal::Gfx9PlusSubDeviceInfo[id].targetName_) == 0) {
foundDuplicate = true;
break;
}
}
// Don't report an offline device twice
if (foundDuplicate) {
continue;
}
Pal::GfxIpLevel ipLevel = Pal::GfxIpLevel::_None;
uint ipLevelMajor = round(pal::Gfx9PlusSubDeviceInfo[id].gfxipVersion_ / 100);
switch (ipLevelMajor) {