P4 to Git Change 1192638 by xcui@merged_opencl_jxcwin on 2015/09/21 14:34:25

SWDEV-17662 - EPR #426715 - for CZ enabled PX system, we need discrete GPU be the first device to do SVM allocation, and the fine grain system capable device do the allocation after discrete GPU.

	precheckin:
	http://ocltc.amd.com:8111/viewModification.html?modId=58725&personal=true&buildTypeId=&tab=vcsModificationBuilds&show_all_builds=true

	code review:
	http://ocltc.amd.com/reviews/r/8513/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#255 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.cpp#36 edit


[ROCm/clr commit: ff9a6c0c58]
Этот коммит содержится в:
foreman
2015-09-21 14:46:15 -04:00
родитель c3fca75c4c
Коммит 98131ac83e
2 изменённых файлов: 21 добавлений и 4 удалений
+16 -4
Просмотреть файл
@@ -40,10 +40,22 @@ Context::Context(
svmAllocDevice_.push_back(device);
}
}
//make sure the first device is GPU
if ((svmAllocDevice_.size() > 1)
&& (svmAllocDevice_.front()->type() == CL_DEVICE_TYPE_CPU)) {
std::swap(svmAllocDevice_.front(), svmAllocDevice_.back());
if (svmAllocDevice_.size() > 1) {
//make sure the CPU is the last device to do allocation.
if ((svmAllocDevice_.front()->type() == CL_DEVICE_TYPE_CPU)) {
std::swap(svmAllocDevice_.front(), svmAllocDevice_.back());
}
uint isFirstDeviceFGSEnabled = svmAllocDevice_.front()->isFineGrainedSystem();
for (auto& dev : svmAllocDevice_) {
//allocation on fine - grained system incapable device first
if (isFirstDeviceFGSEnabled && (dev->type() == CL_DEVICE_TYPE_GPU)
&& (!(dev->isFineGrainedSystem()))) {
std::swap(svmAllocDevice_.front(), dev);
break;
}
}
}
}