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-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
|
|
|
}
|
2018-10-12 16:36:32 +08:00
|
|
|
FlushStamp flushStamp = BaseCSR::flush(batchBuffer, engineOrdinal, allocationsForResidency, osContext);
|
2018-01-19 17:00:51 +08:00
|
|
|
return flushStamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename BaseCSR>
|
2018-09-28 01:55:09 +08:00
|
|
|
void CommandStreamReceiverWithAUBDump<BaseCSR>::makeNonResident(GraphicsAllocation &gfxAllocation) {
|
2018-11-07 16:33:55 +08:00
|
|
|
uint32_t residencyTaskCount = gfxAllocation.getResidencyTaskCount(this->deviceIndex);
|
2018-09-28 01:55:09 +08:00
|
|
|
BaseCSR::makeNonResident(gfxAllocation);
|
2018-11-06 18:38:49 +08:00
|
|
|
gfxAllocation.updateResidencyTaskCount(residencyTaskCount, this->deviceIndex);
|
2018-09-28 01:55:09 +08:00
|
|
|
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
|
|
|
} // namespace OCLRT
|