2018-01-19 17:00:51 +08:00
|
|
|
/*
|
2018-09-18 15:11:08 +08:00
|
|
|
* Copyright (C) 2018 Intel Corporation
|
2018-01-19 17:00:51 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-01-19 17:00:51 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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>
|
2018-08-08 19:49:09 +08:00
|
|
|
CommandStreamReceiverWithAUBDump<BaseCSR>::CommandStreamReceiverWithAUBDump(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment)
|
2018-08-30 15:27:47 +08:00
|
|
|
: BaseCSR(hwInfoIn, executionEnvironment) {
|
2018-08-08 19:49:09 +08:00
|
|
|
aubCSR = AUBCommandStreamReceiver::create(hwInfoIn, "aubfile", false, executionEnvironment);
|
2018-01-19 17:00:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <typename BaseCSR>
|
|
|
|
CommandStreamReceiverWithAUBDump<BaseCSR>::~CommandStreamReceiverWithAUBDump() {
|
|
|
|
delete aubCSR;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename BaseCSR>
|
2018-09-25 18:38:00 +08:00
|
|
|
FlushStamp CommandStreamReceiverWithAUBDump<BaseCSR>::flush(BatchBuffer &batchBuffer, EngineType engineOrdinal, ResidencyContainer &allocationsForResidency, OsContext &osContext) {
|
2018-08-27 21:48:29 +08:00
|
|
|
FlushStamp flushStamp = BaseCSR::flush(batchBuffer, engineOrdinal, allocationsForResidency, osContext);
|
2018-01-19 17:00:51 +08:00
|
|
|
if (aubCSR) {
|
2018-08-27 21:48:29 +08:00
|
|
|
aubCSR->flush(batchBuffer, engineOrdinal, allocationsForResidency, osContext);
|
2018-01-19 17:00:51 +08:00
|
|
|
}
|
|
|
|
return flushStamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename BaseCSR>
|
2018-09-14 16:39:21 +08:00
|
|
|
void CommandStreamReceiverWithAUBDump<BaseCSR>::processResidency(ResidencyContainer &allocationsForResidency, OsContext &osContext) {
|
2018-08-27 21:48:29 +08:00
|
|
|
BaseCSR::processResidency(allocationsForResidency, osContext);
|
2018-01-19 17:00:51 +08:00
|
|
|
if (aubCSR) {
|
2018-08-27 21:48:29 +08:00
|
|
|
aubCSR->processResidency(allocationsForResidency, osContext);
|
2018-01-19 17:00:51 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-28 01:55:09 +08:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-13 02:33:03 +08:00
|
|
|
template <typename BaseCSR>
|
|
|
|
void CommandStreamReceiverWithAUBDump<BaseCSR>::activateAubSubCapture(const MultiDispatchInfo &dispatchInfo) {
|
|
|
|
BaseCSR::activateAubSubCapture(dispatchInfo);
|
|
|
|
if (aubCSR) {
|
|
|
|
aubCSR->activateAubSubCapture(dispatchInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-19 17:00:51 +08:00
|
|
|
template <typename BaseCSR>
|
2018-09-06 16:53:35 +08:00
|
|
|
MemoryManager *CommandStreamReceiverWithAUBDump<BaseCSR>::createMemoryManager(bool enable64kbPages, bool enableLocalMemory) {
|
|
|
|
auto memoryManager = BaseCSR::createMemoryManager(enable64kbPages, enableLocalMemory);
|
2018-01-19 17:00:51 +08:00
|
|
|
if (aubCSR) {
|
|
|
|
aubCSR->setMemoryManager(memoryManager);
|
|
|
|
}
|
|
|
|
return memoryManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace OCLRT
|