Small refactor getCommandStreamReceiver
Related-To: NEO-4692 Change-Id: Ie8c36982d5bd626735d1f8e6d04084bce67738e5 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
parent
31118b0bd7
commit
f84cd9f424
|
@ -120,8 +120,8 @@ CommandStreamReceiver *CommandQueue::getBcsCommandStreamReceiver() const {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CommandStreamReceiver &CommandQueue::getCommandStreamReceiverByCommandType(cl_command_type cmdType) const {
|
||||
if (blitEnqueueAllowed(cmdType)) {
|
||||
CommandStreamReceiver &CommandQueue::getCommandStreamReceiver(bool blitAllowed) const {
|
||||
if (blitAllowed) {
|
||||
auto csr = getBcsCommandStreamReceiver();
|
||||
UNRECOVERABLE_IF(!csr);
|
||||
return *csr;
|
||||
|
|
|
@ -224,7 +224,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
|||
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver &getGpgpuCommandStreamReceiver() const;
|
||||
CommandStreamReceiver *getBcsCommandStreamReceiver() const;
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver &getCommandStreamReceiverByCommandType(cl_command_type cmdType) const;
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver &getCommandStreamReceiver(bool blitAllowed) const;
|
||||
Device &getDevice() const noexcept;
|
||||
ClDevice &getClDevice() const { return *device; }
|
||||
Context &getContext() const { return *context; }
|
||||
|
|
|
@ -349,7 +349,7 @@ class CommandQueueHw : public CommandQueue {
|
|||
cl_event *event);
|
||||
|
||||
template <uint32_t cmdType, size_t surfaceCount>
|
||||
void dispatchBcsOrGpgpuEnqueue(MultiDispatchInfo &dispatchInfo, Surface *(&surfaces)[surfaceCount], EBuiltInOps::Type builtInOperation, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event, bool blocking);
|
||||
void dispatchBcsOrGpgpuEnqueue(MultiDispatchInfo &dispatchInfo, Surface *(&surfaces)[surfaceCount], EBuiltInOps::Type builtInOperation, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event, bool blocking, bool blitAllowed);
|
||||
|
||||
template <uint32_t cmdType>
|
||||
void enqueueBlit(const MultiDispatchInfo &multiDispatchInfo, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event, bool blocking);
|
||||
|
|
|
@ -1107,8 +1107,8 @@ void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispat
|
|||
|
||||
template <typename GfxFamily>
|
||||
template <uint32_t cmdType, size_t surfaceCount>
|
||||
void CommandQueueHw<GfxFamily>::dispatchBcsOrGpgpuEnqueue(MultiDispatchInfo &dispatchInfo, Surface *(&surfaces)[surfaceCount], EBuiltInOps::Type builtInOperation, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event, bool blocking) {
|
||||
if (blitEnqueueAllowed(cmdType)) {
|
||||
void CommandQueueHw<GfxFamily>::dispatchBcsOrGpgpuEnqueue(MultiDispatchInfo &dispatchInfo, Surface *(&surfaces)[surfaceCount], EBuiltInOps::Type builtInOperation, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event, bool blocking, bool blitAllowed) {
|
||||
if (blitAllowed) {
|
||||
enqueueBlit<cmdType>(dispatchInfo, numEventsInWaitList, eventWaitList, event, blocking);
|
||||
} else {
|
||||
auto &builder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder(builtInOperation,
|
||||
|
|
|
@ -48,8 +48,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueCopyBuffer(
|
|||
MemObjSurface s1(srcBuffer);
|
||||
MemObjSurface s2(dstBuffer);
|
||||
Surface *surfaces[] = {&s1, &s2};
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_COPY_BUFFER>(dispatchInfo, surfaces, eBuiltInOpsType, numEventsInWaitList, eventWaitList, event, false);
|
||||
auto blitAllowed = blitEnqueueAllowed(CL_COMMAND_COPY_BUFFER);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_COPY_BUFFER>(dispatchInfo, surfaces, eBuiltInOpsType, numEventsInWaitList, eventWaitList, event, false, blitAllowed);
|
||||
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -54,8 +54,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueCopyBufferRect(
|
|||
dc.dstSlicePitch = dstSlicePitch;
|
||||
|
||||
MultiDispatchInfo dispatchInfo(dc);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_COPY_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, false);
|
||||
auto blitAllowed = blitEnqueueAllowed(CL_COMMAND_COPY_BUFFER_RECT);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_COPY_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, false, blitAllowed);
|
||||
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
|
|||
cl_event *event) {
|
||||
|
||||
const cl_command_type cmdType = CL_COMMAND_READ_BUFFER;
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
|
||||
if (nullptr == mapAllocation) {
|
||||
notifyEnqueueReadBuffer(buffer, !!blockingRead, EngineHelpers::isBcs(csr.getOsContext().getEngineType()));
|
||||
|
@ -124,8 +125,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
|
|||
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_BAD_INTEL, CL_ENQUEUE_READ_BUFFER_DOESNT_MEET_ALIGNMENT_RESTRICTIONS, ptr, size, MemoryConstants::pageSize, MemoryConstants::pageSize);
|
||||
}
|
||||
}
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead, blitAllowed);
|
||||
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -59,11 +59,12 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
|
|||
MemObjSurface bufferSurf(buffer);
|
||||
HostPtrSurface hostPtrSurf(dstPtr, hostPtrSize);
|
||||
Surface *surfaces[] = {&bufferSurf, &hostPtrSurf};
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
|
||||
if (region[0] != 0 &&
|
||||
region[1] != 0 &&
|
||||
region[2] != 0) {
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
bool status = csr.createAllocationForHostSurface(hostPtrSurf, true);
|
||||
if (!status) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
|
@ -88,8 +89,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
|
|||
dc.dstSlicePitch = hostSlicePitch;
|
||||
|
||||
MultiDispatchInfo dispatchInfo(dc);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead, blitAllowed);
|
||||
|
||||
if (context->isProvidingPerformanceHints()) {
|
||||
context->providePerformanceHintForMemoryTransfer(CL_COMMAND_READ_BUFFER_RECT, true, static_cast<cl_mem>(buffer), ptr);
|
||||
|
|
|
@ -41,8 +41,9 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadImage(
|
|||
const cl_event *eventWaitList,
|
||||
cl_event *event) {
|
||||
|
||||
auto cmdType = CL_COMMAND_READ_IMAGE;
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
cl_command_type cmdType = CL_COMMAND_READ_IMAGE;
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
if (nullptr == mapAllocation) {
|
||||
notifyEnqueueReadImage(srcImage, static_cast<bool>(blockingRead), EngineHelpers::isBcs(csr.getOsContext().getEngineType()));
|
||||
}
|
||||
|
@ -104,7 +105,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadImage(
|
|||
auto eBuiltInOps = EBuiltInOps::CopyImage3dToBuffer;
|
||||
MultiDispatchInfo dispatchInfo(dc);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_IMAGE>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead == CL_TRUE);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_IMAGE>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead == CL_TRUE, blitAllowed);
|
||||
|
||||
if (context->isProvidingPerformanceHints()) {
|
||||
if (!isL3Capable(ptr, hostPtrSize)) {
|
||||
|
|
|
@ -126,8 +126,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMap(cl_bool blockingMap,
|
|||
dc.unifiedMemoryArgsRequireMemSync = externalAppCall;
|
||||
|
||||
MultiDispatchInfo dispatchInfo(dc);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER>(dispatchInfo, surfaces, EBuiltInOps::CopyBufferToBuffer, numEventsInWaitList, eventWaitList, event, blocking);
|
||||
auto blitAllowed = blitEnqueueAllowed(CL_COMMAND_READ_BUFFER);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER>(dispatchInfo, surfaces, EBuiltInOps::CopyBufferToBuffer, numEventsInWaitList, eventWaitList, event, blocking, blitAllowed);
|
||||
|
||||
if (event) {
|
||||
castToObjectOrAbort<Event>(*event)->setCmdType(CL_COMMAND_SVM_MAP);
|
||||
|
@ -210,8 +210,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMUnmap(void *svmPtr,
|
|||
dc.unifiedMemoryArgsRequireMemSync = externalAppCall;
|
||||
|
||||
MultiDispatchInfo dispatchInfo(dc);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER>(dispatchInfo, surfaces, EBuiltInOps::CopyBufferToBuffer, numEventsInWaitList, eventWaitList, event, false);
|
||||
auto blitAllowed = blitEnqueueAllowed(CL_COMMAND_READ_BUFFER);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER>(dispatchInfo, surfaces, EBuiltInOps::CopyBufferToBuffer, numEventsInWaitList, eventWaitList, event, false, blitAllowed);
|
||||
|
||||
if (event) {
|
||||
castToObjectOrAbort<Event>(*event)->setCmdType(CL_COMMAND_SVM_UNMAP);
|
||||
|
@ -331,8 +331,9 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMemcpy(cl_bool blockingCopy,
|
|||
GeneralSurface srcSvmSurf(srcSvmData->gpuAllocations.getGraphicsAllocation(rootDeviceIndex));
|
||||
HostPtrSurface dstHostPtrSurf(dstPtr, size);
|
||||
cmdType = CL_COMMAND_READ_BUFFER;
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
if (size != 0) {
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
bool status = csr.createAllocationForHostSurface(dstHostPtrSurf, true);
|
||||
if (!status) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
|
@ -345,15 +346,15 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMemcpy(cl_bool blockingCopy,
|
|||
surfaces[1] = &dstHostPtrSurf;
|
||||
|
||||
dispatchInfo.setBuiltinOpParams(operationParams);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER>(dispatchInfo, surfaces, builtInType, numEventsInWaitList, eventWaitList, event, blockingCopy);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER>(dispatchInfo, surfaces, builtInType, numEventsInWaitList, eventWaitList, event, blockingCopy, blitAllowed);
|
||||
|
||||
} else if (copyType == HostToSvm) {
|
||||
HostPtrSurface srcHostPtrSurf(const_cast<void *>(srcPtr), size);
|
||||
GeneralSurface dstSvmSurf(dstSvmData->gpuAllocations.getGraphicsAllocation(rootDeviceIndex));
|
||||
cmdType = CL_COMMAND_WRITE_BUFFER;
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
if (size != 0) {
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
bool status = csr.createAllocationForHostSurface(srcHostPtrSurf, false);
|
||||
if (!status) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
|
@ -366,8 +367,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMemcpy(cl_bool blockingCopy,
|
|||
surfaces[1] = &srcHostPtrSurf;
|
||||
|
||||
dispatchInfo.setBuiltinOpParams(operationParams);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER>(dispatchInfo, surfaces, builtInType, numEventsInWaitList, eventWaitList, event, blockingCopy);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER>(dispatchInfo, surfaces, builtInType, numEventsInWaitList, eventWaitList, event, blockingCopy, blitAllowed);
|
||||
|
||||
} else if (copyType == SvmToSvm) {
|
||||
GeneralSurface srcSvmSurf(srcSvmData->gpuAllocations.getGraphicsAllocation(rootDeviceIndex));
|
||||
|
@ -378,15 +378,16 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMemcpy(cl_bool blockingCopy,
|
|||
surfaces[1] = &dstSvmSurf;
|
||||
|
||||
dispatchInfo.setBuiltinOpParams(operationParams);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_SVM_MEMCPY>(dispatchInfo, surfaces, builtInType, numEventsInWaitList, eventWaitList, event, blockingCopy);
|
||||
auto blitAllowed = blitEnqueueAllowed(CL_COMMAND_SVM_MEMCPY);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_SVM_MEMCPY>(dispatchInfo, surfaces, builtInType, numEventsInWaitList, eventWaitList, event, blockingCopy, blitAllowed);
|
||||
|
||||
} else {
|
||||
HostPtrSurface srcHostPtrSurf(const_cast<void *>(srcPtr), size);
|
||||
HostPtrSurface dstHostPtrSurf(dstPtr, size);
|
||||
cmdType = CL_COMMAND_WRITE_BUFFER;
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
if (size != 0) {
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
bool status = csr.createAllocationForHostSurface(srcHostPtrSurf, false);
|
||||
status &= csr.createAllocationForHostSurface(dstHostPtrSurf, true);
|
||||
if (!status) {
|
||||
|
@ -400,8 +401,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMemcpy(cl_bool blockingCopy,
|
|||
surfaces[1] = &dstHostPtrSurf;
|
||||
|
||||
dispatchInfo.setBuiltinOpParams(operationParams);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER>(dispatchInfo, surfaces, builtInType, numEventsInWaitList, eventWaitList, event, blockingCopy);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER>(dispatchInfo, surfaces, builtInType, numEventsInWaitList, eventWaitList, event, blockingCopy, blitAllowed);
|
||||
}
|
||||
if (event) {
|
||||
auto pEvent = castToObjectOrAbort<Event>(*event);
|
||||
|
|
|
@ -80,6 +80,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
|
|||
MemObjSurface bufferSurf(buffer);
|
||||
GeneralSurface mapSurface;
|
||||
Surface *surfaces[] = {&bufferSurf, nullptr};
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
|
||||
if (mapAllocation) {
|
||||
surfaces[1] = &mapSurface;
|
||||
|
@ -90,7 +91,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
|
|||
} else {
|
||||
surfaces[1] = &hostPtrSurf;
|
||||
if (size != 0) {
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
bool status = csr.createAllocationForHostSurface(hostPtrSurf, false);
|
||||
if (!status) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
|
@ -110,8 +112,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
|
|||
dc.transferAllocation = mapAllocation ? mapAllocation : hostPtrSurf.getAllocation();
|
||||
|
||||
MultiDispatchInfo dispatchInfo(dc);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite, blitAllowed);
|
||||
|
||||
if (context->isProvidingPerformanceHints()) {
|
||||
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, CL_ENQUEUE_WRITE_BUFFER_REQUIRES_COPY_DATA, static_cast<cl_mem>(buffer));
|
||||
|
|
|
@ -58,11 +58,12 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBufferRect(
|
|||
MemObjSurface dstBufferSurf(buffer);
|
||||
HostPtrSurface hostPtrSurf(srcPtr, hostPtrSize, true);
|
||||
Surface *surfaces[] = {&dstBufferSurf, &hostPtrSurf};
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
|
||||
if (region[0] != 0 &&
|
||||
region[1] != 0 &&
|
||||
region[2] != 0) {
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
bool status = csr.createAllocationForHostSurface(hostPtrSurf, false);
|
||||
if (!status) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
|
@ -87,8 +88,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBufferRect(
|
|||
dc.dstSlicePitch = bufferSlicePitch;
|
||||
|
||||
MultiDispatchInfo dispatchInfo(dc);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite, blitAllowed);
|
||||
|
||||
if (context->isProvidingPerformanceHints()) {
|
||||
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, CL_ENQUEUE_WRITE_BUFFER_RECT_REQUIRES_COPY_DATA, static_cast<cl_mem>(buffer));
|
||||
|
|
|
@ -54,7 +54,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
|
|||
HostPtrSurface hostPtrSurf(srcPtr, hostPtrSize, true);
|
||||
GeneralSurface mapSurface;
|
||||
Surface *surfaces[] = {&dstImgSurf, nullptr};
|
||||
|
||||
auto blitAllowed = blitEnqueueAllowed(cmdType);
|
||||
if (mapAllocation) {
|
||||
surfaces[1] = &mapSurface;
|
||||
mapSurface.setGraphicsAllocation(mapAllocation);
|
||||
|
@ -66,7 +66,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
|
|||
if (region[0] != 0 &&
|
||||
region[1] != 0 &&
|
||||
region[2] != 0) {
|
||||
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
|
||||
auto &csr = getCommandStreamReceiver(blitAllowed);
|
||||
bool status = csr.createAllocationForHostSurface(hostPtrSurf, false);
|
||||
if (!status) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
|
@ -94,7 +94,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
|
|||
auto eBuiltInOps = EBuiltInOps::CopyBufferToImage3d;
|
||||
MultiDispatchInfo dispatchInfo(dc);
|
||||
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_IMAGE>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite == CL_TRUE);
|
||||
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_IMAGE>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite == CL_TRUE, blitAllowed);
|
||||
|
||||
if (context->isProvidingPerformanceHints()) {
|
||||
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, CL_ENQUEUE_WRITE_IMAGE_REQUIRES_COPY_DATA, static_cast<cl_mem>(dstImage));
|
||||
|
|
|
@ -224,7 +224,9 @@ TEST_P(CommandQueueWithBlitOperationsTests, givenDeviceNotSupportingBlitOperatio
|
|||
|
||||
auto defaultCsr = mockDevice->getDefaultEngine().commandStreamReceiver;
|
||||
EXPECT_EQ(defaultCsr, &cmdQ.getGpgpuCommandStreamReceiver());
|
||||
EXPECT_EQ(defaultCsr, &cmdQ.getCommandStreamReceiverByCommandType(cmdType));
|
||||
|
||||
auto blitAllowed = cmdQ.blitEnqueueAllowed(cmdType);
|
||||
EXPECT_EQ(defaultCsr, &cmdQ.getCommandStreamReceiver(blitAllowed));
|
||||
}
|
||||
|
||||
HWTEST_P(CommandQueueWithBlitOperationsTests, givenDeviceWithSubDevicesSupportingBlitOperationsWhenQueueIsCreatedThenBcsIsTakenFromFirstSubDevice) {
|
||||
|
@ -251,11 +253,12 @@ HWTEST_P(CommandQueueWithBlitOperationsTests, givenDeviceWithSubDevicesSupportin
|
|||
|
||||
MockCommandQueue cmdQ(nullptr, device.get(), 0);
|
||||
auto cmdType = GetParam();
|
||||
auto blitAllowed = cmdQ.blitEnqueueAllowed(cmdType);
|
||||
|
||||
EXPECT_NE(nullptr, cmdQ.getBcsCommandStreamReceiver());
|
||||
EXPECT_EQ(bcsEngine.commandStreamReceiver, cmdQ.getBcsCommandStreamReceiver());
|
||||
EXPECT_EQ(bcsEngine.commandStreamReceiver, &cmdQ.getCommandStreamReceiverByCommandType(cmdType));
|
||||
EXPECT_EQ(bcsEngine.osContext, &cmdQ.getCommandStreamReceiverByCommandType(cmdType).getOsContext());
|
||||
EXPECT_EQ(bcsEngine.commandStreamReceiver, &cmdQ.getCommandStreamReceiver(blitAllowed));
|
||||
EXPECT_EQ(bcsEngine.osContext, &cmdQ.getCommandStreamReceiver(blitAllowed).getOsContext());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(uint32_t,
|
||||
|
|
|
@ -354,7 +354,9 @@ HWTEST_F(EnqueueSvmMemCopyTest, givenCommandQueueWhenEnqueueSVMMemcpyIsCalledThe
|
|||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_TRUE(mockCmdQ->notifyEnqueueSVMMemcpyCalled);
|
||||
|
||||
auto &csr = mockCmdQ->getCommandStreamReceiverByCommandType(CL_COMMAND_SVM_MEMCPY);
|
||||
auto blitAllowed = mockCmdQ->blitEnqueueAllowed(CL_COMMAND_SVM_MEMCPY);
|
||||
|
||||
auto &csr = mockCmdQ->getCommandStreamReceiver(blitAllowed);
|
||||
EXPECT_EQ(EngineHelpers::isBcs(csr.getOsContext().getEngineType()), mockCmdQ->useBcsCsrOnNotifyEnabled);
|
||||
|
||||
alignedFree(dstHostPtr);
|
||||
|
|
|
@ -192,6 +192,7 @@ class MockCommandQueueHw : public CommandQueueHw<GfxFamily> {
|
|||
public:
|
||||
using BaseClass::bcsEngine;
|
||||
using BaseClass::bcsTaskCount;
|
||||
using BaseClass::blitEnqueueAllowed;
|
||||
using BaseClass::commandQueueProperties;
|
||||
using BaseClass::commandStream;
|
||||
using BaseClass::gpgpuEngine;
|
||||
|
|
Loading…
Reference in New Issue