Files
compute-runtime/runtime/command_stream/command_stream_receiver_with_aub_dump.inl
Mrozek, Michal 883a830636 Fix --tbx mode.
- There was a problem in make non resident function when AUB CSR was not
present in CSR with AUB dump , surfaces were not made not resident
properly
- For subsequent submissions they were not discovered as resources requiring
residency and were not made resident
- update task count can only be called when aub csr is actually present.

Change-Id: I12a4c1c14a8a7ecf63a0b0f8d633d35c4bf15b05
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
2019-03-27 15:44:22 +01:00

64 lines
2.4 KiB
C++

/*
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/aub/aub_center.h"
#include "runtime/command_stream/aub_command_stream_receiver.h"
#include "runtime/command_stream/command_stream_receiver_with_aub_dump.h"
#include "runtime/execution_environment/execution_environment.h"
namespace NEO {
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
template <typename BaseCSR>
CommandStreamReceiverWithAUBDump<BaseCSR>::CommandStreamReceiverWithAUBDump(const std::string &baseName, ExecutionEnvironment &executionEnvironment)
: BaseCSR(executionEnvironment) {
bool isAubManager = executionEnvironment.aubCenter && executionEnvironment.aubCenter->getAubManager();
bool isTbxMode = CommandStreamReceiverType::CSR_TBX == BaseCSR::getType();
bool createAubCsr = (isAubManager && isTbxMode) ? false : true;
if (createAubCsr) {
aubCSR.reset(AUBCommandStreamReceiver::create(baseName, false, executionEnvironment));
}
}
template <typename BaseCSR>
FlushStamp CommandStreamReceiverWithAUBDump<BaseCSR>::flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) {
if (aubCSR) {
aubCSR->flush(batchBuffer, allocationsForResidency);
aubCSR->setLatestSentTaskCount(BaseCSR::peekLatestSentTaskCount());
}
FlushStamp flushStamp = BaseCSR::flush(batchBuffer, allocationsForResidency);
return flushStamp;
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::makeNonResident(GraphicsAllocation &gfxAllocation) {
auto residencyTaskCount = gfxAllocation.getResidencyTaskCount(this->osContext->getContextId());
BaseCSR::makeNonResident(gfxAllocation);
if (aubCSR) {
gfxAllocation.updateResidencyTaskCount(residencyTaskCount, this->osContext->getContextId());
aubCSR->makeNonResident(gfxAllocation);
}
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::activateAubSubCapture(const MultiDispatchInfo &dispatchInfo) {
BaseCSR::activateAubSubCapture(dispatchInfo);
if (aubCSR) {
aubCSR->activateAubSubCapture(dispatchInfo);
}
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::setupContext(OsContext &osContext) {
BaseCSR::setupContext(osContext);
if (aubCSR) {
aubCSR->setupContext(osContext);
}
}
} // namespace NEO