Pass blitter CSR to event

Related-To: NEO-6057
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2021-08-26 16:38:39 +00:00
committed by Compute-Runtime-Automation
parent 8355cf4ecf
commit c7d86af500
13 changed files with 135 additions and 17 deletions

View File

@ -12,6 +12,7 @@
#include "shared/source/utilities/tag_allocator.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/mocks/mock_device.h"
#include "shared/test/common/test_macros/test_checks_shared.h"
#include "opencl/source/command_queue/command_queue_hw.h"
#include "opencl/source/event/perf_counter.h"
@ -133,6 +134,24 @@ TEST(Event, WhenGettingEventInfoThenCqIsReturned) {
delete event;
}
TEST(Event, givenBcsCsrSetInEventWhenPeekingBcsTaskCountThenReturnCorrectTaskCount) {
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.blitterOperationsSupported = true;
REQUIRE_BLITTER_OR_SKIP(&hwInfo);
auto device = ReleaseableObjectPtr<MockClDevice>{
new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockAlignedMallocManagerDevice>(&hwInfo)}};
MockContext context{device.get()};
MockCommandQueue queue{context};
queue.updateBcsTaskCount(19);
Event event{&queue, CL_COMMAND_READ_BUFFER, 0, 0};
EXPECT_EQ(0u, event.peekBcsTaskCountFromCommandQueue());
event.setupBcs(queue.getBcsCommandStreamReceiver()->getOsContext().getEngineType());
EXPECT_EQ(19u, event.peekBcsTaskCountFromCommandQueue());
}
TEST(Event, givenCommandQueueWhenEventIsCreatedWithCommandQueueThenCommandQueueInternalRefCountIsIncremented) {
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockContext ctx;