Files
compute-runtime/runtime/command_stream/command_stream_receiver_with_aub_dump.inl
Milczarek, Slawomir 2227386eb7 CSR with AUB dump to call makeNonResident on AUB CSR
AUB CSR can implement additional actions to be taken on makeNonResident
such as dumping buffer and image resources.

Change-Id: Iab76081116011e0882de3c902db74a5dc4dd0b36
2018-09-29 00:23:40 +02:00

71 lines
2.6 KiB
C++

/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/command_stream/command_stream_receiver_with_aub_dump.h"
#include "runtime/command_stream/aub_command_stream_receiver.h"
namespace OCLRT {
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
template <typename BaseCSR>
CommandStreamReceiverWithAUBDump<BaseCSR>::CommandStreamReceiverWithAUBDump(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment)
: BaseCSR(hwInfoIn, executionEnvironment) {
aubCSR = AUBCommandStreamReceiver::create(hwInfoIn, "aubfile", false, executionEnvironment);
}
template <typename BaseCSR>
CommandStreamReceiverWithAUBDump<BaseCSR>::~CommandStreamReceiverWithAUBDump() {
delete aubCSR;
}
template <typename BaseCSR>
FlushStamp CommandStreamReceiverWithAUBDump<BaseCSR>::flush(BatchBuffer &batchBuffer, EngineType engineOrdinal, ResidencyContainer &allocationsForResidency, OsContext &osContext) {
FlushStamp flushStamp = BaseCSR::flush(batchBuffer, engineOrdinal, allocationsForResidency, osContext);
if (aubCSR) {
aubCSR->flush(batchBuffer, engineOrdinal, allocationsForResidency, osContext);
}
return flushStamp;
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::processResidency(ResidencyContainer &allocationsForResidency, OsContext &osContext) {
BaseCSR::processResidency(allocationsForResidency, osContext);
if (aubCSR) {
aubCSR->processResidency(allocationsForResidency, osContext);
}
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::makeNonResident(GraphicsAllocation &gfxAllocation) {
int residencyTaskCount = gfxAllocation.residencyTaskCount[this->deviceIndex];
BaseCSR::makeNonResident(gfxAllocation);
gfxAllocation.residencyTaskCount[this->deviceIndex] = residencyTaskCount;
if (aubCSR) {
aubCSR->makeNonResident(gfxAllocation);
}
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::activateAubSubCapture(const MultiDispatchInfo &dispatchInfo) {
BaseCSR::activateAubSubCapture(dispatchInfo);
if (aubCSR) {
aubCSR->activateAubSubCapture(dispatchInfo);
}
}
template <typename BaseCSR>
MemoryManager *CommandStreamReceiverWithAUBDump<BaseCSR>::createMemoryManager(bool enable64kbPages, bool enableLocalMemory) {
auto memoryManager = BaseCSR::createMemoryManager(enable64kbPages, enableLocalMemory);
if (aubCSR) {
aubCSR->setMemoryManager(memoryManager);
}
return memoryManager;
}
} // namespace OCLRT