Add support for stateless copy buffer rect

Change-Id: I9781b0d8bd863d8d5087dac6aa6a076005187afb
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-3314
This commit is contained in:
Kamil Kopryk
2019-10-16 12:46:34 +02:00
committed by sys_ocldev
parent 74a5e50339
commit 60237e1f80
11 changed files with 247 additions and 40 deletions

View File

@@ -6,6 +6,7 @@
*/
#pragma once
#include "runtime/command_queue/command_queue_hw.h"
#include "unit_tests/command_queue/command_queue_fixture.h"
#include "unit_tests/command_stream/command_stream_fixture.h"
#include "unit_tests/fixtures/buffer_fixture.h"
@@ -92,4 +93,39 @@ struct NegativeFailAllocationCommandEnqueueBaseFixture : public CommandEnqueueBa
MemoryManager *oldMemManager;
};
template <typename FamilyType>
struct CommandQueueStateless : public CommandQueueHw<FamilyType> {
CommandQueueStateless(Context *context, Device *device) : CommandQueueHw<FamilyType>(context, device, nullptr){};
bool forceStateless(size_t size) override {
return true;
}
void enqueueHandlerHook(const unsigned int commandType, const MultiDispatchInfo &dispatchInfo) override {
auto kernel = dispatchInfo.begin()->getKernel();
EXPECT_TRUE(kernel->getKernelInfo().patchInfo.executionEnvironment->CompiledForGreaterThan4GBBuffers);
EXPECT_FALSE(kernel->getKernelInfo().kernelArgInfo[0].pureStatefulBufferAccess);
}
};
template <typename FamilyType>
struct CommandQueueStateful : public CommandQueueHw<FamilyType> {
CommandQueueStateful(Context *context, Device *device) : CommandQueueHw<FamilyType>(context, device, nullptr){};
bool forceStateless(size_t size) override {
return false;
}
void enqueueHandlerHook(const unsigned int commandType, const MultiDispatchInfo &dispatchInfo) override {
auto kernel = dispatchInfo.begin()->getKernel();
if (!kernel->getDevice().areSharedSystemAllocationsAllowed()) {
EXPECT_FALSE(kernel->getKernelInfo().patchInfo.executionEnvironment->CompiledForGreaterThan4GBBuffers);
EXPECT_TRUE(kernel->getKernelInfo().kernelArgInfo[0].pureStatefulBufferAccess);
} else {
EXPECT_TRUE(kernel->getKernelInfo().patchInfo.executionEnvironment->CompiledForGreaterThan4GBBuffers);
EXPECT_FALSE(kernel->getKernelInfo().kernelArgInfo[0].pureStatefulBufferAccess);
}
}
};
} // namespace NEO