Skip to content

Commit 8e44038

Browse files
Revert "Add blitter support for read/write image OpenCL"
This reverts commit cc6d696. Change-Id: I2696f05c5d1e3959f60239ca49483b00ad1b36ec Signed-off-by: Kamil Kopryk <[email protected]>
1 parent 3e762b2 commit 8e44038

File tree

16 files changed

+346
-525
lines changed

16 files changed

+346
-525
lines changed

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,6 @@ using BlitBlockCopyPlatforms = IsWithinProducts<IGFX_SKYLAKE, IGFX_TIGERLAKE_LP>
804804
HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSizeThenOneBlitCommandHasBeenSpown, BlitBlockCopyPlatforms) {
805805
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
806806
using XY_COPY_BLT = typename GfxFamily::XY_COPY_BLT;
807-
using MI_ARB_CHECK = typename GfxFamily::MI_ARB_CHECK;
808807

809808
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
810809
commandList->initialize(device, NEO::EngineGroupType::Copy);
@@ -830,8 +829,6 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSize
830829
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
831830
auto itor = find<XY_COPY_BLT *>(cmdList.begin(), cmdList.end());
832831
EXPECT_NE(cmdList.end(), itor);
833-
itor = find<MI_ARB_CHECK *>(cmdList.begin(), cmdList.end());
834-
EXPECT_NE(cmdList.end(), itor);
835832
itor++;
836833
EXPECT_EQ(cmdList.end(), itor);
837834
}

opencl/source/command_queue/command_queue.cpp

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -637,27 +637,18 @@ bool CommandQueue::queueDependenciesClearRequired() const {
637637
}
638638

639639
bool CommandQueue::blitEnqueueAllowed(cl_command_type cmdType) const {
640+
bool blitAllowed = device->getHardwareInfo().capabilityTable.blitterOperationsSupported || this->isCopyOnly;
640641

641-
auto blitAllowed = device->getHardwareInfo().capabilityTable.blitterOperationsSupported || this->isCopyOnly;
642642
if (DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get() != -1) {
643-
644-
blitAllowed &= static_cast<bool>(DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get());
645-
}
646-
647-
switch (cmdType) {
648-
case CL_COMMAND_READ_BUFFER:
649-
case CL_COMMAND_WRITE_BUFFER:
650-
case CL_COMMAND_COPY_BUFFER:
651-
case CL_COMMAND_READ_BUFFER_RECT:
652-
case CL_COMMAND_WRITE_BUFFER_RECT:
653-
case CL_COMMAND_COPY_BUFFER_RECT:
654-
case CL_COMMAND_SVM_MEMCPY:
655-
case CL_COMMAND_READ_IMAGE:
656-
case CL_COMMAND_WRITE_IMAGE:
657-
return blitAllowed;
658-
default:
659-
return false;
643+
blitAllowed &= !!DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get();
660644
}
645+
646+
bool commandAllowed = (CL_COMMAND_READ_BUFFER == cmdType) || (CL_COMMAND_WRITE_BUFFER == cmdType) ||
647+
(CL_COMMAND_COPY_BUFFER == cmdType) || (CL_COMMAND_READ_BUFFER_RECT == cmdType) ||
648+
(CL_COMMAND_WRITE_BUFFER_RECT == cmdType) || (CL_COMMAND_COPY_BUFFER_RECT == cmdType) ||
649+
(CL_COMMAND_SVM_MEMCPY == cmdType);
650+
651+
return commandAllowed && blitAllowed;
661652
}
662653

663654
bool CommandQueue::isBlockedCommandStreamRequired(uint32_t commandType, const EventsRequest &eventsRequest, bool blockedQueue) const {

opencl/source/command_queue/enqueue_read_image.h

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,27 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadImage(
4141
const cl_event *eventWaitList,
4242
cl_event *event) {
4343

44-
auto cmdType = CL_COMMAND_READ_IMAGE;
45-
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
44+
auto &csr = getGpgpuCommandStreamReceiver();
4645
if (nullptr == mapAllocation) {
47-
notifyEnqueueReadImage(srcImage, static_cast<bool>(blockingRead), EngineHelpers::isBcs(csr.getOsContext().getEngineType()));
46+
notifyEnqueueReadImage(srcImage, !!blockingRead, EngineHelpers::isBcs(csr.getOsContext().getEngineType()));
4847
}
4948

5049
auto isMemTransferNeeded = true;
5150
if (srcImage->isMemObjZeroCopy()) {
5251
size_t hostOffset;
5352
Image::calculateHostPtrOffset(&hostOffset, origin, region, inputRowPitch, inputSlicePitch, srcImage->getImageDesc().image_type, srcImage->getSurfaceFormatInfo().surfaceFormat.ImageElementSizeInBytes);
54-
isMemTransferNeeded = srcImage->checkIfMemoryTransferIsRequired(hostOffset, 0, ptr, cmdType);
53+
isMemTransferNeeded = srcImage->checkIfMemoryTransferIsRequired(hostOffset, 0, ptr, CL_COMMAND_READ_IMAGE);
5554
}
5655
if (!isMemTransferNeeded) {
57-
return enqueueMarkerForReadWriteOperation(srcImage, ptr, cmdType, blockingRead,
56+
return enqueueMarkerForReadWriteOperation(srcImage, ptr, CL_COMMAND_READ_IMAGE, blockingRead,
5857
numEventsInWaitList, eventWaitList, event);
5958
}
6059

60+
auto &builder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder(EBuiltInOps::CopyImage3dToBuffer,
61+
this->getDevice());
62+
63+
BuiltInOwnershipWrapper builtInLock(builder, this->context);
64+
6165
size_t hostPtrSize = calculateHostPtrSizeForImage(region, inputRowPitch, inputSlicePitch, srcImage);
6266
void *dstPtr = ptr;
6367

@@ -99,12 +103,18 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadImage(
99103
if (srcImage->getImageDesc().num_mip_levels > 0) {
100104
dc.srcMipLevel = findMipLevel(srcImage->getImageDesc().image_type, origin);
101105
}
102-
dc.transferAllocation = mapAllocation ? mapAllocation : hostPtrSurf.getAllocation();
103106

104-
auto eBuiltInOps = EBuiltInOps::CopyImage3dToBuffer;
105-
MultiDispatchInfo dispatchInfo(dc);
107+
MultiDispatchInfo di(dc);
108+
109+
builder.buildDispatchInfos(di);
106110

107-
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_IMAGE>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead == CL_TRUE);
111+
enqueueHandler<CL_COMMAND_READ_IMAGE>(
112+
surfaces,
113+
blockingRead == CL_TRUE,
114+
di,
115+
numEventsInWaitList,
116+
eventWaitList,
117+
event);
108118

109119
if (context->isProvidingPerformanceHints()) {
110120
if (!isL3Capable(ptr, hostPtrSize)) {

opencl/source/command_queue/enqueue_write_image.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,20 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
3535
const cl_event *eventWaitList,
3636
cl_event *event) {
3737

38-
auto cmdType = CL_COMMAND_WRITE_IMAGE;
3938
auto isMemTransferNeeded = true;
4039
if (dstImage->isMemObjZeroCopy()) {
4140
size_t hostOffset;
4241
Image::calculateHostPtrOffset(&hostOffset, origin, region, inputRowPitch, inputSlicePitch, dstImage->getImageDesc().image_type, dstImage->getSurfaceFormatInfo().surfaceFormat.ImageElementSizeInBytes);
43-
isMemTransferNeeded = dstImage->checkIfMemoryTransferIsRequired(hostOffset, 0, ptr, cmdType);
42+
isMemTransferNeeded = dstImage->checkIfMemoryTransferIsRequired(hostOffset, 0, ptr, CL_COMMAND_WRITE_IMAGE);
4443
}
4544
if (!isMemTransferNeeded) {
46-
return enqueueMarkerForReadWriteOperation(dstImage, const_cast<void *>(ptr), cmdType, blockingWrite,
45+
return enqueueMarkerForReadWriteOperation(dstImage, const_cast<void *>(ptr), CL_COMMAND_WRITE_IMAGE, blockingWrite,
4746
numEventsInWaitList, eventWaitList, event);
4847
}
48+
auto &builder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder(EBuiltInOps::CopyBufferToImage3d,
49+
this->getDevice());
50+
51+
BuiltInOwnershipWrapper lock(builder, this->context);
4952

5053
size_t hostPtrSize = calculateHostPtrSizeForImage(region, inputRowPitch, inputSlicePitch, dstImage);
5154
void *srcPtr = const_cast<void *>(ptr);
@@ -66,8 +69,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
6669
if (region[0] != 0 &&
6770
region[1] != 0 &&
6871
region[2] != 0) {
69-
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
70-
bool status = csr.createAllocationForHostSurface(hostPtrSurf, false);
72+
bool status = getGpgpuCommandStreamReceiver().createAllocationForHostSurface(hostPtrSurf, false);
7173
if (!status) {
7274
return CL_OUT_OF_RESOURCES;
7375
}
@@ -89,12 +91,17 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
8991
if (dstImage->getImageDesc().num_mip_levels > 0) {
9092
dc.dstMipLevel = findMipLevel(dstImage->getImageDesc().image_type, origin);
9193
}
92-
dc.transferAllocation = mapAllocation ? mapAllocation : hostPtrSurf.getAllocation();
9394

94-
auto eBuiltInOps = EBuiltInOps::CopyBufferToImage3d;
95-
MultiDispatchInfo dispatchInfo(dc);
95+
MultiDispatchInfo di(dc);
96+
builder.buildDispatchInfos(di);
9697

97-
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_IMAGE>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite == CL_TRUE);
98+
enqueueHandler<CL_COMMAND_WRITE_IMAGE>(
99+
surfaces,
100+
blockingWrite == CL_TRUE,
101+
di,
102+
numEventsInWaitList,
103+
eventWaitList,
104+
event);
98105

99106
if (context->isProvidingPerformanceHints()) {
100107
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, CL_ENQUEUE_WRITE_IMAGE_REQUIRES_COPY_DATA, static_cast<cl_mem>(dstImage));

opencl/source/helpers/cl_blit_properties.h

Lines changed: 16 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "shared/source/helpers/blit_commands_helper.h"
1010

1111
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
12-
#include "opencl/source/mem_obj/image.h"
1312

1413
#include "CL/cl.h"
1514

@@ -48,7 +47,6 @@ struct ClBlitProperties {
4847
builtinOpParams.dstRowPitch, builtinOpParams.dstSlicePitch);
4948
}
5049

51-
BlitProperties blitProperties{};
5250
GraphicsAllocation *gpuAllocation = nullptr;
5351
Vec3<size_t> copyOffset = 0;
5452

@@ -66,9 +64,8 @@ struct ClBlitProperties {
6664
size_t gpuRowPitch = 0;
6765
size_t gpuSlicePitch = 0;
6866

69-
if (BlitterConstants::BlitDirection::HostPtrToBuffer == blitDirection ||
70-
BlitterConstants::BlitDirection::HostPtrToImage == blitDirection) {
71-
// write buffer/image
67+
if (BlitterConstants::BlitDirection::HostPtrToBuffer == blitDirection) {
68+
// write buffer
7269
hostPtr = builtinOpParams.srcPtr;
7370
hostPtrOffset = builtinOpParams.srcOffset;
7471
copyOffset = builtinOpParams.dstOffset;
@@ -91,10 +88,10 @@ struct ClBlitProperties {
9188
copySize = builtinOpParams.size;
9289
}
9390

94-
if (BlitterConstants::BlitDirection::BufferToHostPtr == blitDirection ||
95-
BlitterConstants::BlitDirection::ImageToHostPtr == blitDirection) {
96-
// read buffer/image
91+
if (BlitterConstants::BlitDirection::BufferToHostPtr == blitDirection) {
92+
// read buffer
9793
hostPtr = builtinOpParams.dstPtr;
94+
9895
hostPtrOffset = builtinOpParams.dstOffset;
9996
copyOffset = builtinOpParams.srcOffset;
10097

@@ -117,78 +114,26 @@ struct ClBlitProperties {
117114
}
118115

119116
UNRECOVERABLE_IF(BlitterConstants::BlitDirection::HostPtrToBuffer != blitDirection &&
120-
BlitterConstants::BlitDirection::BufferToHostPtr != blitDirection &&
121-
BlitterConstants::BlitDirection::HostPtrToImage != blitDirection &&
122-
BlitterConstants::BlitDirection::ImageToHostPtr != blitDirection);
123-
124-
blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(blitDirection, commandStreamReceiver, gpuAllocation,
125-
hostAllocation, hostPtr, memObjGpuVa, hostAllocGpuVa,
126-
hostPtrOffset, copyOffset, copySize,
127-
hostRowPitch, hostSlicePitch,
128-
gpuRowPitch, gpuSlicePitch);
129-
130-
if (BlitterConstants::BlitDirection::HostPtrToImage == blitDirection ||
131-
BlitterConstants::BlitDirection::ImageToHostPtr == blitDirection) {
132-
adjustBlitPropertiesForImage(blitProperties, builtinOpParams);
133-
}
117+
BlitterConstants::BlitDirection::BufferToHostPtr != blitDirection);
134118

135-
return blitProperties;
119+
return BlitProperties::constructPropertiesForReadWriteBuffer(blitDirection, commandStreamReceiver, gpuAllocation,
120+
hostAllocation, hostPtr, memObjGpuVa, hostAllocGpuVa,
121+
hostPtrOffset, copyOffset, copySize,
122+
hostRowPitch, hostSlicePitch,
123+
gpuRowPitch, gpuSlicePitch);
136124
}
137125

138126
static BlitterConstants::BlitDirection obtainBlitDirection(uint32_t commandType) {
139-
140-
switch (commandType) {
141-
case CL_COMMAND_WRITE_BUFFER:
142-
case CL_COMMAND_WRITE_BUFFER_RECT:
127+
if (CL_COMMAND_WRITE_BUFFER == commandType || CL_COMMAND_WRITE_BUFFER_RECT == commandType) {
143128
return BlitterConstants::BlitDirection::HostPtrToBuffer;
144-
case CL_COMMAND_READ_BUFFER:
145-
case CL_COMMAND_READ_BUFFER_RECT:
129+
} else if (CL_COMMAND_READ_BUFFER == commandType || CL_COMMAND_READ_BUFFER_RECT == commandType) {
146130
return BlitterConstants::BlitDirection::BufferToHostPtr;
147-
case CL_COMMAND_COPY_BUFFER:
148-
case CL_COMMAND_COPY_BUFFER_RECT:
149-
case CL_COMMAND_SVM_MEMCPY:
131+
} else if (CL_COMMAND_COPY_BUFFER_RECT == commandType || CL_COMMAND_SVM_MEMCPY == commandType) {
150132
return BlitterConstants::BlitDirection::BufferToBuffer;
151-
case CL_COMMAND_WRITE_IMAGE:
152-
return BlitterConstants::BlitDirection::HostPtrToImage;
153-
case CL_COMMAND_READ_IMAGE:
154-
return BlitterConstants::BlitDirection::ImageToHostPtr;
155-
default:
156-
UNRECOVERABLE_IF(true);
157-
}
158-
}
159-
160-
static void adjustBlitPropertiesForImage(BlitProperties &blitProperties, const BuiltinOpParams &builtinOpParams) {
161-
162-
Image *srcImage = nullptr;
163-
Image *dstImage = nullptr;
164-
165-
blitProperties.srcSize = {static_cast<uint32_t>(builtinOpParams.size.x),
166-
static_cast<uint32_t>(builtinOpParams.size.y),
167-
static_cast<uint32_t>(builtinOpParams.size.z)};
168-
169-
blitProperties.dstSize = {static_cast<uint32_t>(builtinOpParams.size.x),
170-
static_cast<uint32_t>(builtinOpParams.size.y),
171-
static_cast<uint32_t>(builtinOpParams.size.z)};
172-
173-
if (blitProperties.blitDirection == BlitterConstants::BlitDirection::ImageToHostPtr) {
174-
srcImage = castToObject<Image>(builtinOpParams.srcMemObj);
175-
blitProperties.bytesPerPixel = srcImage->getSurfaceFormatInfo().surfaceFormat.ImageElementSizeInBytes;
176-
blitProperties.srcSize.x = static_cast<uint32_t>(srcImage->getImageDesc().image_width);
177-
blitProperties.srcSize.y = static_cast<uint32_t>(srcImage->getImageDesc().image_height);
178-
blitProperties.srcSize.z = static_cast<uint32_t>(srcImage->getImageDesc().image_depth);
179-
180133
} else {
181-
dstImage = castToObject<Image>(builtinOpParams.dstMemObj);
182-
blitProperties.bytesPerPixel = dstImage->getSurfaceFormatInfo().surfaceFormat.ImageElementSizeInBytes;
183-
blitProperties.dstSize.x = static_cast<uint32_t>(dstImage->getImageDesc().image_width);
184-
blitProperties.dstSize.y = static_cast<uint32_t>(dstImage->getImageDesc().image_height);
185-
blitProperties.dstSize.z = static_cast<uint32_t>(dstImage->getImageDesc().image_depth);
134+
UNRECOVERABLE_IF(CL_COMMAND_COPY_BUFFER != commandType);
135+
return BlitterConstants::BlitDirection::BufferToBuffer;
186136
}
187-
188-
blitProperties.srcRowPitch = builtinOpParams.dstRowPitch ? builtinOpParams.dstRowPitch : blitProperties.srcSize.x * blitProperties.bytesPerPixel;
189-
blitProperties.dstRowPitch = builtinOpParams.srcRowPitch ? builtinOpParams.srcRowPitch : blitProperties.dstSize.x * blitProperties.bytesPerPixel;
190-
blitProperties.srcSlicePitch = builtinOpParams.dstSlicePitch ? builtinOpParams.dstSlicePitch : blitProperties.srcSize.y * blitProperties.srcRowPitch;
191-
blitProperties.dstSlicePitch = builtinOpParams.srcSlicePitch ? builtinOpParams.srcSlicePitch : blitProperties.dstSize.y * blitProperties.dstRowPitch;
192137
}
193138
};
194139

opencl/test/unit_test/command_queue/command_queue_tests.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,21 +1150,3 @@ TEST(CommandQueue, givenCopyOnlyQueueWhenCallingBlitEnqueueAllowedThenReturnTrue
11501150
queue.isCopyOnly = true;
11511151
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_READ_BUFFER));
11521152
}
1153-
1154-
TEST(CommandQueue, giveClCommandWhenCallingBlitEnqueueAllowedThenReturnCorrectValue) {
1155-
MockContext context{};
1156-
HardwareInfo *hwInfo = context.getDevice(0)->getRootDeviceEnvironment().getMutableHardwareInfo();
1157-
MockCommandQueue queue(&context, context.getDevice(0), 0);
1158-
hwInfo->capabilityTable.blitterOperationsSupported = true;
1159-
1160-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_READ_BUFFER));
1161-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_WRITE_BUFFER));
1162-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_COPY_BUFFER));
1163-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_READ_BUFFER_RECT));
1164-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_WRITE_BUFFER_RECT));
1165-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_COPY_BUFFER_RECT));
1166-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_SVM_MEMCPY));
1167-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_READ_IMAGE));
1168-
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_WRITE_IMAGE));
1169-
EXPECT_FALSE(queue.blitEnqueueAllowed(CL_COMMAND_COPY_IMAGE));
1170-
}

opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "shared/test/unit_test/utilities/base_object_utils.h"
1111

1212
#include "opencl/source/event/user_event.h"
13-
#include "opencl/source/helpers/cl_blit_properties.h"
1413
#include "opencl/test/unit_test/command_stream/command_stream_receiver_hw_fixture.h"
1514
#include "opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h"
1615
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
@@ -772,33 +771,6 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC
772771
EXPECT_NE(nullptr, genCmdCast<typename FamilyType::MI_NOOP *>(*(cmdIterator++)));
773772
}
774773
}
775-
HWTEST_F(BcsTests, givenCommandTypeWhenObtainBlitDirectionIsCalledThenReturnCorrectBlitDirection) {
776-
777-
std::array<std::pair<uint32_t, BlitterConstants::BlitDirection>, 9> testParams{
778-
std::make_pair(CL_COMMAND_WRITE_BUFFER, BlitterConstants::BlitDirection::HostPtrToBuffer),
779-
std::make_pair(CL_COMMAND_WRITE_BUFFER_RECT, BlitterConstants::BlitDirection::HostPtrToBuffer),
780-
std::make_pair(CL_COMMAND_READ_BUFFER, BlitterConstants::BlitDirection::BufferToHostPtr),
781-
std::make_pair(CL_COMMAND_READ_BUFFER_RECT, BlitterConstants::BlitDirection::BufferToHostPtr),
782-
std::make_pair(CL_COMMAND_COPY_BUFFER_RECT, BlitterConstants::BlitDirection::BufferToBuffer),
783-
std::make_pair(CL_COMMAND_SVM_MEMCPY, BlitterConstants::BlitDirection::BufferToBuffer),
784-
std::make_pair(CL_COMMAND_WRITE_IMAGE, BlitterConstants::BlitDirection::HostPtrToImage),
785-
std::make_pair(CL_COMMAND_READ_IMAGE, BlitterConstants::BlitDirection::ImageToHostPtr),
786-
std::make_pair(CL_COMMAND_COPY_BUFFER, BlitterConstants::BlitDirection::BufferToBuffer)};
787-
788-
for (const auto &params : testParams) {
789-
uint32_t commandType;
790-
BlitterConstants::BlitDirection expectedBlitDirection;
791-
std::tie(commandType, expectedBlitDirection) = params;
792-
793-
auto blitDirection = ClBlitProperties::obtainBlitDirection(commandType);
794-
EXPECT_EQ(expectedBlitDirection, blitDirection);
795-
}
796-
}
797-
798-
HWTEST_F(BcsTests, givenWrongCommandTypeWhenObtainBlitDirectionIsCalledThenExpectThrow) {
799-
uint32_t wrongCommandType = CL_COMMAND_COPY_IMAGE;
800-
EXPECT_THROW(ClBlitProperties::obtainBlitDirection(wrongCommandType), std::exception);
801-
}
802774

803775
struct BcsTestParam {
804776
Vec3<size_t> copySize;

0 commit comments

Comments
 (0)