Files
compute-runtime/runtime/command_stream/command_stream_receiver_with_aub_dump.inl
Mateusz Jablonski 66492a53a4 Change type of residency task count to uint32_t
Move definitions of objectNotUsed and objectNotResident to GraphicsAllocation

Change-Id: I2aec604a865cc6c975e9d1121028cbdd35c0b18a
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-11-16 16:04:48 +01:00

54 lines
1.9 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) {
if (aubCSR) {
aubCSR->flush(batchBuffer, engineOrdinal, allocationsForResidency, osContext);
}
FlushStamp flushStamp = BaseCSR::flush(batchBuffer, engineOrdinal, allocationsForResidency, osContext);
return flushStamp;
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::makeNonResident(GraphicsAllocation &gfxAllocation) {
uint32_t residencyTaskCount = gfxAllocation.getResidencyTaskCount(this->deviceIndex);
BaseCSR::makeNonResident(gfxAllocation);
gfxAllocation.updateResidencyTaskCount(residencyTaskCount, this->deviceIndex);
if (aubCSR) {
aubCSR->makeNonResident(gfxAllocation);
}
}
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::activateAubSubCapture(const MultiDispatchInfo &dispatchInfo) {
BaseCSR::activateAubSubCapture(dispatchInfo);
if (aubCSR) {
aubCSR->activateAubSubCapture(dispatchInfo);
}
}
} // namespace OCLRT