P4 to Git Change 1457957 by asalmanp@asalmanp-ocl-stg on 2017/09/12 14:27:56

SWDEV-79278 - [OCL] Dont add gfx804 device into the offline device list twice.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/13432/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#573 edit


[ROCm/clr commit: 7efd5f7f98]
Этот коммит содержится в:
foreman
2017-09-12 14:42:44 -04:00
родитель 77dd50cb45
Коммит 39d9b2c81f
+19
Просмотреть файл
@@ -73,6 +73,7 @@ bool NullDevice::init() {
// Loop through all supported devices and create each of them
for (uint id = CAL_TARGET_TAHITI; id <= CAL_TARGET_LAST; ++id) {
bool foundActive = false;
bool foundDuplicate = false;
if (gpu::DeviceInfo[id].targetName_[0] == '\0') {
continue;
@@ -91,6 +92,24 @@ bool NullDevice::init() {
continue;
}
// Loop through all previous devices in the DeviceInfo list and compare them with the
// current entry to see if the current entry was listed previously in the DeviceInfo,
// 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 (gpu::DeviceInfo[j].targetName_[0] == '\0') {
continue;
}
if (strcmp(gpu::DeviceInfo[j].targetName_, gpu::DeviceInfo[id].targetName_) == 0) {
foundDuplicate = true;
break;
}
}
// Don't report an offline device twice
if (foundDuplicate) {
continue;
}
NullDevice* dev = new NullDevice();
if (NULL != dev) {
if (!dev->create(static_cast<CALtarget>(id))) {