2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2019-01-11 09:00:11 +01:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-02-27 11:39:32 +01:00
|
|
|
#include "runtime/helpers/task_information.h"
|
|
|
|
|
2019-08-22 16:51:02 +02:00
|
|
|
#include "core/command_stream/linear_stream.h"
|
2019-08-02 13:25:45 -07:00
|
|
|
#include "core/helpers/aligned_memory.h"
|
2019-06-19 00:21:29 -07:00
|
|
|
#include "core/helpers/string.h"
|
2018-04-18 14:59:28 +02:00
|
|
|
#include "runtime/built_ins/builtins_dispatch_builder.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
#include "runtime/command_queue/command_queue.h"
|
|
|
|
#include "runtime/command_queue/enqueue_common.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
#include "runtime/command_stream/command_stream_receiver.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
#include "runtime/device/device.h"
|
|
|
|
#include "runtime/device_queue/device_queue.h"
|
2018-02-08 16:00:20 +01:00
|
|
|
#include "runtime/gtpin/gtpin_notify.h"
|
2019-01-25 10:20:32 +01:00
|
|
|
#include "runtime/helpers/csr_deps.h"
|
2019-07-18 21:15:50 +02:00
|
|
|
#include "runtime/helpers/task_information.inl"
|
2018-04-18 14:59:28 +02:00
|
|
|
#include "runtime/mem_obj/mem_obj.h"
|
2018-10-24 14:25:04 +02:00
|
|
|
#include "runtime/memory_manager/internal_allocation_storage.h"
|
2018-04-18 14:59:28 +02:00
|
|
|
#include "runtime/memory_manager/surface.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2019-07-18 21:15:50 +02:00
|
|
|
template void KernelOperation::ResourceCleaner::operator()<LinearStream>(LinearStream *);
|
|
|
|
template void KernelOperation::ResourceCleaner::operator()<IndirectHeap>(IndirectHeap *);
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-07-22 21:28:59 +02:00
|
|
|
CommandMapUnmap::CommandMapUnmap(MapOperationType operationType, MemObj &memObj, MemObjSizeArray ©Size, MemObjOffsetArray ©Offset, bool readOnly,
|
|
|
|
CommandQueue &commandQueue)
|
|
|
|
: Command(commandQueue), memObj(memObj), copySize(copySize), copyOffset(copyOffset), readOnly(readOnly), operationType(operationType) {
|
2018-01-05 11:33:30 +01:00
|
|
|
memObj.incRefInternal();
|
|
|
|
}
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
CompletionStamp &CommandMapUnmap::submit(uint32_t taskLevel, bool terminated) {
|
|
|
|
if (terminated) {
|
2019-07-05 10:02:27 +02:00
|
|
|
memObj.decRefInternal();
|
2017-12-21 00:45:38 +01:00
|
|
|
return completionStamp;
|
|
|
|
}
|
|
|
|
|
2019-07-22 21:28:59 +02:00
|
|
|
auto &commandStreamReceiver = commandQueue.getGpgpuCommandStreamReceiver();
|
|
|
|
auto commandStreamReceiverOwnership = commandStreamReceiver.obtainUniqueOwnership();
|
|
|
|
auto &queueCommandStream = commandQueue.getCS(0);
|
2017-12-21 00:45:38 +01:00
|
|
|
size_t offset = queueCommandStream.getUsed();
|
|
|
|
|
|
|
|
DispatchFlags dispatchFlags;
|
2019-07-22 21:28:59 +02:00
|
|
|
dispatchFlags.blocking = true;
|
2017-12-21 00:45:38 +01:00
|
|
|
dispatchFlags.dcFlush = true;
|
|
|
|
dispatchFlags.useSLM = true;
|
|
|
|
dispatchFlags.guardCommandBufferWithPipeControl = true;
|
2019-07-22 21:28:59 +02:00
|
|
|
dispatchFlags.lowPriority = commandQueue.getPriority() == QueuePriority::LOW;
|
|
|
|
dispatchFlags.throttle = commandQueue.getThrottle();
|
|
|
|
dispatchFlags.preemptionMode = PreemptionHelper::taskPreemptionMode(commandQueue.getDevice(), nullptr);
|
|
|
|
dispatchFlags.multiEngineQueue = commandQueue.isMultiEngineQueue();
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady);
|
|
|
|
|
2019-07-22 21:28:59 +02:00
|
|
|
gtpinNotifyPreFlushTask(&commandQueue);
|
2018-02-08 16:00:20 +01:00
|
|
|
|
2019-07-22 21:28:59 +02:00
|
|
|
completionStamp = commandStreamReceiver.flushTask(queueCommandStream,
|
|
|
|
offset,
|
|
|
|
commandQueue.getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 0u),
|
|
|
|
commandQueue.getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0u),
|
|
|
|
commandQueue.getIndirectHeap(IndirectHeap::SURFACE_STATE, 0u),
|
|
|
|
taskLevel,
|
|
|
|
dispatchFlags,
|
|
|
|
commandQueue.getDevice());
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2018-02-08 20:55:31 +01:00
|
|
|
if (!memObj.isMemObjZeroCopy()) {
|
2019-07-22 21:28:59 +02:00
|
|
|
commandQueue.waitUntilComplete(completionStamp.taskCount, completionStamp.flushStamp, false);
|
|
|
|
if (operationType == MAP) {
|
2018-02-17 22:26:28 +01:00
|
|
|
memObj.transferDataToHostPtr(copySize, copyOffset);
|
|
|
|
} else if (!readOnly) {
|
2019-07-22 21:28:59 +02:00
|
|
|
DEBUG_BREAK_IF(operationType != UNMAP);
|
2018-02-17 22:26:28 +01:00
|
|
|
memObj.transferDataFromHostPtr(copySize, copyOffset);
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-05 10:02:27 +02:00
|
|
|
memObj.decRefInternal();
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
return completionStamp;
|
|
|
|
}
|
|
|
|
|
2019-07-22 20:55:09 +02:00
|
|
|
CommandComputeKernel::CommandComputeKernel(CommandQueue &commandQueue, std::unique_ptr<KernelOperation> &kernelOperation, std::vector<Surface *> &surfaces,
|
2018-03-01 22:43:04 +01:00
|
|
|
bool flushDC, bool usesSLM, bool ndRangeKernel, std::unique_ptr<PrintfHandler> printfHandler,
|
|
|
|
PreemptionMode preemptionMode, Kernel *kernel, uint32_t kernelCount)
|
2019-07-22 21:28:59 +02:00
|
|
|
: Command(commandQueue, kernelOperation), flushDC(flushDC), slmUsed(usesSLM),
|
2018-09-19 10:34:33 -07:00
|
|
|
NDRangeKernel(ndRangeKernel), printfHandler(std::move(printfHandler)), kernel(kernel),
|
|
|
|
kernelCount(kernelCount), preemptionMode(preemptionMode) {
|
2017-12-21 00:45:38 +01:00
|
|
|
for (auto surface : surfaces) {
|
|
|
|
this->surfaces.push_back(surface);
|
|
|
|
}
|
2018-05-11 14:03:03 +02:00
|
|
|
UNRECOVERABLE_IF(nullptr == this->kernel);
|
|
|
|
kernel->incRefInternal();
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CommandComputeKernel::~CommandComputeKernel() {
|
2018-05-11 14:03:03 +02:00
|
|
|
kernel->decRefInternal();
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminated) {
|
|
|
|
if (terminated) {
|
2019-07-19 08:06:40 +02:00
|
|
|
for (auto surface : surfaces) {
|
|
|
|
delete surface;
|
|
|
|
}
|
|
|
|
surfaces.clear();
|
2017-12-21 00:45:38 +01:00
|
|
|
return completionStamp;
|
|
|
|
}
|
2019-07-15 14:28:09 +02:00
|
|
|
auto &commandStreamReceiver = commandQueue.getGpgpuCommandStreamReceiver();
|
2018-05-11 14:03:03 +02:00
|
|
|
bool executionModelKernel = kernel->isParentKernel;
|
2017-12-21 00:45:38 +01:00
|
|
|
auto devQueue = commandQueue.getContext().getDefaultDeviceQueue();
|
|
|
|
|
2018-08-06 14:55:04 +02:00
|
|
|
auto commandStreamReceiverOwnership = commandStreamReceiver.obtainUniqueOwnership();
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
if (executionModelKernel) {
|
|
|
|
while (!devQueue->isEMCriticalSectionFree())
|
|
|
|
;
|
|
|
|
|
|
|
|
devQueue->resetDeviceQueue();
|
|
|
|
devQueue->acquireEMCriticalSection();
|
|
|
|
}
|
|
|
|
|
2018-04-05 15:12:28 +02:00
|
|
|
IndirectHeap *dsh = kernelOperation->dsh.get();
|
|
|
|
IndirectHeap *ioh = kernelOperation->ioh.get();
|
|
|
|
IndirectHeap *ssh = kernelOperation->ssh.get();
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
auto requiresCoherency = false;
|
2019-08-22 17:02:37 +02:00
|
|
|
auto anyUncacheableArgs = false;
|
2017-12-21 00:45:38 +01:00
|
|
|
for (auto &surface : surfaces) {
|
|
|
|
DEBUG_BREAK_IF(!surface);
|
|
|
|
surface->makeResident(commandStreamReceiver);
|
|
|
|
requiresCoherency |= surface->IsCoherent;
|
2019-08-22 17:02:37 +02:00
|
|
|
if (!surface->allowsL3Caching()) {
|
|
|
|
anyUncacheableArgs = true;
|
|
|
|
}
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (printfHandler) {
|
|
|
|
printfHandler.get()->makeResident(commandStreamReceiver);
|
|
|
|
}
|
2019-09-04 09:33:21 +02:00
|
|
|
makeTimestampPacketsResident(commandStreamReceiver);
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
if (executionModelKernel) {
|
|
|
|
uint32_t taskCount = commandStreamReceiver.peekTaskCount() + 1;
|
2019-08-23 13:50:46 +02:00
|
|
|
devQueue->setupExecutionModelDispatch(*ssh, *dsh, kernel, kernelCount,
|
|
|
|
commandStreamReceiver.getTagAllocation()->getGpuAddress(), taskCount, timestamp);
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2018-08-22 13:57:21 +02:00
|
|
|
BuiltIns &builtIns = *this->kernel->getDevice().getExecutionEnvironment()->getBuiltIns();
|
2017-12-21 00:45:38 +01:00
|
|
|
SchedulerKernel &scheduler = builtIns.getSchedulerKernel(commandQueue.getContext());
|
|
|
|
|
|
|
|
scheduler.setArgs(devQueue->getQueueBuffer(),
|
|
|
|
devQueue->getStackBuffer(),
|
|
|
|
devQueue->getEventPoolBuffer(),
|
|
|
|
devQueue->getSlbBuffer(),
|
2018-04-05 15:12:28 +02:00
|
|
|
dsh->getGraphicsAllocation(),
|
2017-12-21 00:45:38 +01:00
|
|
|
kernel->getKernelReflectionSurface(),
|
|
|
|
devQueue->getQueueStorageBuffer(),
|
2018-04-05 15:12:28 +02:00
|
|
|
ssh->getGraphicsAllocation(),
|
2017-12-21 00:45:38 +01:00
|
|
|
devQueue->getDebugQueue());
|
|
|
|
|
|
|
|
devQueue->dispatchScheduler(
|
2019-02-25 09:42:15 +01:00
|
|
|
*kernelOperation->commandStream,
|
2018-03-01 22:43:04 +01:00
|
|
|
scheduler,
|
2018-04-05 15:12:28 +02:00
|
|
|
preemptionMode,
|
|
|
|
ssh,
|
|
|
|
dsh);
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
scheduler.makeResident(commandStreamReceiver);
|
|
|
|
|
|
|
|
// Update SLM usage
|
|
|
|
slmUsed |= scheduler.slmTotalSize > 0;
|
2018-03-27 09:24:26 +02:00
|
|
|
|
|
|
|
this->kernel->getProgram()->getBlockKernelManager()->makeInternalAllocationsResident(commandStreamReceiver);
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DispatchFlags dispatchFlags;
|
|
|
|
dispatchFlags.blocking = true;
|
|
|
|
dispatchFlags.dcFlush = flushDC;
|
|
|
|
dispatchFlags.useSLM = slmUsed;
|
|
|
|
dispatchFlags.guardCommandBufferWithPipeControl = true;
|
|
|
|
dispatchFlags.GSBA32BitRequired = NDRangeKernel;
|
|
|
|
dispatchFlags.requiresCoherency = requiresCoherency;
|
2018-01-24 12:00:27 +01:00
|
|
|
dispatchFlags.lowPriority = commandQueue.getPriority() == QueuePriority::LOW;
|
2018-01-29 11:18:34 +01:00
|
|
|
dispatchFlags.throttle = commandQueue.getThrottle();
|
2018-03-01 22:43:04 +01:00
|
|
|
dispatchFlags.preemptionMode = preemptionMode;
|
2019-09-10 16:13:11 +02:00
|
|
|
dispatchFlags.pipelineSelectArgs.mediaSamplerRequired = kernel->isVmeKernel();
|
2019-02-14 17:12:15 +01:00
|
|
|
dispatchFlags.multiEngineQueue = commandQueue.isMultiEngineQueue();
|
2019-02-14 16:20:14 +01:00
|
|
|
dispatchFlags.numGrfRequired = kernel->getKernelInfo().patchInfo.executionEnvironment->NumGRFRequired;
|
2018-09-19 10:34:33 -07:00
|
|
|
if (commandStreamReceiver.peekTimestampPacketWriteEnabled()) {
|
2019-09-04 11:34:23 +02:00
|
|
|
dispatchFlags.csrDependencies.fillFromEventsRequest(eventsRequest, commandStreamReceiver, CsrDependencies::DependenciesType::OutOfCsr);
|
2018-09-19 10:34:33 -07:00
|
|
|
}
|
2019-09-10 16:13:11 +02:00
|
|
|
dispatchFlags.pipelineSelectArgs.specialPipelineSelectMode = kernel->requiresSpecialPipelineSelectMode();
|
2019-08-22 17:02:37 +02:00
|
|
|
if (anyUncacheableArgs) {
|
|
|
|
dispatchFlags.l3CacheSettings = L3CachingSettings::l3CacheOff;
|
2019-08-26 17:03:13 +02:00
|
|
|
} else if (!kernel->areStatelessWritesUsed()) {
|
|
|
|
dispatchFlags.l3CacheSettings = L3CachingSettings::l3AndL1On;
|
2019-08-22 17:02:37 +02:00
|
|
|
}
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady);
|
|
|
|
|
2018-02-08 16:00:20 +01:00
|
|
|
gtpinNotifyPreFlushTask(&commandQueue);
|
|
|
|
|
2019-02-18 15:23:15 +01:00
|
|
|
completionStamp = commandStreamReceiver.flushTask(*kernelOperation->commandStream,
|
|
|
|
0,
|
2017-12-21 00:45:38 +01:00
|
|
|
*dsh,
|
|
|
|
*ioh,
|
2018-04-05 15:12:28 +02:00
|
|
|
*ssh,
|
2017-12-21 00:45:38 +01:00
|
|
|
taskLevel,
|
2018-08-01 10:01:41 +02:00
|
|
|
dispatchFlags,
|
|
|
|
commandQueue.getDevice());
|
2018-12-04 14:18:17 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
if (printfHandler) {
|
2019-07-08 13:57:04 +02:00
|
|
|
commandQueue.waitUntilComplete(completionStamp.taskCount, completionStamp.flushStamp, false);
|
2017-12-21 00:45:38 +01:00
|
|
|
printfHandler.get()->printEnqueueOutput();
|
|
|
|
}
|
|
|
|
|
2019-07-19 08:06:40 +02:00
|
|
|
for (auto surface : surfaces) {
|
|
|
|
delete surface;
|
|
|
|
}
|
|
|
|
surfaces.clear();
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
return completionStamp;
|
|
|
|
}
|
|
|
|
|
2019-09-04 09:33:21 +02:00
|
|
|
void CommandWithoutKernel::dispatchBlitOperation() {
|
|
|
|
auto bcsCsr = commandQueue.getBcsCommandStreamReceiver();
|
|
|
|
|
|
|
|
makeTimestampPacketsResident(*bcsCsr);
|
|
|
|
|
|
|
|
auto &blitProperties = kernelOperation->blitProperties;
|
|
|
|
blitProperties.csrDependencies.fillFromEventsRequest(eventsRequest, *bcsCsr, CsrDependencies::DependenciesType::All);
|
|
|
|
blitProperties.csrDependencies.push_back(previousTimestampPacketNodes.get());
|
|
|
|
blitProperties.outputTimestampPacket = currentTimestampPacketNodes.get();
|
|
|
|
|
|
|
|
bcsCsr->blitBuffer(blitProperties);
|
|
|
|
}
|
|
|
|
|
2019-09-02 12:49:36 +02:00
|
|
|
CompletionStamp &CommandWithoutKernel::submit(uint32_t taskLevel, bool terminated) {
|
2019-07-22 21:28:59 +02:00
|
|
|
if (terminated) {
|
|
|
|
return completionStamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto &commandStreamReceiver = commandQueue.getGpgpuCommandStreamReceiver();
|
2019-07-22 20:55:09 +02:00
|
|
|
|
|
|
|
if (!kernelOperation) {
|
|
|
|
completionStamp.taskCount = commandStreamReceiver.peekTaskCount();
|
|
|
|
completionStamp.taskLevel = commandStreamReceiver.peekTaskLevel();
|
|
|
|
completionStamp.flushStamp = commandStreamReceiver.obtainCurrentFlushStamp();
|
|
|
|
|
|
|
|
return completionStamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto lockCSR = commandStreamReceiver.obtainUniqueOwnership();
|
|
|
|
|
2019-09-04 09:33:21 +02:00
|
|
|
if (kernelOperation->blitEnqueue) {
|
|
|
|
dispatchBlitOperation();
|
|
|
|
}
|
|
|
|
|
2019-07-22 20:55:09 +02:00
|
|
|
DispatchFlags dispatchFlags;
|
|
|
|
dispatchFlags.blocking = true;
|
|
|
|
dispatchFlags.lowPriority = commandQueue.getPriority() == QueuePriority::LOW;
|
|
|
|
dispatchFlags.throttle = commandQueue.getThrottle();
|
|
|
|
dispatchFlags.preemptionMode = commandQueue.getDevice().getPreemptionMode();
|
|
|
|
dispatchFlags.multiEngineQueue = commandQueue.isMultiEngineQueue();
|
|
|
|
dispatchFlags.guardCommandBufferWithPipeControl = true;
|
|
|
|
dispatchFlags.outOfOrderExecutionAllowed = commandStreamReceiver.isNTo1SubmissionModelEnabled();
|
|
|
|
|
|
|
|
UNRECOVERABLE_IF(!commandStreamReceiver.peekTimestampPacketWriteEnabled());
|
|
|
|
|
2019-09-04 11:34:23 +02:00
|
|
|
dispatchFlags.csrDependencies.fillFromEventsRequest(eventsRequest, commandStreamReceiver, CsrDependencies::DependenciesType::OutOfCsr);
|
2019-07-22 20:55:09 +02:00
|
|
|
|
2019-09-04 09:33:21 +02:00
|
|
|
makeTimestampPacketsResident(commandStreamReceiver);
|
2019-07-22 20:55:09 +02:00
|
|
|
|
|
|
|
gtpinNotifyPreFlushTask(&commandQueue);
|
|
|
|
|
|
|
|
completionStamp = commandStreamReceiver.flushTask(*kernelOperation->commandStream,
|
|
|
|
0,
|
|
|
|
commandQueue.getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 0u),
|
|
|
|
commandQueue.getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0u),
|
|
|
|
commandQueue.getIndirectHeap(IndirectHeap::SURFACE_STATE, 0u),
|
|
|
|
taskLevel,
|
|
|
|
dispatchFlags,
|
|
|
|
commandQueue.getDevice());
|
2019-07-22 21:28:59 +02:00
|
|
|
|
|
|
|
return completionStamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Command::setEventsRequest(EventsRequest &eventsRequest) {
|
2019-01-11 09:00:11 +01:00
|
|
|
this->eventsRequest = eventsRequest;
|
|
|
|
if (eventsRequest.numEventsInWaitList > 0) {
|
|
|
|
eventsWaitlist.resize(eventsRequest.numEventsInWaitList);
|
|
|
|
auto size = eventsRequest.numEventsInWaitList * sizeof(cl_event);
|
|
|
|
memcpy_s(&eventsWaitlist[0], size, eventsRequest.eventWaitList, size);
|
|
|
|
this->eventsRequest.eventWaitList = &eventsWaitlist[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-22 21:28:59 +02:00
|
|
|
void Command::setTimestampPacketNode(TimestampPacketContainer ¤t, TimestampPacketContainer &previous) {
|
2018-11-27 13:07:41 +01:00
|
|
|
currentTimestampPacketNodes = std::make_unique<TimestampPacketContainer>();
|
2018-10-02 14:37:30 -07:00
|
|
|
currentTimestampPacketNodes->assignAndIncrementNodesRefCounts(current);
|
|
|
|
|
2018-11-27 13:07:41 +01:00
|
|
|
previousTimestampPacketNodes = std::make_unique<TimestampPacketContainer>();
|
2018-10-02 14:37:30 -07:00
|
|
|
previousTimestampPacketNodes->assignAndIncrementNodesRefCounts(previous);
|
2018-08-30 08:18:50 +02:00
|
|
|
}
|
|
|
|
|
2019-07-22 21:28:59 +02:00
|
|
|
Command::~Command() {
|
|
|
|
auto &commandStreamReceiver = commandQueue.getGpgpuCommandStreamReceiver();
|
|
|
|
if (commandStreamReceiver.peekTimestampPacketWriteEnabled()) {
|
|
|
|
for (cl_event &eventFromWaitList : eventsWaitlist) {
|
|
|
|
auto event = castToObjectOrAbort<Event>(eventFromWaitList);
|
|
|
|
event->decRefInternal();
|
|
|
|
}
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
2019-07-22 21:28:59 +02:00
|
|
|
}
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-09-04 09:33:21 +02:00
|
|
|
void Command::makeTimestampPacketsResident(CommandStreamReceiver &commandStreamReceiver) {
|
2019-09-04 11:34:23 +02:00
|
|
|
if (commandStreamReceiver.peekTimestampPacketWriteEnabled()) {
|
|
|
|
for (cl_event &eventFromWaitList : eventsWaitlist) {
|
|
|
|
auto event = castToObjectOrAbort<Event>(eventFromWaitList);
|
|
|
|
if (event->getTimestampPacketNodes()) {
|
|
|
|
event->getTimestampPacketNodes()->makeResident(commandStreamReceiver);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-22 20:55:09 +02:00
|
|
|
if (currentTimestampPacketNodes) {
|
|
|
|
currentTimestampPacketNodes->makeResident(commandStreamReceiver);
|
|
|
|
}
|
|
|
|
if (previousTimestampPacketNodes) {
|
|
|
|
previousTimestampPacketNodes->makeResident(commandStreamReceiver);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-22 21:28:59 +02:00
|
|
|
Command::Command(CommandQueue &commandQueue) : commandQueue(commandQueue) {}
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-07-22 21:28:59 +02:00
|
|
|
Command::Command(CommandQueue &commandQueue, std::unique_ptr<KernelOperation> &kernelOperation)
|
|
|
|
: commandQueue(commandQueue), kernelOperation(std::move(kernelOperation)) {}
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|