mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move enqueue blit logic to enqueueHandler
Change-Id: Ibbad22906387c15243708d37b272601f4734697d Related-To: NEO-3020
This commit is contained in:

committed by
sys_ocldev

parent
4403796f58
commit
0a8a77d47c
@ -30,8 +30,6 @@ class MemObj;
|
||||
struct MultiDispatchInfo;
|
||||
class Program;
|
||||
|
||||
class BuiltinDispatchInfoBuilder {
|
||||
public:
|
||||
struct BuiltinOpParams {
|
||||
void *srcPtr = nullptr;
|
||||
void *dstPtr = nullptr;
|
||||
@ -52,6 +50,8 @@ class BuiltinDispatchInfoBuilder {
|
||||
uint32_t dstMipLevel = 0;
|
||||
};
|
||||
|
||||
class BuiltinDispatchInfoBuilder {
|
||||
public:
|
||||
BuiltinDispatchInfoBuilder(BuiltIns &kernelLib) : kernelsLib(kernelLib) {}
|
||||
virtual ~BuiltinDispatchInfoBuilder() = default;
|
||||
|
||||
|
@ -526,7 +526,7 @@ void CommandQueue::dispatchAuxTranslation(MultiDispatchInfo &multiDispatchInfo,
|
||||
multiDispatchInfo.rbegin()->setPipeControlRequired(true);
|
||||
}
|
||||
auto &builder = getDevice().getExecutionEnvironment()->getBuiltIns()->getBuiltinDispatchInfoBuilder(EBuiltInOps::AuxTranslation, getContext(), getDevice());
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dispatchParams;
|
||||
BuiltinOpParams dispatchParams;
|
||||
|
||||
dispatchParams.memObjsForAuxTranslation = &memObjsForAuxTranslation;
|
||||
dispatchParams.auxTranslationDirection = auxTranslationDirection;
|
||||
@ -573,15 +573,12 @@ bool CommandQueue::queueDependenciesClearRequired() const {
|
||||
return isOOQEnabled() || DebugManager.flags.OmitTimestampPacketDependencies.get();
|
||||
}
|
||||
|
||||
bool CommandQueue::blitEnqueueAllowed(cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_command_type cmdType) {
|
||||
bool CommandQueue::blitEnqueueAllowed(bool queueBlocked, cl_command_type cmdType) {
|
||||
bool blitAllowed = device->getExecutionEnvironment()->getHardwareInfo()->capabilityTable.blitterOperationsSupported &&
|
||||
DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get();
|
||||
|
||||
bool queueBlocked = false;
|
||||
uint32_t calculatedTaskLevel = 0;
|
||||
bool commandAllowed = (CL_COMMAND_READ_BUFFER == cmdType) || (CL_COMMAND_WRITE_BUFFER == cmdType);
|
||||
|
||||
obtainTaskLevelAndBlockedStatus(calculatedTaskLevel, numEventsInWaitList, eventWaitList, queueBlocked, cmdType, false);
|
||||
|
||||
return blitAllowed && !queueBlocked;
|
||||
return commandAllowed && !queueBlocked && blitAllowed;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
@ -427,7 +427,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
||||
void *enqueueMapMemObject(TransferProperties &transferProperties, EventsRequest &eventsRequest, cl_int &errcodeRet);
|
||||
cl_int enqueueUnmapMemObject(TransferProperties &transferProperties, EventsRequest &eventsRequest);
|
||||
|
||||
virtual void obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType, bool updateQueueTaskLevel){};
|
||||
virtual void obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType){};
|
||||
|
||||
MOCKABLE_VIRTUAL void dispatchAuxTranslation(MultiDispatchInfo &multiDispatchInfo, MemObjsForAuxTranslation &memObjsForAuxTranslation,
|
||||
AuxTranslationDirection auxTranslationDirection);
|
||||
@ -438,7 +438,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList);
|
||||
void providePerformanceHint(TransferProperties &transferProperties);
|
||||
bool queueDependenciesClearRequired() const;
|
||||
bool blitEnqueueAllowed(cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_command_type cmdType);
|
||||
bool blitEnqueueAllowed(bool queueBlocked, cl_command_type cmdType);
|
||||
|
||||
Context *context = nullptr;
|
||||
Device *device = nullptr;
|
||||
|
@ -289,7 +289,6 @@ class CommandQueueHw : public CommandQueue {
|
||||
void enqueueHandler(Surface **surfacesForResidency,
|
||||
size_t numSurfaceForResidency,
|
||||
bool blocking,
|
||||
bool blitEnqueue,
|
||||
const MultiDispatchInfo &dispatchInfo,
|
||||
cl_uint numEventsInWaitList,
|
||||
const cl_event *eventWaitList,
|
||||
@ -302,7 +301,7 @@ class CommandQueueHw : public CommandQueue {
|
||||
cl_uint numEventsInWaitList,
|
||||
const cl_event *eventWaitList,
|
||||
cl_event *event) {
|
||||
enqueueHandler<enqueueType>(surfacesForResidency, size, blocking, false, dispatchInfo, numEventsInWaitList, eventWaitList, event);
|
||||
enqueueHandler<enqueueType>(surfacesForResidency, size, blocking, dispatchInfo, numEventsInWaitList, eventWaitList, event);
|
||||
}
|
||||
|
||||
template <uint32_t enqueueType, size_t size>
|
||||
@ -357,6 +356,12 @@ class CommandQueueHw : public CommandQueue {
|
||||
size_t numSurfaces,
|
||||
LinearStream *commandStream,
|
||||
CsrDependencies &csrDeps);
|
||||
void processDispatchForBlitEnqueue(const MultiDispatchInfo &multiDispatchInfo,
|
||||
TimestampPacketContainer &previousTimestampPacketNodes,
|
||||
const EventsRequest &eventsRequest,
|
||||
LinearStream &commandStream,
|
||||
uint32_t commandType,
|
||||
bool blocking);
|
||||
void submitCacheFlush(Surface **surfaces,
|
||||
size_t numSurfaces,
|
||||
LinearStream *commandStream,
|
||||
@ -377,13 +382,9 @@ class CommandQueueHw : public CommandQueue {
|
||||
cl_int enqueueMarkerForReadWriteOperation(MemObj *memObj, void *ptr, cl_command_type commandType, cl_bool blocking, cl_uint numEventsInWaitList,
|
||||
const cl_event *eventWaitList, cl_event *event);
|
||||
|
||||
cl_int enqueueReadWriteBufferWithBlitTransfer(cl_command_type commandType, Buffer *buffer, bool blocking,
|
||||
size_t offset, size_t size, void *ptr, cl_uint numEventsInWaitList,
|
||||
const cl_event *eventWaitList, cl_event *event);
|
||||
|
||||
private:
|
||||
bool isTaskLevelUpdateRequired(const uint32_t &taskLevel, const cl_event *eventWaitList, const cl_uint &numEventsInWaitList, unsigned int commandType);
|
||||
void obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType, bool updateQueueTaskLevel) override;
|
||||
void obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType) override;
|
||||
void forceDispatchScheduler(NEO::MultiDispatchInfo &multiDispatchInfo);
|
||||
static void computeOffsetsValueForRectCommands(size_t *bufferOffset,
|
||||
size_t *hostOffset,
|
||||
|
@ -99,39 +99,4 @@ cl_int CommandQueueHw<Family>::enqueueMarkerForReadWriteOperation(MemObj *memObj
|
||||
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
cl_int CommandQueueHw<Family>::enqueueReadWriteBufferWithBlitTransfer(cl_command_type commandType, Buffer *buffer, bool blocking,
|
||||
size_t offset, size_t size, void *ptr, cl_uint numEventsInWaitList,
|
||||
const cl_event *eventWaitList, cl_event *event) {
|
||||
auto blitCommandStreamReceiver = context->getCommandStreamReceiverForBlitOperation(*buffer);
|
||||
EventsRequest eventsRequest(numEventsInWaitList, eventWaitList, event);
|
||||
TimestampPacketContainer previousTimestampPacketNodes;
|
||||
|
||||
auto copyDirection = (CL_COMMAND_WRITE_BUFFER == commandType) ? BlitterConstants::BlitDirection::HostPtrToBuffer
|
||||
: BlitterConstants::BlitDirection::BufferToHostPtr;
|
||||
auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(copyDirection, *blitCommandStreamReceiver,
|
||||
buffer->getGraphicsAllocation(), ptr, blocking,
|
||||
offset, size);
|
||||
|
||||
blitProperties.csrDependencies.fillFromEventsRequestAndMakeResident(eventsRequest, *blitCommandStreamReceiver,
|
||||
CsrDependencies::DependenciesType::All);
|
||||
|
||||
obtainNewTimestampPacketNodes(1, previousTimestampPacketNodes, queueDependenciesClearRequired());
|
||||
blitProperties.csrDependencies.push_back(&previousTimestampPacketNodes);
|
||||
blitProperties.outputTimestampPacket = timestampPacketContainer.get();
|
||||
|
||||
blitCommandStreamReceiver->blitBuffer(blitProperties);
|
||||
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
|
||||
if (CL_COMMAND_WRITE_BUFFER == commandType) {
|
||||
enqueueHandler<CL_COMMAND_WRITE_BUFFER>(nullptr, 0, blocking, true, multiDispatchInfo, numEventsInWaitList, eventWaitList, event);
|
||||
} else {
|
||||
enqueueHandler<CL_COMMAND_READ_BUFFER>(nullptr, 0, blocking, true, multiDispatchInfo, numEventsInWaitList, eventWaitList, event);
|
||||
}
|
||||
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -56,7 +56,7 @@ void *CommandQueue::cpuDataTransferHandler(TransferProperties &transferPropertie
|
||||
|
||||
auto blockQueue = false;
|
||||
auto taskLevel = 0u;
|
||||
obtainTaskLevelAndBlockedStatus(taskLevel, eventsRequest.numEventsInWaitList, eventsRequest.eventWaitList, blockQueue, transferProperties.cmdType, true);
|
||||
obtainTaskLevelAndBlockedStatus(taskLevel, eventsRequest.numEventsInWaitList, eventsRequest.eventWaitList, blockQueue, transferProperties.cmdType);
|
||||
|
||||
DBG_LOG(LogTaskCounts, __FUNCTION__, "taskLevel", taskLevel);
|
||||
|
||||
|
@ -123,13 +123,12 @@ template <uint32_t commandType>
|
||||
void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
|
||||
size_t numSurfaceForResidency,
|
||||
bool blocking,
|
||||
bool blitEnqueue,
|
||||
const MultiDispatchInfo &multiDispatchInfo,
|
||||
cl_uint numEventsInWaitList,
|
||||
const cl_event *eventWaitList,
|
||||
cl_event *event) {
|
||||
if (multiDispatchInfo.empty() && !isCommandWithoutKernel(commandType) && !blitEnqueue) {
|
||||
enqueueHandler<CL_COMMAND_MARKER>(surfacesForResidency, numSurfaceForResidency, blocking, false, multiDispatchInfo,
|
||||
if (multiDispatchInfo.empty() && !isCommandWithoutKernel(commandType)) {
|
||||
enqueueHandler<CL_COMMAND_MARKER>(surfacesForResidency, numSurfaceForResidency, blocking, multiDispatchInfo,
|
||||
numEventsInWaitList, eventWaitList, event);
|
||||
if (event) {
|
||||
castToObjectOrAbort<Event>(*event)->setCmdType(commandType);
|
||||
@ -174,7 +173,8 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
|
||||
|
||||
auto blockQueue = false;
|
||||
auto taskLevel = 0u;
|
||||
obtainTaskLevelAndBlockedStatus(taskLevel, numEventsInWaitList, eventWaitList, blockQueue, commandType, true);
|
||||
obtainTaskLevelAndBlockedStatus(taskLevel, numEventsInWaitList, eventWaitList, blockQueue, commandType);
|
||||
bool blitEnqueue = blitEnqueueAllowed(blockQueue, commandType);
|
||||
|
||||
DBG_LOG(EventsDebugEnable, "blockQueue", blockQueue, "virtualEvent", virtualEvent, "taskLevel", taskLevel);
|
||||
|
||||
@ -214,27 +214,33 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
|
||||
if (getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
|
||||
csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr);
|
||||
|
||||
auto nodesCount = !multiDispatchInfo.empty() ? estimateTimestampPacketNodesCount(multiDispatchInfo) : isCacheFlushCommand(commandType) ? 1u : 0u;
|
||||
size_t nodesCount = 0u;
|
||||
if (blitEnqueue || isCacheFlushCommand(commandType)) {
|
||||
nodesCount = 1;
|
||||
} else if (!multiDispatchInfo.empty()) {
|
||||
nodesCount = estimateTimestampPacketNodesCount(multiDispatchInfo);
|
||||
}
|
||||
|
||||
if (nodesCount > 0) {
|
||||
obtainNewTimestampPacketNodes(nodesCount, previousTimestampPacketNodes, clearAllDependencies);
|
||||
csrDeps.push_back(&previousTimestampPacketNodes);
|
||||
}
|
||||
}
|
||||
|
||||
auto &commandStream = getCommandStream<GfxFamily, commandType>(*this, csrDeps, profilingRequired, perfCountersRequired, multiDispatchInfo, surfacesForResidency, numSurfaceForResidency);
|
||||
auto &commandStream = getCommandStream<GfxFamily, commandType>(*this, csrDeps, profilingRequired, perfCountersRequired,
|
||||
blitEnqueue, multiDispatchInfo, surfacesForResidency, numSurfaceForResidency);
|
||||
auto commandStreamStart = commandStream.getUsed();
|
||||
|
||||
if (eventBuilder.getEvent() && getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
|
||||
eventBuilder.getEvent()->addTimestampPacketNodes(*timestampPacketContainer);
|
||||
}
|
||||
|
||||
if (multiDispatchInfo.empty() == false) {
|
||||
if (blitEnqueue) {
|
||||
processDispatchForBlitEnqueue(multiDispatchInfo, previousTimestampPacketNodes, eventsRequest, commandStream, commandType, blocking);
|
||||
} else if (multiDispatchInfo.empty() == false) {
|
||||
processDispatchForKernels<commandType>(multiDispatchInfo, printfHandler, eventBuilder.getEvent(),
|
||||
hwTimeStamps, parentKernel, blockQueue, devQueueHw, csrDeps, blockedCommandsData,
|
||||
previousTimestampPacketNodes, preemption);
|
||||
} else if (blitEnqueue) {
|
||||
auto currentTimestampPacketNode = timestampPacketContainer->peekNodes().at(0);
|
||||
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(commandStream, *currentTimestampPacketNode);
|
||||
} else if (isCacheFlushCommand(commandType)) {
|
||||
processDispatchForCacheFlush(surfacesForResidency, numSurfaceForResidency, &commandStream, csrDeps);
|
||||
} else if (getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
|
||||
@ -444,6 +450,33 @@ void CommandQueueHw<GfxFamily>::processDispatchForKernels(const MultiDispatchInf
|
||||
getCommandStreamReceiver().setRequiredScratchSizes(multiDispatchInfo.getRequiredScratchSize(), multiDispatchInfo.getRequiredPrivateScratchSize());
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandQueueHw<GfxFamily>::processDispatchForBlitEnqueue(const MultiDispatchInfo &multiDispatchInfo,
|
||||
TimestampPacketContainer &previousTimestampPacketNodes,
|
||||
const EventsRequest &eventsRequest,
|
||||
LinearStream &commandStream,
|
||||
uint32_t commandType,
|
||||
bool blocking) {
|
||||
auto blitDirection = BlitProperties::obtainBlitDirection(commandType);
|
||||
|
||||
auto blitCommandStreamReceiver = BlitProperties::obtainBlitCommandStreamReceiver(*context, multiDispatchInfo.peekBuiltinOpParams(),
|
||||
commandType);
|
||||
|
||||
auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(blitDirection, *blitCommandStreamReceiver,
|
||||
multiDispatchInfo.peekBuiltinOpParams(), blocking);
|
||||
|
||||
blitProperties.csrDependencies.fillFromEventsRequestAndMakeResident(eventsRequest, *blitCommandStreamReceiver,
|
||||
CsrDependencies::DependenciesType::All);
|
||||
|
||||
blitProperties.csrDependencies.push_back(&previousTimestampPacketNodes);
|
||||
blitProperties.outputTimestampPacket = timestampPacketContainer.get();
|
||||
|
||||
blitCommandStreamReceiver->blitBuffer(blitProperties);
|
||||
|
||||
auto currentTimestampPacketNode = timestampPacketContainer->peekNodes().at(0);
|
||||
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(commandStream, *currentTimestampPacketNode);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandQueueHw<GfxFamily>::processDispatchForCacheFlush(Surface **surfaces,
|
||||
size_t numSurfaces,
|
||||
@ -509,13 +542,13 @@ void CommandQueueHw<GfxFamily>::processDeviceEnqueue(Kernel *parentKernel,
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandQueueHw<GfxFamily>::obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType, bool updateQueueTaskLevel) {
|
||||
void CommandQueueHw<GfxFamily>::obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType) {
|
||||
auto isQueueBlockedStatus = isQueueBlocked();
|
||||
taskLevel = getTaskLevelFromWaitList(this->taskLevel, numEventsInWaitList, eventWaitList);
|
||||
blockQueueStatus = (taskLevel == Event::eventNotReady) || isQueueBlockedStatus;
|
||||
|
||||
auto taskLevelUpdateRequired = isTaskLevelUpdateRequired(taskLevel, eventWaitList, numEventsInWaitList, commandType);
|
||||
if (updateQueueTaskLevel && taskLevelUpdateRequired) {
|
||||
if (taskLevelUpdateRequired) {
|
||||
taskLevel++;
|
||||
this->taskLevel = taskLevel;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueCopyBuffer(
|
||||
this->getContext(), this->getDevice());
|
||||
BuiltInOwnershipWrapper builtInLock(builder, this->context);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.srcOffset = {srcOffset, 0, 0};
|
||||
|
@ -42,7 +42,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueCopyBufferRect(
|
||||
MemObjSurface dstBufferSurf(dstBuffer);
|
||||
Surface *surfaces[] = {&srcBufferSurf, &dstBufferSurf};
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.srcOffset = srcOrigin;
|
||||
|
@ -43,7 +43,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueCopyBufferToImage(
|
||||
MemObjSurface dstImgSurf(dstImage);
|
||||
Surface *surfaces[] = {&srcBufferSurf, &dstImgSurf};
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.dstMemObj = dstImage;
|
||||
dc.srcOffset = {srcOffset, 0, 0};
|
||||
|
@ -43,7 +43,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueCopyImage(
|
||||
MemObjSurface dstImgSurf(dstImage);
|
||||
Surface *surfaces[] = {&srcImgSurf, &dstImgSurf};
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage;
|
||||
dc.dstMemObj = dstImage;
|
||||
dc.srcOffset = srcOrigin;
|
||||
|
@ -43,7 +43,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueCopyImageToBuffer(
|
||||
MemObjSurface dstBufferSurf(dstBuffer);
|
||||
Surface *surfaces[] = {&srcImgSurf, &dstBufferSurf};
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.srcOffset = srcOrigin;
|
||||
|
@ -53,7 +53,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueFillBuffer(
|
||||
|
||||
BuiltInOwnershipWrapper builtInLock(builder, this->context);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(this->context, 0, 0, alignUp(patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
|
@ -41,7 +41,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueFillImage(
|
||||
MemObjSurface dstImgSurf(image);
|
||||
Surface *surfaces[] = {&dstImgSurf};
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = const_cast<void *>(fillColor);
|
||||
dc.dstMemObj = image;
|
||||
dc.srcOffset = {0, 0, 0};
|
||||
|
@ -53,9 +53,6 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
|
||||
} else if (!isMemTransferNeeded) {
|
||||
return enqueueMarkerForReadWriteOperation(buffer, ptr, cmdType, blockingRead,
|
||||
numEventsInWaitList, eventWaitList, event);
|
||||
} else if (blitEnqueueAllowed(numEventsInWaitList, eventWaitList, cmdType)) {
|
||||
return enqueueReadWriteBufferWithBlitTransfer(cmdType, buffer, !!blockingRead, offset, size, ptr,
|
||||
numEventsInWaitList, eventWaitList, event);
|
||||
}
|
||||
|
||||
auto &builder = getDevice().getExecutionEnvironment()->getBuiltIns()->getBuiltinDispatchInfoBuilder(EBuiltInOps::CopyBufferToBuffer,
|
||||
@ -89,7 +86,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
|
||||
void *alignedDstPtr = alignDown(dstPtr, 4);
|
||||
size_t dstPtrOffset = ptrDiff(dstPtr, alignedDstPtr);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.dstPtr = alignedDstPtr;
|
||||
dc.dstOffset = {dstPtrOffset, 0, 0};
|
||||
dc.srcMemObj = buffer;
|
||||
|
@ -70,7 +70,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
|
||||
void *alignedDstPtr = alignDown(dstPtr, 4);
|
||||
size_t dstPtrOffset = ptrDiff(dstPtr, alignedDstPtr);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = buffer;
|
||||
dc.dstPtr = alignedDstPtr;
|
||||
dc.srcOffset = bufferOrigin;
|
||||
|
@ -92,7 +92,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadImage(
|
||||
void *alignedDstPtr = alignDown(dstPtr, 4);
|
||||
size_t dstPtrOffset = ptrDiff(dstPtr, alignedDstPtr);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage;
|
||||
dc.dstPtr = alignedDstPtr;
|
||||
dc.dstOffset.x = dstPtrOffset;
|
||||
|
@ -116,7 +116,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMap(cl_bool blockingMap,
|
||||
void *svmBasePtr = svmData->cpuAllocation->getUnderlyingBuffer();
|
||||
size_t svmOffset = ptrDiff(svmPtr, svmBasePtr);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.dstPtr = reinterpret_cast<void *>(svmData->cpuAllocation->getGpuAddressToPatch());
|
||||
dc.dstSvmAlloc = svmData->cpuAllocation;
|
||||
dc.dstOffset = {svmOffset, 0, 0};
|
||||
@ -201,7 +201,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMUnmap(void *svmPtr,
|
||||
|
||||
Surface *surfaces[] = {&dstSurface, &srcSurface};
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.dstPtr = reinterpret_cast<void *>(svmData->gpuAllocation->getGpuAddressToPatch());
|
||||
dc.dstSvmAlloc = svmData->gpuAllocation;
|
||||
dc.dstOffset = {svmOperation->offset, 0, 0};
|
||||
@ -264,7 +264,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMFree(cl_uint numSvmPointers,
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
inline void setOperationParams(BuiltinDispatchInfoBuilder::BuiltinOpParams &operationParams, size_t size,
|
||||
inline void setOperationParams(BuiltinOpParams &operationParams, size_t size,
|
||||
const void *srcPtr, GraphicsAllocation *srcSvmAlloc, size_t srcPtrOffset,
|
||||
void *dstPtr, GraphicsAllocation *dstSvmAlloc, size_t dstPtrOffset) {
|
||||
operationParams.size = {size, 0, 0};
|
||||
@ -310,7 +310,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMemcpy(cl_bool blockingCopy,
|
||||
auto &builder = getDevice().getExecutionEnvironment()->getBuiltIns()->getBuiltinDispatchInfoBuilder(EBuiltInOps::CopyBufferToBuffer,
|
||||
this->getContext(), this->getDevice());
|
||||
BuiltInOwnershipWrapper builtInLock(builder, this->context);
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams operationParams;
|
||||
BuiltinOpParams operationParams;
|
||||
|
||||
Surface *surfaces[2];
|
||||
if (copyType == SvmToHost) {
|
||||
@ -426,7 +426,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMemFill(void *svmPtr,
|
||||
|
||||
BuiltInOwnershipWrapper builtInLock(builder, this->context);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams operationParams;
|
||||
BuiltinOpParams operationParams;
|
||||
MemObj patternMemObj(this->context, 0, 0, alignUp(patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
operationParams.srcMemObj = &patternMemObj;
|
||||
|
@ -48,9 +48,6 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
|
||||
} else if (!isMemTransferNeeded) {
|
||||
return enqueueMarkerForReadWriteOperation(buffer, const_cast<void *>(ptr), cmdType, blockingWrite,
|
||||
numEventsInWaitList, eventWaitList, event);
|
||||
} else if (blitEnqueueAllowed(numEventsInWaitList, eventWaitList, cmdType)) {
|
||||
return enqueueReadWriteBufferWithBlitTransfer(cmdType, buffer, !!blockingWrite, offset, size, const_cast<void *>(ptr),
|
||||
numEventsInWaitList, eventWaitList, event);
|
||||
}
|
||||
|
||||
auto &builder = getDevice().getExecutionEnvironment()->getBuiltIns()->getBuiltinDispatchInfoBuilder(EBuiltInOps::CopyBufferToBuffer,
|
||||
@ -85,7 +82,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
|
||||
void *alignedSrcPtr = alignDown(srcPtr, 4);
|
||||
size_t srcPtrOffset = ptrDiff(srcPtr, alignedSrcPtr);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = alignedSrcPtr;
|
||||
dc.srcOffset = {srcPtrOffset, 0, 0};
|
||||
dc.dstMemObj = buffer;
|
||||
|
@ -69,7 +69,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBufferRect(
|
||||
void *alignedSrcPtr = alignDown(srcPtr, 4);
|
||||
size_t srcPtrOffset = ptrDiff(srcPtr, alignedSrcPtr);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = alignedSrcPtr;
|
||||
dc.dstMemObj = buffer;
|
||||
dc.srcOffset = hostOrigin;
|
||||
|
@ -83,7 +83,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
|
||||
void *alignedSrcPtr = alignDown(srcPtr, 4);
|
||||
size_t srcPtrOffset = ptrDiff(srcPtr, alignedSrcPtr);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = alignedSrcPtr;
|
||||
dc.srcOffset.x = srcPtrOffset;
|
||||
dc.dstMemObj = dstImage;
|
||||
|
@ -180,7 +180,7 @@ class GpgpuWalkerHelper {
|
||||
template <typename GfxFamily>
|
||||
struct EnqueueOperation {
|
||||
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
||||
static size_t getTotalSizeRequiredCS(uint32_t eventType, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo);
|
||||
static size_t getTotalSizeRequiredCS(uint32_t eventType, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounters, bool blitEnqueue, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo);
|
||||
static size_t getSizeRequiredCS(uint32_t cmdType, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const Kernel *pKernel);
|
||||
static size_t getSizeRequiredForTimestampPacketWrite();
|
||||
|
||||
@ -196,8 +196,8 @@ LinearStream &getCommandStream(CommandQueue &commandQueue, bool reserveProfiling
|
||||
}
|
||||
|
||||
template <typename GfxFamily, uint32_t eventType>
|
||||
LinearStream &getCommandStream(CommandQueue &commandQueue, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounterCmdsSpace, const MultiDispatchInfo &multiDispatchInfo, Surface **surfaces, size_t numSurfaces) {
|
||||
size_t expectedSizeCS = EnqueueOperation<GfxFamily>::getTotalSizeRequiredCS(eventType, csrDeps, reserveProfilingCmdsSpace, reservePerfCounterCmdsSpace, commandQueue, multiDispatchInfo);
|
||||
LinearStream &getCommandStream(CommandQueue &commandQueue, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounterCmdsSpace, bool blitEnqueue, const MultiDispatchInfo &multiDispatchInfo, Surface **surfaces, size_t numSurfaces) {
|
||||
size_t expectedSizeCS = EnqueueOperation<GfxFamily>::getTotalSizeRequiredCS(eventType, csrDeps, reserveProfilingCmdsSpace, reservePerfCounterCmdsSpace, blitEnqueue, commandQueue, multiDispatchInfo);
|
||||
return commandQueue.getCS(expectedSizeCS);
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,11 @@ void GpgpuWalkerHelper<GfxFamily>::adjustMiStoreRegMemMode(MI_STORE_REG_MEM<GfxF
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t EnqueueOperation<GfxFamily>::getTotalSizeRequiredCS(uint32_t eventType, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo) {
|
||||
size_t EnqueueOperation<GfxFamily>::getTotalSizeRequiredCS(uint32_t eventType, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounters, bool blitEnqueue, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo) {
|
||||
if (blitEnqueue) {
|
||||
return TimestampPacketHelper::getRequiredCmdStreamSizeForNodeDependency<GfxFamily>();
|
||||
}
|
||||
|
||||
size_t expectedSizeCS = 0;
|
||||
Kernel *parentKernel = multiDispatchInfo.peekParentKernel();
|
||||
if (multiDispatchInfo.peekMainKernel() && multiDispatchInfo.peekMainKernel()->isAuxTranslationRequired()) {
|
||||
@ -204,15 +208,9 @@ size_t EnqueueOperation<GfxFamily>::getTotalSizeRequiredCS(uint32_t eventType, c
|
||||
expectedSizeCS += EnqueueOperation<GfxFamily>::getSizeRequiredCS(eventType, reserveProfilingCmdsSpace, reservePerfCounters, commandQueue, &scheduler);
|
||||
}
|
||||
if (commandQueue.getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
|
||||
bool isReadWriteBufferOperationWithoutKernel = (CL_COMMAND_READ_BUFFER == eventType || CL_COMMAND_WRITE_BUFFER == eventType) &&
|
||||
multiDispatchInfo.empty();
|
||||
expectedSizeCS += TimestampPacketHelper::getRequiredCmdStreamSize<GfxFamily>(csrDeps);
|
||||
if (isReadWriteBufferOperationWithoutKernel) {
|
||||
expectedSizeCS += TimestampPacketHelper::getRequiredCmdStreamSizeForNodeDependency<GfxFamily>();
|
||||
} else {
|
||||
expectedSizeCS += EnqueueOperation<GfxFamily>::getSizeRequiredForTimestampPacketWrite();
|
||||
}
|
||||
}
|
||||
return expectedSizeCS;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
#include "runtime/helpers/blit_commands_helper.h"
|
||||
|
||||
#include "runtime/built_ins/builtins_dispatch_builder.h"
|
||||
#include "runtime/context/context.h"
|
||||
#include "runtime/helpers/timestamp_packet.h"
|
||||
#include "runtime/memory_manager/surface.h"
|
||||
|
||||
@ -30,6 +32,21 @@ BlitProperties BlitProperties::constructPropertiesForReadWriteBuffer(BlitterCons
|
||||
}
|
||||
}
|
||||
|
||||
BlitProperties BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection blitDirection,
|
||||
CommandStreamReceiver &commandStreamReceiver,
|
||||
const BuiltinOpParams &builtinOpParams,
|
||||
bool blocking) {
|
||||
if (BlitterConstants::BlitDirection::HostPtrToBuffer == blitDirection) {
|
||||
return constructPropertiesForReadWriteBuffer(blitDirection, commandStreamReceiver, builtinOpParams.dstMemObj->getGraphicsAllocation(),
|
||||
builtinOpParams.srcPtr, blocking, builtinOpParams.dstOffset.x,
|
||||
builtinOpParams.size.x);
|
||||
} else {
|
||||
return constructPropertiesForReadWriteBuffer(blitDirection, commandStreamReceiver, builtinOpParams.srcMemObj->getGraphicsAllocation(),
|
||||
builtinOpParams.dstPtr, blocking, builtinOpParams.srcOffset.x,
|
||||
builtinOpParams.size.x);
|
||||
}
|
||||
}
|
||||
|
||||
BlitProperties BlitProperties::constructPropertiesForCopyBuffer(GraphicsAllocation *dstAllocation, GraphicsAllocation *srcAllocation,
|
||||
bool blocking, size_t dstOffset, size_t srcOffset, uint64_t copySize) {
|
||||
|
||||
@ -42,4 +59,18 @@ BlitProperties BlitProperties::constructPropertiesForAuxTranslation(AuxTranslati
|
||||
return {nullptr, BlitterConstants::BlitDirection::BufferToBuffer, {}, auxTranslationDirection, allocation, allocation, nullptr, false, 0, 0, allocationSize};
|
||||
}
|
||||
|
||||
BlitterConstants::BlitDirection BlitProperties::obtainBlitDirection(uint32_t commandType) {
|
||||
return (CL_COMMAND_WRITE_BUFFER == commandType) ? BlitterConstants::BlitDirection::HostPtrToBuffer
|
||||
: BlitterConstants::BlitDirection::BufferToHostPtr;
|
||||
}
|
||||
|
||||
CommandStreamReceiver *BlitProperties::obtainBlitCommandStreamReceiver(Context &context, const BuiltinOpParams &builtinOpParams,
|
||||
uint32_t commandType) {
|
||||
if (CL_COMMAND_WRITE_BUFFER == commandType) {
|
||||
return context.getCommandStreamReceiverForBlitOperation(*builtinOpParams.dstMemObj);
|
||||
} else {
|
||||
return context.getCommandStreamReceiverForBlitOperation(*builtinOpParams.srcMemObj);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include <cstdint>
|
||||
|
||||
namespace NEO {
|
||||
struct BuiltinOpParams;
|
||||
class Context;
|
||||
class CommandStreamReceiver;
|
||||
class GraphicsAllocation;
|
||||
class LinearStream;
|
||||
@ -26,12 +28,21 @@ struct BlitProperties {
|
||||
GraphicsAllocation *memObjAllocation, void *hostPtr, bool blocking,
|
||||
size_t offset, uint64_t copySize);
|
||||
|
||||
static BlitProperties constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection blitDirection,
|
||||
CommandStreamReceiver &commandStreamReceiver,
|
||||
const BuiltinOpParams &builtinOpParams,
|
||||
bool blocking);
|
||||
|
||||
static BlitProperties constructPropertiesForCopyBuffer(GraphicsAllocation *dstAllocation, GraphicsAllocation *srcAllocation,
|
||||
bool blocking, size_t dstOffset, size_t srcOffset, uint64_t copySize);
|
||||
|
||||
static BlitProperties constructPropertiesForAuxTranslation(AuxTranslationDirection auxTranslationDirection,
|
||||
GraphicsAllocation *allocation);
|
||||
|
||||
static BlitterConstants::BlitDirection obtainBlitDirection(uint32_t commandType);
|
||||
static CommandStreamReceiver *obtainBlitCommandStreamReceiver(Context &context, const BuiltinOpParams &builtinOpParams,
|
||||
uint32_t commandType);
|
||||
|
||||
TimestampPacketContainer *outputTimestampPacket = nullptr;
|
||||
BlitterConstants::BlitDirection blitDirection;
|
||||
CsrDependencies csrDependencies;
|
||||
|
@ -174,16 +174,16 @@ struct MultiDispatchInfo {
|
||||
Kernel *peekParentKernel() const;
|
||||
Kernel *peekMainKernel() const;
|
||||
|
||||
void setBuiltinOpParams(BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpParams) {
|
||||
void setBuiltinOpParams(BuiltinOpParams builtinOpParams) {
|
||||
this->builtinOpParams = builtinOpParams;
|
||||
}
|
||||
|
||||
const BuiltinDispatchInfoBuilder::BuiltinOpParams &peekBuiltinOpParams() const {
|
||||
const BuiltinOpParams &peekBuiltinOpParams() const {
|
||||
return builtinOpParams;
|
||||
}
|
||||
|
||||
protected:
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpParams = {};
|
||||
BuiltinOpParams builtinOpParams = {};
|
||||
StackVec<DispatchInfo, 9> dispatchInfos;
|
||||
StackVec<MemObj *, 2> redescribedSurfaces;
|
||||
Kernel *mainKernel = nullptr;
|
||||
|
@ -91,8 +91,8 @@ class BuiltInTests
|
||||
deleteDataReadFromFile(pData);
|
||||
}
|
||||
|
||||
bool compareBultinOpParams(const BuiltinDispatchInfoBuilder::BuiltinOpParams &left,
|
||||
const BuiltinDispatchInfoBuilder::BuiltinOpParams &right) {
|
||||
bool compareBultinOpParams(const BuiltinOpParams &left,
|
||||
const BuiltinOpParams &right) {
|
||||
return left.srcPtr == right.srcPtr &&
|
||||
left.dstPtr == right.dstPtr &&
|
||||
left.size == right.size &&
|
||||
@ -194,7 +194,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderCopyBufferToBuffer) {
|
||||
MockBuffer &dst = *dstPtr;
|
||||
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
|
||||
builtinOpsParams.srcMemObj = &src;
|
||||
builtinOpsParams.dstMemObj = &dst;
|
||||
@ -258,7 +258,7 @@ TEST_F(BuiltInTests, givenInputBufferWhenBuildingNonAuxDispatchInfoForAuxTransla
|
||||
mockBuffer[1].getGraphicsAllocation()->setSize(0x20000);
|
||||
mockBuffer[2].getGraphicsAllocation()->setSize(0x30000);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
builtinOpsParams.memObjsForAuxTranslation = &memObjsForAuxTranslation;
|
||||
builtinOpsParams.auxTranslationDirection = AuxTranslationDirection::AuxToNonAux;
|
||||
|
||||
@ -306,7 +306,7 @@ TEST_F(BuiltInTests, givenInputBufferWhenBuildingAuxDispatchInfoForAuxTranslatio
|
||||
mockBuffer[1].getGraphicsAllocation()->setSize(0x20000);
|
||||
mockBuffer[2].getGraphicsAllocation()->setSize(0x30000);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
builtinOpsParams.memObjsForAuxTranslation = &memObjsForAuxTranslation;
|
||||
builtinOpsParams.auxTranslationDirection = AuxTranslationDirection::NonAuxToAux;
|
||||
|
||||
@ -351,7 +351,7 @@ TEST_F(BuiltInTests, givenInputBufferWhenBuildingAuxTranslationDispatchThenPickD
|
||||
std::vector<Kernel *> builtinKernels;
|
||||
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
builtinOpsParams.memObjsForAuxTranslation = &memObjsForAuxTranslation;
|
||||
|
||||
for (auto &buffer : mockBuffer) {
|
||||
@ -384,7 +384,7 @@ TEST_F(BuiltInTests, givenInvalidAuxTranslationDirectionWhenBuildingDispatchInfo
|
||||
MockBuffer mockBuffer;
|
||||
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
builtinOpsParams.memObjsForAuxTranslation = &memObjsForAuxTranslation;
|
||||
|
||||
memObjsForAuxTranslation.insert(&mockBuffer);
|
||||
@ -419,7 +419,7 @@ HWTEST_F(BuiltInTests, givenMoreBuffersForAuxTranslationThanKernelInstancesWhenD
|
||||
EXPECT_EQ(5u, mockAuxBuiltInOp.convertToNonAuxKernel.size());
|
||||
|
||||
MemObjsForAuxTranslation memObjsForAuxTranslation;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
MockBuffer mockBuffer[7];
|
||||
|
||||
@ -491,7 +491,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderCopyBufferToBufferAligned) {
|
||||
AlignedBuffer dst;
|
||||
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
|
||||
builtinOpsParams.srcMemObj = &src;
|
||||
builtinOpsParams.dstMemObj = &dst;
|
||||
@ -525,7 +525,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderCopyBufferToBufferWithSourceOffse
|
||||
AlignedBuffer dst;
|
||||
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
|
||||
builtinOpsParams.srcMemObj = &src;
|
||||
builtinOpsParams.srcOffset.x = 1;
|
||||
@ -551,7 +551,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderReadBufferAligned) {
|
||||
auto dstPtr = alignedMalloc(size, MemoryConstants::cacheLineSize);
|
||||
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
|
||||
builtinOpsParams.srcMemObj = &srcMemObj;
|
||||
builtinOpsParams.dstPtr = dstPtr;
|
||||
@ -586,7 +586,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderWriteBufferAligned) {
|
||||
AlignedBuffer dstMemObj;
|
||||
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams builtinOpsParams;
|
||||
BuiltinOpParams builtinOpsParams;
|
||||
|
||||
builtinOpsParams.srcPtr = srcPtr;
|
||||
builtinOpsParams.dstMemObj = &dstMemObj;
|
||||
@ -659,7 +659,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderReturnFalseIfUnsupportedBuildType
|
||||
auto &bs = *pDevice->getExecutionEnvironment()->getBuiltIns();
|
||||
BuiltinDispatchInfoBuilder bdib{bs};
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams params;
|
||||
BuiltinOpParams params;
|
||||
|
||||
auto ret = bdib.buildDispatchInfos(multiDispatchInfo, params);
|
||||
EXPECT_FALSE(ret);
|
||||
@ -681,7 +681,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderReturnTrueIfExplicitKernelArgNotT
|
||||
auto &bs = *pDevice->getExecutionEnvironment()->getBuiltIns();
|
||||
BuiltinDispatchInfoBuilder bdib{bs};
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams params;
|
||||
BuiltinOpParams params;
|
||||
|
||||
cl_int err;
|
||||
auto ret = bdib.setExplicitArg(1, 5, nullptr, err);
|
||||
|
@ -73,7 +73,7 @@ HWTEST_F(EnqueueHandlerTest, GivenCommandStreamWithoutKernelAndZeroSurfacesWhenE
|
||||
std::unique_ptr<MockCommandQueueWithCacheFlush<FamilyType>> mockCmdQ(new MockCommandQueueWithCacheFlush<FamilyType>(context, pDevice, 0));
|
||||
|
||||
mockCmdQ->commandRequireCacheFlush = true;
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_MARKER>(nullptr, 0, false, false, nullptr, 0, nullptr, nullptr);
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_MARKER>(nullptr, 0, false, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(mockCmdQ->getCS(0).getUsed(), 0u);
|
||||
}
|
||||
HWTEST_F(EnqueueHandlerTest, givenTimestampPacketWriteEnabledAndCommandWithCacheFlushWhenEnqueueingHandlerThenObtainNewStamp) {
|
||||
@ -87,7 +87,7 @@ HWTEST_F(EnqueueHandlerTest, givenTimestampPacketWriteEnabledAndCommandWithCache
|
||||
|
||||
cl_event event;
|
||||
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_MARKER>(nullptr, 0, false, false, nullptr, 0, nullptr, &event);
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_MARKER>(nullptr, 0, false, nullptr, 0, nullptr, &event);
|
||||
auto node1 = mockCmdQ->timestampPacketContainer->peekNodes().at(0);
|
||||
EXPECT_NE(nullptr, node1);
|
||||
clReleaseEvent(event);
|
||||
@ -103,7 +103,7 @@ HWTEST_F(EnqueueHandlerTest, givenTimestampPacketWriteDisabledAndCommandWithCach
|
||||
|
||||
cl_event event;
|
||||
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_MARKER>(nullptr, 0, false, false, nullptr, 0, nullptr, &event);
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_MARKER>(nullptr, 0, false, nullptr, 0, nullptr, &event);
|
||||
auto container = mockCmdQ->timestampPacketContainer.get();
|
||||
EXPECT_EQ(nullptr, container);
|
||||
clReleaseEvent(event);
|
||||
|
@ -161,7 +161,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, 2D_addsIndirectData) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.srcOffset = {0, 0, 0};
|
||||
|
@ -136,7 +136,7 @@ HWTEST_F(EnqueueCopyBufferTest, addsIndirectData) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.srcMemObj = dstBuffer;
|
||||
dc.srcOffset = {EnqueueCopyBufferTraits::srcOffset, 0, 0};
|
||||
@ -229,7 +229,7 @@ HWTEST_F(EnqueueCopyBufferTest, argumentZeroShouldMatchSourceAddress) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.srcOffset = {EnqueueCopyBufferTraits::srcOffset, 0, 0};
|
||||
@ -256,7 +256,7 @@ HWTEST_F(EnqueueCopyBufferTest, argumentOneShouldMatchDestAddress) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.srcOffset = {EnqueueCopyBufferTraits::srcOffset, 0, 0};
|
||||
|
@ -99,7 +99,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, addsIndirectData) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(&this->context, 0, 0, alignUp(EnqueueFillBufferTraits::patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
@ -131,7 +131,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, FillBufferRightLeftover) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(&this->context, 0, 0, alignUp(EnqueueFillBufferTraits::patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
@ -158,7 +158,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, FillBufferMiddle) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(&this->context, 0, 0, alignUp(EnqueueFillBufferTraits::patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
@ -185,7 +185,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, FillBufferLeftLeftover) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(&this->context, 0, 0, alignUp(EnqueueFillBufferTraits::patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
@ -278,7 +278,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, argumentZeroShouldMatchDestAddress) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(&this->context, 0, 0, alignUp(EnqueueFillBufferTraits::patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
@ -314,7 +314,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, DISABLED_argumentOneShouldMatchOffset) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(&this->context, 0, 0, alignUp(EnqueueFillBufferTraits::patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
@ -347,7 +347,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, argumentTwoShouldMatchPatternPtr) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(&this->context, 0, 0, alignUp(EnqueueFillBufferTraits::patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
|
@ -67,7 +67,7 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWithKernelSplitWhenAubCsrIsActiv
|
||||
auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(context, pDevice, 0));
|
||||
MockMultiDispatchInfo multiDispatchInfo(std::vector<Kernel *>({kernel1.mockKernel, kernel2.mockKernel}));
|
||||
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_WRITE_BUFFER>(nullptr, 0, true, false, multiDispatchInfo, 0, nullptr, nullptr);
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_WRITE_BUFFER>(nullptr, 0, true, multiDispatchInfo, 0, nullptr, nullptr);
|
||||
|
||||
EXPECT_TRUE(aubCsr->addAubCommentCalled);
|
||||
|
||||
@ -301,7 +301,6 @@ HWTEST_F(EnqueueHandlerTest, enqueueBlockedWithoutReturnEventCreatesVirtualEvent
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(nullptr,
|
||||
0,
|
||||
blocking,
|
||||
false,
|
||||
multiDispatchInfo,
|
||||
0,
|
||||
nullptr,
|
||||
@ -334,7 +333,6 @@ HWTEST_F(EnqueueHandlerTest, enqueueBlockedSetsVirtualEventAsCurrentCmdQVirtualE
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(nullptr,
|
||||
0,
|
||||
blocking,
|
||||
false,
|
||||
multiDispatchInfo,
|
||||
0,
|
||||
nullptr,
|
||||
@ -359,7 +357,6 @@ HWTEST_F(EnqueueHandlerTest, enqueueWithOutputEventRegistersEvent) {
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(nullptr,
|
||||
0,
|
||||
blocking,
|
||||
false,
|
||||
multiDispatchInfo,
|
||||
0,
|
||||
nullptr,
|
||||
@ -436,7 +433,6 @@ HWTEST_F(EnqueueHandlerTest, givenExternallySynchronizedParentEventWhenRequestin
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_MARKER>(nullptr,
|
||||
0,
|
||||
blocking,
|
||||
false,
|
||||
emptyDispatchInfo,
|
||||
1U,
|
||||
&inEv,
|
||||
@ -462,7 +458,6 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenSubCaptureIsOffThenActivateS
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(nullptr,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
multiDispatchInfo,
|
||||
0,
|
||||
nullptr,
|
||||
@ -485,7 +480,6 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenSubCaptureIsOnThenActivateSu
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(nullptr,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
multiDispatchInfo,
|
||||
0,
|
||||
nullptr,
|
||||
@ -511,7 +505,6 @@ HWTEST_F(EnqueueHandlerTestBasic, givenEnqueueHandlerWhenCommandIsBlokingThenCom
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_WRITE_BUFFER>(nullptr,
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
multiDispatchInfo,
|
||||
0,
|
||||
nullptr,
|
||||
|
@ -175,7 +175,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferRectTest, 2D_addsIndirectData) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = buffer.get();
|
||||
dc.dstPtr = hostPtr;
|
||||
dc.srcOffset = {0, 0, 0};
|
||||
|
@ -142,7 +142,7 @@ HWTEST_F(EnqueueReadBufferTypeTest, addsIndirectData) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.dstPtr = EnqueueReadBufferTraits::hostPtr;
|
||||
dc.srcMemObj = srcBuffer.get();
|
||||
dc.srcOffset = {EnqueueReadBufferTraits::offset, 0, 0};
|
||||
|
@ -149,7 +149,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferRectTest, 2D_addsIndirectData) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = hostPtr;
|
||||
dc.dstMemObj = buffer.get();
|
||||
dc.srcOffset = {0, 0, 0};
|
||||
|
@ -141,7 +141,7 @@ HWTEST_F(EnqueueWriteBufferTypeTest, addsIndirectData) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = EnqueueWriteBufferTraits::hostPtr;
|
||||
dc.dstMemObj = srcBuffer.get();
|
||||
dc.dstOffset = {EnqueueWriteBufferTraits::offset, 0, 0};
|
||||
|
@ -80,7 +80,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueFillBuffer) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
MemObj patternMemObj(this->context, 0, 0, alignUp(EnqueueFillBufferTraits::patternSize, 4), patternAllocation->getUnderlyingBuffer(),
|
||||
patternAllocation->getUnderlyingBuffer(), patternAllocation, false, false, true);
|
||||
dc.srcMemObj = &patternMemObj;
|
||||
@ -95,7 +95,8 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueFillBuffer) {
|
||||
auto usedAfterIOH = ioh.getUsed();
|
||||
auto usedAfterSSH = ssh.getUsed();
|
||||
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_FILL_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_FILL_BUFFER, CsrDependencies(), false, false,
|
||||
false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeDSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
|
||||
auto expectedSizeIOH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
|
||||
auto expectedSizeSSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
|
||||
@ -132,7 +133,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueCopyBuffer) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.srcMemObj = dstBuffer;
|
||||
dc.srcOffset = {EnqueueCopyBufferTraits::srcOffset, 0, 0};
|
||||
@ -146,7 +147,8 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueCopyBuffer) {
|
||||
auto usedAfterIOH = ioh.getUsed();
|
||||
auto usedAfterSSH = ssh.getUsed();
|
||||
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_COPY_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_COPY_BUFFER, CsrDependencies(), false, false,
|
||||
false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeDSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
|
||||
auto expectedSizeIOH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
|
||||
auto expectedSizeSSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
|
||||
@ -185,7 +187,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferNonBlocking) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.dstPtr = EnqueueReadBufferTraits::hostPtr;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.srcOffset = {EnqueueReadBufferTraits::offset, 0, 0};
|
||||
@ -198,7 +200,8 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferNonBlocking) {
|
||||
auto usedAfterIOH = ioh.getUsed();
|
||||
auto usedAfterSSH = ssh.getUsed();
|
||||
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, CsrDependencies(), false, false,
|
||||
false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeDSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
|
||||
auto expectedSizeIOH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
|
||||
auto expectedSizeSSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
|
||||
@ -238,7 +241,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferBlocking) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.dstPtr = EnqueueReadBufferTraits::hostPtr;
|
||||
dc.srcMemObj = srcBuffer;
|
||||
dc.srcOffset = {EnqueueReadBufferTraits::offset, 0, 0};
|
||||
@ -251,7 +254,8 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferBlocking) {
|
||||
auto usedAfterIOH = ioh.getUsed();
|
||||
auto usedAfterSSH = ssh.getUsed();
|
||||
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, CsrDependencies(), false, false,
|
||||
false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeDSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
|
||||
auto expectedSizeIOH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
|
||||
auto expectedSizeSSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
|
||||
@ -291,7 +295,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferNonBlocking) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = EnqueueWriteBufferTraits::hostPtr;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.dstOffset = {EnqueueWriteBufferTraits::offset, 0, 0};
|
||||
@ -304,7 +308,8 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferNonBlocking) {
|
||||
auto usedAfterIOH = ioh.getUsed();
|
||||
auto usedAfterSSH = ssh.getUsed();
|
||||
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, CsrDependencies(), false, false,
|
||||
false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeDSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
|
||||
auto expectedSizeIOH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
|
||||
auto expectedSizeSSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
|
||||
@ -341,7 +346,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferBlocking) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = EnqueueWriteBufferTraits::hostPtr;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.dstOffset = {EnqueueWriteBufferTraits::offset, 0, 0};
|
||||
@ -354,7 +359,8 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferBlocking) {
|
||||
auto usedAfterIOH = ioh.getUsed();
|
||||
auto usedAfterSSH = ssh.getUsed();
|
||||
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, CsrDependencies(), false, false,
|
||||
false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeDSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
|
||||
auto expectedSizeIOH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
|
||||
auto expectedSizeSSH = HardwareCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
|
||||
@ -375,7 +381,7 @@ HWTEST_F(GetSizeRequiredBufferTest, givenMultipleKernelRequiringSshWhenTotalSize
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = EnqueueWriteBufferTraits::hostPtr;
|
||||
dc.dstMemObj = dstBuffer;
|
||||
dc.dstOffset = {EnqueueWriteBufferTraits::offset, 0, 0};
|
||||
|
@ -71,7 +71,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyImage) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage;
|
||||
dc.dstMemObj = dstImage;
|
||||
dc.srcOffset = EnqueueCopyImageTraits::srcOrigin;
|
||||
@ -174,7 +174,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageNonBlocking) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage;
|
||||
dc.dstPtr = EnqueueReadImageTraits::hostPtr;
|
||||
dc.srcOffset = EnqueueReadImageTraits::origin;
|
||||
@ -228,7 +228,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageBlocking) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage;
|
||||
dc.dstPtr = EnqueueReadImageTraits::hostPtr;
|
||||
dc.srcOffset = EnqueueReadImageTraits::origin;
|
||||
@ -282,7 +282,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageNonBlocking) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = EnqueueWriteImageTraits::hostPtr;
|
||||
dc.dstMemObj = dstImage;
|
||||
dc.dstOffset = EnqueueWriteImageTraits::origin;
|
||||
@ -336,7 +336,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageBlocking) {
|
||||
pCmdQ->getContext(), pCmdQ->getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = EnqueueWriteImageTraits::hostPtr;
|
||||
dc.dstMemObj = dstImage;
|
||||
dc.dstOffset = EnqueueWriteImageTraits::origin;
|
||||
|
@ -231,7 +231,8 @@ HWTEST_F(ParentKernelCommandStreamFixture, GivenDispatchInfoWithParentKernelWhen
|
||||
|
||||
size_t totalKernelSize = alignUp(numOfKernels * size, MemoryConstants::pageSize);
|
||||
|
||||
LinearStream &commandStream = getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*pCmdQ, CsrDependencies(), false, false, multiDispatchInfo, nullptr, 0);
|
||||
LinearStream &commandStream = getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*pCmdQ, CsrDependencies(), false, false,
|
||||
false, multiDispatchInfo, nullptr, 0);
|
||||
|
||||
EXPECT_LT(totalKernelSize, commandStream.getMaxAvailableSpace());
|
||||
|
||||
|
@ -70,7 +70,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, programInterfaceDescriptorData
|
||||
cmdQ.getContext(), cmdQ.getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage.get();
|
||||
dc.dstMemObj = dstImage.get();
|
||||
dc.srcOffset = {0, 0, 0};
|
||||
@ -142,7 +142,7 @@ HWTEST_F(HardwareCommandsTest, sendCrossThreadDataResourceUsage) {
|
||||
cmdQ.getContext(), cmdQ.getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage.get();
|
||||
dc.dstMemObj = dstImage.get();
|
||||
dc.srcOffset = {0, 0, 0};
|
||||
@ -290,7 +290,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, sendIndirectStateResourceUsage
|
||||
cmdQ.getContext(), cmdQ.getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = srcImage.get();
|
||||
dc.dstMemObj = dstImage.get();
|
||||
dc.srcOffset = {0, 0, 0};
|
||||
@ -491,7 +491,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, whenSendingIndirectStateThenKe
|
||||
auto &builder = cmdQ.getDevice().getExecutionEnvironment()->getBuiltIns()->getBuiltinDispatchInfoBuilder(EBuiltInOps::CopyImageToImage3d,
|
||||
cmdQ.getContext(), cmdQ.getDevice());
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcMemObj = img.get();
|
||||
dc.dstMemObj = img.get();
|
||||
dc.size = {1, 1, 1};
|
||||
@ -569,7 +569,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, usedBindingTableStatePointer)
|
||||
cmdQ.getContext(), cmdQ.getDevice());
|
||||
ASSERT_NE(nullptr, &builder);
|
||||
|
||||
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
|
||||
BuiltinOpParams dc;
|
||||
dc.srcPtr = nullptr;
|
||||
dc.dstMemObj = dstImage.get();
|
||||
dc.dstOffset = {0, 0, 0};
|
||||
|
@ -203,11 +203,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, TimestampPacketTests, givenTimestampPacketWriteEnabl
|
||||
MockMultiDispatchInfo multiDispatchInfo(std::vector<Kernel *>({kernel->mockKernel, kernel2.mockKernel}));
|
||||
|
||||
device->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = false;
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, CsrDependencies(), false, false, multiDispatchInfo, nullptr, 0);
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, CsrDependencies(), false, false, false, multiDispatchInfo, nullptr, 0);
|
||||
auto sizeWithDisabled = mockCmdQ->requestedCmdStreamSize;
|
||||
|
||||
device->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = true;
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, CsrDependencies(), false, false, multiDispatchInfo, nullptr, 0);
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, CsrDependencies(), false, false, false, multiDispatchInfo, nullptr, 0);
|
||||
auto sizeWithEnabled = mockCmdQ->requestedCmdStreamSize;
|
||||
|
||||
auto extendedSize = sizeWithDisabled + sizeof(typename FamilyType::PIPE_CONTROL);
|
||||
@ -219,7 +219,8 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledAndOoqWhenEstimat
|
||||
mockCmdQ->setOoqEnabled();
|
||||
|
||||
device->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = false;
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, CsrDependencies(), false, false, multiDispatchInfo, nullptr, 0);
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, CsrDependencies(), false, false,
|
||||
false, multiDispatchInfo, nullptr, 0);
|
||||
auto sizeWithDisabled = mockCmdQ->requestedCmdStreamSize;
|
||||
|
||||
device->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = true;
|
||||
@ -248,7 +249,7 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledAndOoqWhenEstimat
|
||||
CsrDependencies csrDeps;
|
||||
csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, device->getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr);
|
||||
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, csrDeps, false, false, multiDispatchInfo, nullptr, 0);
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, csrDeps, false, false, false, multiDispatchInfo, nullptr, 0);
|
||||
auto sizeWithEnabled = mockCmdQ->requestedCmdStreamSize;
|
||||
|
||||
size_t extendedSize = sizeWithDisabled + EnqueueOperation<FamilyType>::getSizeRequiredForTimestampPacketWrite() +
|
||||
@ -262,7 +263,7 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEstimatingStr
|
||||
MockMultiDispatchInfo multiDispatchInfo(std::vector<Kernel *>({kernel->mockKernel, kernel2.mockKernel}));
|
||||
|
||||
device->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = false;
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, CsrDependencies(), false, false, multiDispatchInfo, nullptr, 0);
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, CsrDependencies(), false, false, false, multiDispatchInfo, nullptr, 0);
|
||||
auto sizeWithDisabled = mockCmdQ->requestedCmdStreamSize;
|
||||
|
||||
device->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = true;
|
||||
@ -291,7 +292,7 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEstimatingStr
|
||||
CsrDependencies csrDeps;
|
||||
csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, device->getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr);
|
||||
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, csrDeps, false, false, multiDispatchInfo, nullptr, 0);
|
||||
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*mockCmdQ, csrDeps, false, false, false, multiDispatchInfo, nullptr, 0);
|
||||
auto sizeWithEnabled = mockCmdQ->requestedCmdStreamSize;
|
||||
|
||||
size_t extendedSize = sizeWithDisabled + EnqueueOperation<FamilyType>::getSizeRequiredForTimestampPacketWrite() +
|
||||
|
@ -836,9 +836,9 @@ HWTEST_F(BcsBufferTests, givenReadOrWriteBufferOperationWithoutKernelWhenEstimat
|
||||
MultiDispatchInfo multiDispatchInfo;
|
||||
|
||||
auto readBufferCmdsSize = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, csrDependencies, false, false,
|
||||
*cmdQ, multiDispatchInfo);
|
||||
true, *cmdQ, multiDispatchInfo);
|
||||
auto writeBufferCmdsSize = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, csrDependencies, false, false,
|
||||
*cmdQ, multiDispatchInfo);
|
||||
true, *cmdQ, multiDispatchInfo);
|
||||
auto expectedSize = TimestampPacketHelper::getRequiredCmdStreamSizeForNodeDependency<FamilyType>();
|
||||
|
||||
EXPECT_EQ(expectedSize, readBufferCmdsSize);
|
||||
|
@ -129,7 +129,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingTests, GIVENCommandQueueWithProfilingAndFor
|
||||
multiDispatchInfo.push(dispatchInfo);
|
||||
multiDispatchInfo.push(dispatchInfo);
|
||||
auto &commandStreamTask = getCommandStream<FamilyType, CL_COMMAND_TASK>(*pCmdQ, true, false, &kernel);
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_TASK, CsrDependencies(), true, false, *pCmdQ, multiDispatchInfo);
|
||||
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_TASK, CsrDependencies(), true, false,
|
||||
false, *pCmdQ, multiDispatchInfo);
|
||||
EXPECT_GE(expectedSizeCS, requiredSize);
|
||||
EXPECT_GE(commandStreamTask.getAvailableSpace(), requiredSize);
|
||||
}
|
||||
|
Reference in New Issue
Block a user