Files
compute-runtime/runtime/helpers/blit_commands_helper.cpp
Dunajski, Bartosz 56e77ca452 Add BlitProperties to simplify properties passing
Change-Id: I4abf99d420487a237e5b465b9d4d121121f45a84
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
Related-To: NEO-3020
2019-06-27 16:31:40 +02:00

32 lines
997 B
C++

/*
* Copyright (C) 2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/helpers/blit_commands_helper.h"
#include "runtime/helpers/timestamp_packet.h"
#include "CL/cl.h"
namespace NEO {
BlitProperties BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitWithHostPtrDirection copyDirection, Buffer *buffer, void *hostPtr, bool blocking, size_t offset, uint64_t copySize) {
if (BlitterConstants::BlitWithHostPtrDirection::FromHostPtr == copyDirection) {
return {nullptr, copyDirection, {}, buffer, nullptr, hostPtr, blocking, offset, 0, copySize};
} else {
return {nullptr, copyDirection, {}, nullptr, buffer, hostPtr, blocking, 0, offset, copySize};
}
}
void BlitProperties::setHostPtrBuffer(Buffer *hostPtrBuffer) {
if (BlitterConstants::BlitWithHostPtrDirection::FromHostPtr == copyDirection) {
srcBuffer = hostPtrBuffer;
} else {
dstBuffer = hostPtrBuffer;
}
}
} // namespace NEO