Add isCopyOnly field

Change-Id: Ia056af66af437c22738fd15abff12e1ad226509a
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
Related-To: NEO-5120
This commit is contained in:
Maciej Dziuban
2020-09-25 16:42:45 +02:00
committed by sys_ocldev
parent f838f667b1
commit 83252e7306
5 changed files with 19 additions and 1 deletions

View File

@ -637,7 +637,7 @@ bool CommandQueue::queueDependenciesClearRequired() const {
}
bool CommandQueue::blitEnqueueAllowed(cl_command_type cmdType) const {
bool blitAllowed = device->getHardwareInfo().capabilityTable.blitterOperationsSupported;
bool blitAllowed = device->getHardwareInfo().capabilityTable.blitterOperationsSupported || this->isCopyOnly;
if (DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get() != -1) {
blitAllowed &= !!DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get();

View File

@ -358,6 +358,8 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
bool perfCountersEnabled = false;
bool isCopyOnly = false;
LinearStream *commandStream = nullptr;
bool isSpecialCommandQueue = false;

View File

@ -1137,3 +1137,16 @@ TEST(CommandQueue, givenBlitterOperationsSupportedWhenCreatingQueueThenTimestamp
MockCommandQueue cmdQ(&context, context.getDevice(0), 0);
EXPECT_NE(nullptr, cmdQ.timestampPacketContainer);
}
TEST(CommandQueue, givenCopyOnlyQueueWhenCallingBlitEnqueueAllowedThenReturnTrue) {
MockContext context{};
HardwareInfo *hwInfo = context.getDevice(0)->getRootDeviceEnvironment().getMutableHardwareInfo();
MockCommandQueue queue(&context, context.getDevice(0), 0);
hwInfo->capabilityTable.blitterOperationsSupported = false;
queue.isCopyOnly = false;
EXPECT_FALSE(queue.blitEnqueueAllowed(CL_COMMAND_READ_BUFFER));
queue.isCopyOnly = true;
EXPECT_TRUE(queue.blitEnqueueAllowed(CL_COMMAND_READ_BUFFER));
}

View File

@ -18,9 +18,11 @@
namespace NEO {
class MockCommandQueue : public CommandQueue {
public:
using CommandQueue::blitEnqueueAllowed;
using CommandQueue::bufferCpuCopyAllowed;
using CommandQueue::device;
using CommandQueue::gpgpuEngine;
using CommandQueue::isCopyOnly;
using CommandQueue::obtainNewTimestampPacketNodes;
using CommandQueue::requiresCacheFlushAfterWalker;
using CommandQueue::throttle;

View File

@ -41,6 +41,7 @@ class MockDevice : public RootDevice {
using Device::createDeviceInternals;
using Device::createEngine;
using Device::deviceInfo;
using Device::engineGroups;
using Device::engines;
using Device::executionEnvironment;
using Device::getGlobalMemorySize;