Code cleanup - avoid copy 5/n

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2021-09-07 21:21:19 +00:00
committed by Compute-Runtime-Automation
parent ae88789bce
commit a924b6a304
22 changed files with 81 additions and 80 deletions

View File

@@ -179,10 +179,10 @@ struct CommandListCoreFamily : CommandListImp {
size_t srcOffset,
size_t dstOffset,
ze_copy_region_t srcRegion,
ze_copy_region_t dstRegion, Vec3<size_t> copySize,
ze_copy_region_t dstRegion, const Vec3<size_t> &copySize,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents);
MOCKABLE_VIRTUAL ze_result_t appendMemoryCopyKernel2d(AlignedAllocationData *dstAlignedAllocation, AlignedAllocationData *srcAlignedAllocation,
@@ -208,11 +208,11 @@ struct CommandListCoreFamily : CommandListImp {
MOCKABLE_VIRTUAL ze_result_t appendCopyImageBlit(NEO::GraphicsAllocation *src,
NEO::GraphicsAllocation *dst,
Vec3<size_t> srcOffsets, Vec3<size_t> dstOffsets,
const Vec3<size_t> &srcOffsets, const Vec3<size_t> &dstOffsets,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
size_t bytesPerPixel, Vec3<size_t> copySize,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent);
size_t bytesPerPixel, const Vec3<size_t> &copySize,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent);
MOCKABLE_VIRTUAL ze_result_t appendLaunchKernelWithParams(ze_kernel_handle_t hKernel,
const ze_group_count_t *pThreadGroupDimensions,

View File

@@ -883,10 +883,10 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyBlitRegion(NEO
size_t srcOffset,
size_t dstOffset,
ze_copy_region_t srcRegion,
ze_copy_region_t dstRegion, Vec3<size_t> copySize,
ze_copy_region_t dstRegion, const Vec3<size_t> &copySize,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) {
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
@@ -896,12 +896,13 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyBlitRegion(NEO
bool copyOneCommand = NEO::BlitCommandsHelper<GfxFamily>::useOneBlitCopyCommand(copySize, bytesPerPixel);
Vec3<size_t> srcPtrOffset = {(copyOneCommand ? (srcRegion.originX / bytesPerPixel) : srcRegion.originX), srcRegion.originY, srcRegion.originZ};
Vec3<size_t> dstPtrOffset = {(copyOneCommand ? (dstRegion.originX / bytesPerPixel) : dstRegion.originX), dstRegion.originY, dstRegion.originZ};
copySize.x = copyOneCommand ? copySize.x / bytesPerPixel : copySize.x;
auto copySizeModified = copySize;
copySizeModified.x = copyOneCommand ? copySizeModified.x / bytesPerPixel : copySizeModified.x;
auto clearColorAllocation = device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getClearColorAllocation();
auto blitProperties = NEO::BlitProperties::constructPropertiesForCopy(dstAlloc, srcAlloc,
dstPtrOffset, srcPtrOffset, copySize, srcRowPitch, srcSlicePitch,
dstPtrOffset, srcPtrOffset, copySizeModified, srcRowPitch, srcSlicePitch,
dstRowPitch, dstSlicePitch, clearColorAllocation);
commandContainer.addToResidencyContainer(dstAlloc);
commandContainer.addToResidencyContainer(srcAlloc);
@@ -928,11 +929,11 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyBlitRegion(NEO
template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendCopyImageBlit(NEO::GraphicsAllocation *src,
NEO::GraphicsAllocation *dst,
Vec3<size_t> srcOffsets, Vec3<size_t> dstOffsets,
const Vec3<size_t> &srcOffsets, const Vec3<size_t> &dstOffsets,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
size_t bytesPerPixel, Vec3<size_t> copySize,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent) {
size_t bytesPerPixel, const Vec3<size_t> &copySize,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent) {
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
auto clearColorAllocation = device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getClearColorAllocation();

View File

@@ -57,10 +57,10 @@ class MockCommandListHw : public WhiteBox<::L0::CommandListCoreFamily<gfxCoreFam
size_t srcOffset,
size_t dstOffset,
ze_copy_region_t srcRegion,
ze_copy_region_t dstRegion, Vec3<size_t> copySize,
ze_copy_region_t dstRegion, const Vec3<size_t> &copySize,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override {
appendMemoryCopyBlitRegionCalledTimes++;
return ZE_RESULT_SUCCESS;
@@ -95,11 +95,11 @@ class MockCommandListHw : public WhiteBox<::L0::CommandListCoreFamily<gfxCoreFam
}
ze_result_t appendCopyImageBlit(NEO::GraphicsAllocation *src,
NEO::GraphicsAllocation *dst,
Vec3<size_t> srcOffsets, Vec3<size_t> dstOffsets,
const Vec3<size_t> &srcOffsets, const Vec3<size_t> &dstOffsets,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
size_t bytesPerPixel, Vec3<size_t> copySize,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent) override {
size_t bytesPerPixel, const Vec3<size_t> &copySize,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent) override {
appendCopyImageBlitCalledTimes++;
appendImageRegionCopySize = copySize;
appendImageRegionSrcOrigin = srcOffsets;
@@ -901,10 +901,10 @@ class MockCommandListForRegionSize : public WhiteBox<::L0::CommandListCoreFamily
size_t srcOffset,
size_t dstOffset,
ze_copy_region_t srcRegion,
ze_copy_region_t dstRegion, Vec3<size_t> copySize,
ze_copy_region_t dstRegion, const Vec3<size_t> &copySize,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override {
this->srcSize = srcSize;
this->dstSize = dstSize;

View File

@@ -56,10 +56,10 @@ class MockCommandListHw : public WhiteBox<::L0::CommandListCoreFamily<gfxCoreFam
size_t srcOffset,
size_t dstOffset,
ze_copy_region_t srcRegion,
ze_copy_region_t dstRegion, Vec3<size_t> copySize,
ze_copy_region_t dstRegion, const Vec3<size_t> &copySize,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override {
appendMemoryCopyBlitRegionCalledTimes++;
return ZE_RESULT_SUCCESS;
@@ -94,11 +94,11 @@ class MockCommandListHw : public WhiteBox<::L0::CommandListCoreFamily<gfxCoreFam
}
ze_result_t appendCopyImageBlit(NEO::GraphicsAllocation *src,
NEO::GraphicsAllocation *dst,
Vec3<size_t> srcOffsets, Vec3<size_t> dstOffsets,
const Vec3<size_t> &srcOffsets, const Vec3<size_t> &dstOffsets,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
size_t bytesPerPixel, Vec3<size_t> copySize,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent) override {
size_t bytesPerPixel, const Vec3<size_t> &copySize,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent) override {
appendCopyImageBlitCalledTimes++;
appendImageRegionCopySize = copySize;
appendImageRegionSrcOrigin = srcOffsets;
@@ -156,10 +156,10 @@ class MockAppendMemoryCopy : public MockCommandListHw<gfxCoreFamily> {
size_t srcOffset,
size_t dstOffset,
ze_copy_region_t srcRegion,
ze_copy_region_t dstRegion, Vec3<size_t> copySize,
ze_copy_region_t dstRegion, const Vec3<size_t> &copySize,
size_t srcRowPitch, size_t srcSlicePitch,
size_t dstRowPitch, size_t dstSlicePitch,
Vec3<size_t> srcSize, Vec3<size_t> dstSize, ze_event_handle_t hSignalEvent,
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override {
srcBlitCopyRegionOffset = srcOffset;
dstBlitCopyRegionOffset = dstOffset;