Register Blit CSR to CommandQueue

Change-Id: Ib22ef934492b702990ca549bab576993b0684e98
Related-To: NEO-3020
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-07-16 09:23:02 +02:00
committed by sys_ocldev
parent e4e5b5ccdf
commit 23e9e9e02e
13 changed files with 77 additions and 47 deletions

View File

@ -148,41 +148,50 @@ bool Device::createDeviceImpl() {
}
bool Device::createEngines() {
auto &hwInfo = getHardwareInfo();
auto defaultEngineType = getChosenEngineType(hwInfo);
auto &gpgpuEngines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances();
for (uint32_t deviceCsrIndex = 0; deviceCsrIndex < gpgpuEngines.size(); deviceCsrIndex++) {
if (!executionEnvironment->initializeCommandStreamReceiver(getDeviceIndex(), deviceCsrIndex)) {
if (!createEngine(getDeviceIndex(), deviceCsrIndex, gpgpuEngines[deviceCsrIndex])) {
return false;
}
auto commandStreamReceiver = executionEnvironment->commandStreamReceivers[getDeviceIndex()][deviceCsrIndex].get();
DeviceBitfield deviceBitfield;
deviceBitfield.set(getDeviceIndex());
bool lowPriority = deviceCsrIndex == HwHelper::lowPriorityGpgpuEngineIndex;
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(commandStreamReceiver, gpgpuEngines[deviceCsrIndex],
deviceBitfield, preemptionMode, lowPriority);
commandStreamReceiver->setupContext(*osContext);
if (!commandStreamReceiver->initializeTagAllocation()) {
return false;
}
if (gpgpuEngines[deviceCsrIndex] == defaultEngineType && !lowPriority) {
defaultEngineIndex = deviceCsrIndex;
}
if ((preemptionMode == PreemptionMode::MidThread || isSourceLevelDebuggerActive()) && !commandStreamReceiver->createPreemptionAllocation()) {
return false;
}
engines.push_back({commandStreamReceiver, osContext});
}
return true;
}
bool Device::createEngine(uint32_t deviceIndex, uint32_t deviceCsrIndex, aub_stream::EngineType engineType) {
auto &hwInfo = getHardwareInfo();
auto defaultEngineType = getChosenEngineType(hwInfo);
if (!executionEnvironment->initializeCommandStreamReceiver(deviceIndex, deviceCsrIndex)) {
return false;
}
auto commandStreamReceiver = executionEnvironment->commandStreamReceivers[deviceIndex][deviceCsrIndex].get();
DeviceBitfield deviceBitfield;
deviceBitfield.set(deviceIndex);
bool lowPriority = (deviceCsrIndex == HwHelper::lowPriorityGpgpuEngineIndex);
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(commandStreamReceiver, engineType,
deviceBitfield, preemptionMode, lowPriority);
commandStreamReceiver->setupContext(*osContext);
if (!commandStreamReceiver->initializeTagAllocation()) {
return false;
}
if (engineType == defaultEngineType && !lowPriority) {
defaultEngineIndex = deviceCsrIndex;
}
if ((preemptionMode == PreemptionMode::MidThread || isSourceLevelDebuggerActive()) && !commandStreamReceiver->createPreemptionAllocation()) {
return false;
}
engines.push_back({commandStreamReceiver, osContext});
return true;
}
const HardwareInfo &Device::getHardwareInfo() const { return *executionEnvironment->getHardwareInfo(); }
const WorkaroundTable *Device::getWaTable() const { return &getHardwareInfo().workaroundTable; }

View File

@ -132,6 +132,7 @@ class Device : public BaseObject<_cl_device_id> {
bool createDeviceImpl();
bool createEngines();
bool createEngine(uint32_t deviceIndex, uint32_t deviceCsrIndex, aub_stream::EngineType engineType);
MOCKABLE_VIRTUAL void initializeCaps();
void setupFp64Flags();