2018-01-19 10:00:51 +01:00
|
|
|
/*
|
2018-09-18 09:11:08 +02:00
|
|
|
* Copyright (C) 2018 Intel Corporation
|
2018-01-19 10:00:51 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-01-19 10:00:51 +01: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 13:49:09 +02:00
|
|
|
CommandStreamReceiverWithAUBDump<BaseCSR>::CommandStreamReceiverWithAUBDump(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment)
|
2018-08-30 09:27:47 +02:00
|
|
|
: BaseCSR(hwInfoIn, executionEnvironment) {
|
2018-08-08 13:49:09 +02:00
|
|
|
aubCSR = AUBCommandStreamReceiver::create(hwInfoIn, "aubfile", false, executionEnvironment);
|
2018-01-19 10:00:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename BaseCSR>
|
|
|
|
|
CommandStreamReceiverWithAUBDump<BaseCSR>::~CommandStreamReceiverWithAUBDump() {
|
|
|
|
|
delete aubCSR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename BaseCSR>
|
2018-11-26 14:04:52 +01:00
|
|
|
FlushStamp CommandStreamReceiverWithAUBDump<BaseCSR>::flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) {
|
2018-01-19 10:00:51 +01:00
|
|
|
if (aubCSR) {
|
2018-11-26 14:04:52 +01:00
|
|
|
aubCSR->flush(batchBuffer, allocationsForResidency);
|
2018-01-19 10:00:51 +01:00
|
|
|
}
|
2018-11-26 14:04:52 +01:00
|
|
|
FlushStamp flushStamp = BaseCSR::flush(batchBuffer, allocationsForResidency);
|
2018-01-19 10:00:51 +01:00
|
|
|
return flushStamp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename BaseCSR>
|
2018-09-27 19:55:09 +02:00
|
|
|
void CommandStreamReceiverWithAUBDump<BaseCSR>::makeNonResident(GraphicsAllocation &gfxAllocation) {
|
2018-12-03 10:05:36 +01:00
|
|
|
uint32_t residencyTaskCount = gfxAllocation.getResidencyTaskCount(this->osContext->getContextId());
|
2018-09-27 19:55:09 +02:00
|
|
|
BaseCSR::makeNonResident(gfxAllocation);
|
2018-12-03 10:05:36 +01:00
|
|
|
gfxAllocation.updateResidencyTaskCount(residencyTaskCount, this->osContext->getContextId());
|
2018-09-27 19:55:09 +02:00
|
|
|
if (aubCSR) {
|
|
|
|
|
aubCSR->makeNonResident(gfxAllocation);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-12 20:33:03 +02:00
|
|
|
template <typename BaseCSR>
|
|
|
|
|
void CommandStreamReceiverWithAUBDump<BaseCSR>::activateAubSubCapture(const MultiDispatchInfo &dispatchInfo) {
|
|
|
|
|
BaseCSR::activateAubSubCapture(dispatchInfo);
|
|
|
|
|
if (aubCSR) {
|
|
|
|
|
aubCSR->activateAubSubCapture(dispatchInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-28 13:00:53 +01:00
|
|
|
template <typename BaseCSR>
|
|
|
|
|
void CommandStreamReceiverWithAUBDump<BaseCSR>::setOsContext(OsContext &osContext) {
|
|
|
|
|
BaseCSR::setOsContext(osContext);
|
|
|
|
|
if (aubCSR) {
|
|
|
|
|
aubCSR->setOsContext(osContext);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-19 10:00:51 +01:00
|
|
|
} // namespace OCLRT
|