Use MockCommandQueue instead of CommandQueue in unit tests

Change-Id: I617e77f2680d6d22381b7fde702a551413295266
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-03-04 15:28:58 +01:00
committed by sys_ocldev
parent fa6608d20e
commit f31304a9ad
22 changed files with 284 additions and 299 deletions

View File

@ -7,6 +7,7 @@
#include "cl_api_tests.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
#include "opencl/test/unit_test/mocks/mock_device.h"
@ -23,7 +24,7 @@ void api_fixture_using_aligned_memory_manager::SetUp() {
EXPECT_EQ(CL_SUCCESS, retVal);
Context *ctxPtr = reinterpret_cast<Context *>(context);
commandQueue = new CommandQueue(context, device, 0);
commandQueue = new MockCommandQueue(context, device, 0);
program = new MockProgram(*device->getExecutionEnvironment(), ctxPtr, false, &device->getDevice());
Program *prgPtr = reinterpret_cast<Program *>(program);

View File

@ -15,6 +15,7 @@
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
#include "opencl/test/unit_test/helpers/ult_limits.h"
#include "opencl/test/unit_test/helpers/variable_backup.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_kernel.h"
#include "test.h"
@ -48,7 +49,7 @@ struct ApiFixture : PlatformFixture {
pContext = Context::create<MockContext>(nullptr, ClDeviceVector(&testedClDevice, 1), nullptr, nullptr, retVal);
EXPECT_EQ(retVal, CL_SUCCESS);
pCommandQueue = new CommandQueue(pContext, pDevice, nullptr);
pCommandQueue = new MockCommandQueue(pContext, pDevice, nullptr);
pProgram = new MockProgram(*pDevice->getExecutionEnvironment(), pContext, false, &pDevice->getDevice());

View File

@ -262,7 +262,7 @@ class clEventProfilingWithPerfCountersTests : public DeviceInstrumentationFixtur
cl_int retVal = CL_SUCCESS;
context = std::unique_ptr<Context>(Context::create<MockContext>(nullptr, ClDeviceVector(&deviceId, 1),
nullptr, nullptr, retVal));
commandQueue = std::make_unique<CommandQueue>(context.get(), device.get(), nullptr);
commandQueue = std::make_unique<MockCommandQueue>(context.get(), device.get(), nullptr);
event = std::make_unique<Event>(commandQueue.get(), 0, 0, 0);
event->setStatus(CL_COMPLETE);
commandQueue->getPerfCounters()->getApiReport(0, nullptr, &param_value_size, true);

View File

@ -585,7 +585,7 @@ TEST(clUnifiedSharedMemoryTests, whenclEnqueueMemsetINTELisCalledWithProperParam
auto unfiedMemoryDeviceAllocation = clDeviceMemAllocINTEL(mockContext.get(), mockContext->getDevice(0u), nullptr, 400, 0, &retVal);
struct MockedCommandQueue : public CommandQueue {
struct MockedCommandQueue : public MockCommandQueue {
cl_int enqueueSVMMemFill(void *svmPtr,
const void *pattern,
size_t patternSize,
@ -627,7 +627,7 @@ TEST(clUnifiedSharedMemoryTests, whenclEnqueueMemFillINTELisCalledWithProperPara
auto unfiedMemoryDeviceAllocation = clDeviceMemAllocINTEL(mockContext.get(), mockContext->getDevice(0u), nullptr, 400, 0, &retVal);
struct MockedCommandQueue : public CommandQueue {
struct MockedCommandQueue : public MockCommandQueue {
cl_int enqueueSVMMemFill(void *svmPtr,
const void *pattern,
size_t patternSize,
@ -669,7 +669,7 @@ TEST(clUnifiedSharedMemoryTests, givenTwoUnifiedMemoryAllocationsWhenTheyAreCopi
auto unfiedMemoryDeviceAllocation = clDeviceMemAllocINTEL(mockContext.get(), mockContext->getDevice(0u), nullptr, 400, 0, &retVal);
auto unfiedMemorySharedAllocation = clSharedMemAllocINTEL(mockContext.get(), mockContext->getDevice(0u), nullptr, 400, 0, &retVal);
struct MockedCommandQueue : public CommandQueue {
struct MockedCommandQueue : public MockCommandQueue {
cl_int enqueueSVMMemcpy(cl_bool blockingCopy,
void *dstPtr,
const void *srcPtr,
@ -705,7 +705,7 @@ TEST(clUnifiedSharedMemoryTests, whenClEnqueueMigrateMemINTELisCalledWithWrongQu
}
TEST(clUnifiedSharedMemoryTests, whenClEnqueueMigrateMemINTELisCalledWithProperParametersThenSuccessIsReturned) {
CommandQueue cmdQ;
MockCommandQueue cmdQ;
void *unifiedMemoryAlloc = reinterpret_cast<void *>(0x1234);
auto retVal = clEnqueueMigrateMemINTEL(&cmdQ, unifiedMemoryAlloc, 10, 0, 0, nullptr, nullptr);
@ -718,7 +718,7 @@ TEST(clUnifiedSharedMemoryTests, whenClEnqueueMemAdviseINTELisCalledWithWrongQue
}
TEST(clUnifiedSharedMemoryTests, whenClEnqueueMemAdviseINTELisCalledWithProperParametersThenSuccessIsReturned) {
CommandQueue cmdQ;
MockCommandQueue cmdQ;
void *unifiedMemoryAlloc = reinterpret_cast<void *>(0x1234);
auto retVal = clEnqueueMemAdviseINTEL(&cmdQ, unifiedMemoryAlloc, 10, 0, 0, nullptr, nullptr);

View File

@ -11,6 +11,7 @@
#include "opencl/source/command_queue/command_queue_hw.h"
#include "opencl/source/context/context.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_device.h"
#include "gtest/gtest.h"
@ -86,7 +87,7 @@ CommandQueue *CommandQueueFixture::createCommandQueue(
ClDevice *device,
cl_command_queue_properties properties) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, properties, 0};
return new CommandQueue(
return new MockCommandQueue(
context,
device,
props);

View File

@ -114,7 +114,7 @@ INSTANTIATE_TEST_CASE_P(CommandQueue,
::testing::ValuesIn(AllCommandQueueProperties));
TEST(CommandQueue, WhenConstructingCommandQueueThenTaskLevelAndTaskCountAreZero) {
CommandQueue cmdQ(nullptr, nullptr, 0);
MockCommandQueue cmdQ(nullptr, nullptr, 0);
EXPECT_EQ(0u, cmdQ.taskLevel);
EXPECT_EQ(0u, cmdQ.taskCount);
}
@ -147,7 +147,7 @@ TEST_F(GetTagTest, GivenSetHwTagWhenGettingHwTagThenCorrectTagIsReturned) {
TEST_F(GetTagTest, GivenInitialValueWhenGettingHwTagThenCorrectTagIsReturned) {
MockContext context;
CommandQueue commandQueue(&context, pClDevice, 0);
MockCommandQueue commandQueue(&context, pClDevice, 0);
EXPECT_EQ(initialHardwareTag, commandQueue.getHwTag());
}
@ -155,7 +155,7 @@ TEST_F(GetTagTest, GivenInitialValueWhenGettingHwTagThenCorrectTagIsReturned) {
TEST(CommandQueue, GivenUpdatedCompletionStampWhenGettingCompletionStampThenUpdatedValueIsReturned) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
CompletionStamp cs = {
cmdQ.taskCount + 100,
@ -171,7 +171,7 @@ TEST(CommandQueue, GivenUpdatedCompletionStampWhenGettingCompletionStampThenUpda
TEST(CommandQueue, givenTimeStampWithTaskCountNotReadyStatusWhenupdateFromCompletionStampIsBeingCalledThenQueueTaskCountIsNotUpdated) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
cmdQ.taskCount = 1u;
@ -187,7 +187,7 @@ TEST(CommandQueue, GivenOOQwhenUpdateFromCompletionStampWithTrueIsCalledThenTask
MockContext context;
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0};
CommandQueue cmdQ(&context, nullptr, props);
MockCommandQueue cmdQ(&context, nullptr, props);
auto oldTL = cmdQ.taskLevel;
CompletionStamp cs = {
@ -204,7 +204,7 @@ TEST(CommandQueue, GivenOOQwhenUpdateFromCompletionStampWithTrueIsCalledThenTask
TEST(CommandQueue, givenDeviceWhenCreatingCommandQueueThenPickCsrFromDefaultEngine) {
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
CommandQueue cmdQ(nullptr, mockDevice.get(), 0);
MockCommandQueue cmdQ(nullptr, mockDevice.get(), 0);
auto defaultCsr = mockDevice->getDefaultEngine().commandStreamReceiver;
EXPECT_EQ(defaultCsr, &cmdQ.getGpgpuCommandStreamReceiver());
@ -214,7 +214,7 @@ TEST(CommandQueue, givenDeviceNotSupportingBlitOperationsWhenQueueIsCreatedThenD
HardwareInfo hwInfo = *platformDevices[0];
hwInfo.capabilityTable.blitterOperationsSupported = false;
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
CommandQueue cmdQ(nullptr, mockDevice.get(), 0);
MockCommandQueue cmdQ(nullptr, mockDevice.get(), 0);
EXPECT_EQ(nullptr, cmdQ.getBcsCommandStreamReceiver());
}
@ -242,7 +242,7 @@ HWTEST_F(CommandQueueWithSubDevicesTest, givenDeviceWithSubDevicesSupportingBlit
}
auto bcsEngine = subDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, false);
CommandQueue cmdQ(nullptr, device.get(), 0);
MockCommandQueue cmdQ(nullptr, device.get(), 0);
EXPECT_NE(nullptr, cmdQ.getBcsCommandStreamReceiver());
EXPECT_EQ(bcsEngine.commandStreamReceiver, cmdQ.getBcsCommandStreamReceiver());
@ -252,7 +252,7 @@ HWTEST_F(CommandQueueWithSubDevicesTest, givenDeviceWithSubDevicesSupportingBlit
TEST(CommandQueue, givenCmdQueueBlockedByReadyVirtualEventWhenUnblockingThenUpdateFlushTaskFromEvent) {
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto context = new MockContext;
auto cmdQ = new CommandQueue(context, mockDevice.get(), 0);
auto cmdQ = new MockCommandQueue(context, mockDevice.get(), 0);
auto userEvent = new Event(cmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
userEvent->setStatus(CL_COMPLETE);
userEvent->flushStamp->setStamp(5);
@ -272,7 +272,7 @@ TEST(CommandQueue, givenCmdQueueBlockedByReadyVirtualEventWhenUnblockingThenUpda
TEST(CommandQueue, givenCmdQueueBlockedByAbortedVirtualEventWhenUnblockingThenUpdateFlushTaskFromEvent) {
auto context = new MockContext;
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto cmdQ = new CommandQueue(context, mockDevice.get(), 0);
auto cmdQ = new MockCommandQueue(context, mockDevice.get(), 0);
auto userEvent = new Event(cmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
userEvent->setStatus(-1);
@ -309,7 +309,7 @@ HWTEST_F(CommandQueueCommandStreamTest, givenCommandQueueThatWaitsOnAbortedUserE
MockContext context;
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
CommandQueue cmdQ(&context, mockDevice.get(), 0);
MockCommandQueue cmdQ(&context, mockDevice.get(), 0);
auto &commandStreamReceiver = mockDevice->getUltCommandStreamReceiver<FamilyType>();
commandStreamReceiver.taskLevel = 100u;
@ -324,7 +324,7 @@ HWTEST_F(CommandQueueCommandStreamTest, givenCommandQueueThatWaitsOnAbortedUserE
TEST_F(CommandQueueCommandStreamTest, GivenValidCommandQueueWhenGettingCommandStreamThenValidObjectIsReturned) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue commandQueue(context.get(), pClDevice, props);
MockCommandQueue commandQueue(context.get(), pClDevice, props);
auto &cs = commandQueue.getCS(1024);
EXPECT_NE(nullptr, &cs);
@ -332,7 +332,7 @@ TEST_F(CommandQueueCommandStreamTest, GivenValidCommandQueueWhenGettingCommandSt
TEST_F(CommandQueueCommandStreamTest, GivenValidCommandStreamWhenGettingGraphicsAllocationThenMaxAvailableSpaceAndUnderlyingBufferSizeAreCorrect) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue commandQueue(context.get(), pClDevice, props);
MockCommandQueue commandQueue(context.get(), pClDevice, props);
size_t minSizeRequested = 20;
auto &cs = commandQueue.getCS(minSizeRequested);
@ -349,7 +349,7 @@ TEST_F(CommandQueueCommandStreamTest, GivenValidCommandStreamWhenGettingGraphics
TEST_F(CommandQueueCommandStreamTest, GivenRequiredSizeWhenGettingCommandStreamThenMaxAvailableSpaceIsEqualOrGreaterThanRequiredSize) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue commandQueue(context.get(), pClDevice, props);
MockCommandQueue commandQueue(context.get(), pClDevice, props);
size_t requiredSize = 16384;
const auto &commandStream = commandQueue.getCS(requiredSize);
@ -359,7 +359,7 @@ TEST_F(CommandQueueCommandStreamTest, GivenRequiredSizeWhenGettingCommandStreamT
TEST_F(CommandQueueCommandStreamTest, WhenGettingCommandStreamWithNewSizeThenMaxAvailableSpaceIsEqualOrGreaterThanNewSize) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue commandQueue(context.get(), pClDevice, props);
MockCommandQueue commandQueue(context.get(), pClDevice, props);
auto &commandStreamInitial = commandQueue.getCS(1024);
size_t requiredSize = commandStreamInitial.getMaxAvailableSpace() + 42;
@ -371,7 +371,7 @@ TEST_F(CommandQueueCommandStreamTest, WhenGettingCommandStreamWithNewSizeThenMax
TEST_F(CommandQueueCommandStreamTest, givenCommandStreamReceiverWithReusableAllocationsWhenAskedForCommandStreamThenReturnsAllocationFromReusablePool) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
auto memoryManager = pDevice->getMemoryManager();
size_t requiredSize = alignUp(100 + CSRequirements::minCommandQueueCommandStreamSize + CSRequirements::csOverfetchSize, MemoryConstants::pageSize64k);
@ -390,7 +390,7 @@ TEST_F(CommandQueueCommandStreamTest, givenCommandStreamReceiverWithReusableAllo
}
TEST_F(CommandQueueCommandStreamTest, givenCommandQueueWhenItIsDestroyedThenCommandStreamIsPutOnTheReusabeList) {
auto cmdQ = new CommandQueue(context.get(), pClDevice, 0);
auto cmdQ = new MockCommandQueue(context.get(), pClDevice, 0);
const auto &commandStream = cmdQ->getCS(100);
auto graphicsAllocation = commandStream.getGraphicsAllocation();
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
@ -403,7 +403,7 @@ TEST_F(CommandQueueCommandStreamTest, givenCommandQueueWhenItIsDestroyedThenComm
TEST_F(CommandQueueCommandStreamTest, WhenAskedForNewCommandStreamThenOldHeapIsStoredForReuse) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
@ -422,7 +422,7 @@ TEST_F(CommandQueueCommandStreamTest, WhenAskedForNewCommandStreamThenOldHeapIsS
TEST_F(CommandQueueCommandStreamTest, givenCommandQueueWhenGetCSIsCalledThenCommandStreamAllocationTypeShouldBeSetToCommandBuffer) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
const auto &commandStream = cmdQ.getCS(100);
auto commandStreamAllocation = commandStream.getGraphicsAllocation();
@ -482,7 +482,7 @@ struct CommandQueueIndirectHeapTest : public CommandQueueMemoryDevice,
TEST_P(CommandQueueIndirectHeapTest, WhenGettingIndirectHeapThenValidObjectIsReturned) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), 8192);
EXPECT_NE(nullptr, &indirectHeap);
@ -490,7 +490,7 @@ TEST_P(CommandQueueIndirectHeapTest, WhenGettingIndirectHeapThenValidObjectIsRet
TEST_P(CommandQueueIndirectHeapTest, givenIndirectObjectHeapWhenItIsQueriedForInternalAllocationThenTrueIsReturned) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), 8192);
if (this->GetParam() == IndirectHeap::INDIRECT_OBJECT) {
@ -502,7 +502,7 @@ TEST_P(CommandQueueIndirectHeapTest, givenIndirectObjectHeapWhenItIsQueriedForIn
HWTEST_P(CommandQueueIndirectHeapTest, GivenIndirectHeapWhenGettingAvailableSpaceThenCorrectSizeIsReturned) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), sizeof(uint32_t));
if (this->GetParam() == IndirectHeap::SURFACE_STATE) {
@ -515,7 +515,7 @@ HWTEST_P(CommandQueueIndirectHeapTest, GivenIndirectHeapWhenGettingAvailableSpac
TEST_P(CommandQueueIndirectHeapTest, GivenRequiredSizeWhenGettingIndirectHeapThenIndirectHeapHasRequiredSize) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
size_t requiredSize = 16384;
const auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), requiredSize);
@ -525,7 +525,7 @@ TEST_P(CommandQueueIndirectHeapTest, GivenRequiredSizeWhenGettingIndirectHeapThe
TEST_P(CommandQueueIndirectHeapTest, WhenGettingIndirectHeapWithNewSizeThenMaxAvailableSpaceIsEqualOrGreaterThanNewSize) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
auto &indirectHeapInitial = cmdQ.getIndirectHeap(this->GetParam(), 10);
size_t requiredSize = indirectHeapInitial.getMaxAvailableSpace() + 42;
@ -543,7 +543,7 @@ TEST_P(CommandQueueIndirectHeapTest, WhenGettingIndirectHeapWithNewSizeThenMaxAv
TEST_P(CommandQueueIndirectHeapTest, WhenGettingIndirectHeapThenSizeIsAlignedToCacheLine) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
size_t minHeapSize = 64 * KB;
auto &indirectHeapInitial = cmdQ.getIndirectHeap(this->GetParam(), 2 * minHeapSize + 1);
@ -560,7 +560,7 @@ TEST_P(CommandQueueIndirectHeapTest, WhenGettingIndirectHeapThenSizeIsAlignedToC
TEST_P(CommandQueueIndirectHeapTest, givenCommandStreamReceiverWithReusableAllocationsWhenAskedForHeapAllocationThenAllocationFromReusablePoolIsReturned) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
auto memoryManager = pDevice->getMemoryManager();
@ -600,7 +600,7 @@ TEST_P(CommandQueueIndirectHeapTest, givenCommandStreamReceiverWithReusableAlloc
HWTEST_P(CommandQueueIndirectHeapTest, WhenAskedForNewHeapThenOldHeapIsStoredForReuse) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
EXPECT_TRUE(commandStreamReceiver.getAllocationsForReuse().peekIsEmpty());
@ -645,7 +645,7 @@ TEST_P(CommandQueueIndirectHeapTest, GivenCommandQueueWithoutHeapAllocationWhenA
}
TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWithResourceCachingActiveWhenQueueISDestroyedThenIndirectHeapIsNotOnReuseList) {
auto cmdQ = new CommandQueue(context.get(), pClDevice, 0);
auto cmdQ = new MockCommandQueue(context.get(), pClDevice, 0);
cmdQ->getIndirectHeap(this->GetParam(), 100);
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
@ -709,7 +709,7 @@ TEST_P(CommandQueueIndirectHeapTest, GivenCommandQueueWithHeapWhenGraphicAllocat
TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetIndirectHeapIsCalledThenIndirectHeapAllocationTypeShouldBeSetToInternalHeapForIohAndLinearStreamForOthers) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
auto heapType = this->GetParam();
@ -726,7 +726,7 @@ TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetIndirectHeapIsCalle
TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetHeapMemoryIsCalledThenHeapIsCreated) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
IndirectHeap *indirectHeap = nullptr;
cmdQ.allocateHeapMemory(this->GetParam(), 100, indirectHeap);
@ -739,7 +739,7 @@ TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetHeapMemoryIsCalledT
TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetHeapMemoryIsCalledWithAlreadyAllocatedHeapThenGraphicsAllocationIsCreated) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pClDevice, props);
MockCommandQueue cmdQ(context.get(), pClDevice, props);
IndirectHeap heap(nullptr, size_t{100});
@ -763,13 +763,13 @@ using CommandQueueTests = ::testing::Test;
HWTEST_F(CommandQueueTests, givenMultipleCommandQueuesWhenMarkerIsEmittedThenGraphicsAllocationIsReused) {
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
MockContext context(device.get());
std::unique_ptr<CommandQueue> commandQ(new CommandQueue(&context, device.get(), 0));
std::unique_ptr<CommandQueue> commandQ(new MockCommandQueue(&context, device.get(), 0));
*device->getDefaultEngine().commandStreamReceiver->getTagAddress() = 0;
commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr);
commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr);
auto commandStreamGraphicsAllocation = commandQ->getCS(0).getGraphicsAllocation();
commandQ.reset(new CommandQueue(&context, device.get(), 0));
commandQ.reset(new MockCommandQueue(&context, device.get(), 0));
commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr);
commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr);
auto commandStreamGraphicsAllocation2 = commandQ->getCS(0).getGraphicsAllocation();
@ -829,7 +829,7 @@ HWTEST_F(WaitForQueueCompletionTests, whenFinishIsCalledThenCallWaitWithoutQuick
TEST(CommandQueue, givenEnqueueAcquireSharedObjectsWhenNoObjectsThenReturnSuccess) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
cl_uint numObjects = 0;
cl_mem *memObjects = nullptr;
@ -847,7 +847,7 @@ class MockSharingHandler : public SharingHandler {
TEST(CommandQueue, givenEnqueuesForSharedObjectsWithImageWhenUsingSharingHandlerThenReturnSuccess) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
MockSharingHandler *mockSharingHandler = new MockSharingHandler;
auto image = std::unique_ptr<Image>(ImageHelper<Image2dDefaults>::create(&context));
@ -867,7 +867,7 @@ TEST(CommandQueue, givenEnqueuesForSharedObjectsWithImageWhenUsingSharingHandler
TEST(CommandQueue, givenEnqueuesForSharedObjectsWithImageWhenUsingSharingHandlerWithEventThenReturnSuccess) {
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockContext context;
CommandQueue cmdQ(&context, mockDevice.get(), 0);
MockCommandQueue cmdQ(&context, mockDevice.get(), 0);
MockSharingHandler *mockSharingHandler = new MockSharingHandler;
auto image = std::unique_ptr<Image>(ImageHelper<Image2dDefaults>::create(&context));
@ -894,7 +894,7 @@ TEST(CommandQueue, givenEnqueuesForSharedObjectsWithImageWhenUsingSharingHandler
TEST(CommandQueue, givenEnqueueAcquireSharedObjectsWhenIncorrectArgumentsThenReturnProperError) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
cl_uint numObjects = 1;
cl_mem *memObjects = nullptr;
@ -934,7 +934,7 @@ TEST(CommandQueue, givenEnqueueAcquireSharedObjectsWhenIncorrectArgumentsThenRet
TEST(CommandQueue, givenEnqueueReleaseSharedObjectsWhenNoObjectsThenReturnSuccess) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
cl_uint numObjects = 0;
cl_mem *memObjects = nullptr;
@ -945,7 +945,7 @@ TEST(CommandQueue, givenEnqueueReleaseSharedObjectsWhenNoObjectsThenReturnSucces
TEST(CommandQueue, givenEnqueueReleaseSharedObjectsWhenIncorrectArgumentsThenReturnProperError) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
cl_uint numObjects = 1;
cl_mem *memObjects = nullptr;
@ -990,7 +990,7 @@ TEST(CommandQueue, givenEnqueueAcquireSharedObjectsCallWhenAcquireFailsThenCorre
}
};
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
auto buffer = std::unique_ptr<Buffer>(BufferHelper<>::create(&context));
MockSharingHandler *handler = new MockSharingHandler;
@ -1006,7 +1006,7 @@ HWTEST_F(CommandQueueCommandStreamTest, givenDebugKernelWhenSetupDebugSurfaceIsC
MockProgram program(*pDevice->getExecutionEnvironment());
program.enableKernelDebug();
std::unique_ptr<MockDebugKernel> kernel(MockKernel::create<MockDebugKernel>(*pDevice, &program));
CommandQueue cmdQ(context.get(), pClDevice, 0);
MockCommandQueue cmdQ(context.get(), pClDevice, 0);
kernel->setSshLocal(nullptr, sizeof(RENDER_SURFACE_STATE) + kernel->getAllocatedKernelInfo()->patchInfo.pAllocateSystemThreadSurface->Offset);
kernel->getAllocatedKernelInfo()->usesSsh = true;
@ -1025,7 +1025,7 @@ HWTEST_F(CommandQueueCommandStreamTest, givenCsrWithDebugSurfaceAllocatedWhenSet
MockProgram program(*pDevice->getExecutionEnvironment());
program.enableKernelDebug();
std::unique_ptr<MockDebugKernel> kernel(MockKernel::create<MockDebugKernel>(*pDevice, &program));
CommandQueue cmdQ(context.get(), pClDevice, 0);
MockCommandQueue cmdQ(context.get(), pClDevice, 0);
kernel->setSshLocal(nullptr, sizeof(RENDER_SURFACE_STATE) + kernel->getAllocatedKernelInfo()->patchInfo.pAllocateSystemThreadSurface->Offset);
kernel->getAllocatedKernelInfo()->usesSsh = true;
@ -1069,7 +1069,7 @@ TEST(CommandQueuePropertiesTests, whenGetEngineIsCalledThenQueueEngineIsReturned
TEST(CommandQueue, GivenCommandQueueWhenEnqueueResourceBarrierCalledThenSuccessReturned) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
cl_int result = cmdQ.enqueueResourceBarrier(
nullptr,
@ -1081,7 +1081,7 @@ TEST(CommandQueue, GivenCommandQueueWhenEnqueueResourceBarrierCalledThenSuccessR
TEST(CommandQueue, GivenCommandQueueWhenCheckingIfIsCacheFlushCommandCalledThenFalseReturned) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
bool isCommandCacheFlush = cmdQ.isCacheFlushCommand(0u);
EXPECT_FALSE(isCommandCacheFlush);
@ -1089,7 +1089,7 @@ TEST(CommandQueue, GivenCommandQueueWhenCheckingIfIsCacheFlushCommandCalledThenF
TEST(CommandQueue, GivenCommandQueueWhenEnqueueInitDispatchGlobalsCalledThenSuccessReturned) {
MockContext context;
CommandQueue cmdQ(&context, nullptr, 0);
MockCommandQueue cmdQ(&context, nullptr, 0);
cl_int result = cmdQ.enqueueInitDispatchGlobals(
nullptr,

View File

@ -1524,7 +1524,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelWhenItIsUnblocke
pDevice->resetCommandStreamReceiver(csr);
uint32_t numGrfRequired = 666u;
auto pCmdQ = std::make_unique<CommandQueue>(&mockContext, pClDevice, nullptr);
auto pCmdQ = std::make_unique<MockCommandQueue>(&mockContext, pClDevice, nullptr);
auto mockProgram = std::make_unique<MockProgram>(*pDevice->getExecutionEnvironment(), &mockContext, false, pDevice);
std::unique_ptr<MockKernel> pKernel(MockKernel::create(*pDevice, mockProgram.get(), numGrfRequired));

View File

@ -14,6 +14,7 @@
#include "opencl/source/sharings/sharing.h"
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
#include "opencl/test/unit_test/helpers/variable_backup.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
#include "opencl/test/unit_test/mocks/mock_deferred_deleter.h"
#include "opencl/test/unit_test/mocks/mock_device.h"
@ -114,7 +115,7 @@ TEST_F(ContextTest, WhenSettingSpecialQueueThenQueueIsAvailable) {
auto specialQ = context.getSpecialQueue();
EXPECT_EQ(specialQ, nullptr);
auto cmdQ = new CommandQueue(&context, (ClDevice *)devices[0], 0);
auto cmdQ = new MockCommandQueue(&context, (ClDevice *)devices[0], 0);
context.setSpecialQueue(cmdQ);
specialQ = context.getSpecialQueue();
EXPECT_NE(specialQ, nullptr);
@ -132,13 +133,13 @@ TEST_F(ContextTest, givenCmdQueueWithoutContextWhenBeingCreatedNextDeletedThenCo
MockContext context((ClDevice *)devices[0]);
EXPECT_EQ(1, context.getRefInternalCount());
auto cmdQ1 = new CommandQueue();
auto cmdQ1 = new MockCommandQueue();
EXPECT_EQ(1, context.getRefInternalCount());
delete cmdQ1;
EXPECT_EQ(1, context.getRefInternalCount());
auto cmdQ2 = new CommandQueue(nullptr, (ClDevice *)devices[0], 0);
auto cmdQ2 = new MockCommandQueue(nullptr, (ClDevice *)devices[0], 0);
EXPECT_EQ(1, context.getRefInternalCount());
delete cmdQ2;
@ -167,7 +168,7 @@ TEST_F(ContextTest, givenCmdQueueWithContextWhenBeingCreatedNextDeletedThenConte
MockContext context((ClDevice *)devices[0]);
EXPECT_EQ(1, context.getRefInternalCount());
auto cmdQ = new CommandQueue(&context, (ClDevice *)devices[0], 0);
auto cmdQ = new MockCommandQueue(&context, (ClDevice *)devices[0], 0);
EXPECT_EQ(2, context.getRefInternalCount());
delete cmdQ;
@ -227,7 +228,7 @@ TEST_F(ContextTest, givenSpecialCmdQueueWithContextWhenBeingCreatedNextAutoDelet
MockContext context((ClDevice *)devices[0], true);
EXPECT_EQ(1, context.getRefInternalCount());
auto cmdQ = new CommandQueue(&context, (ClDevice *)devices[0], 0);
auto cmdQ = new MockCommandQueue(&context, (ClDevice *)devices[0], 0);
context.overrideSpecialQueueAndDecrementRefCount(cmdQ);
EXPECT_EQ(1, context.getRefInternalCount());
@ -238,7 +239,7 @@ TEST_F(ContextTest, givenSpecialCmdQueueWithContextWhenBeingCreatedNextDeletedTh
MockContext context((ClDevice *)devices[0], true);
EXPECT_EQ(1, context.getRefInternalCount());
auto cmdQ = new CommandQueue(&context, (ClDevice *)devices[0], 0);
auto cmdQ = new MockCommandQueue(&context, (ClDevice *)devices[0], 0);
context.overrideSpecialQueueAndDecrementRefCount(cmdQ);
EXPECT_EQ(1, context.getRefInternalCount());

View File

@ -33,9 +33,9 @@ TYPED_TEST_P(D3DTests, givenSharedResourceBufferAndInteropUserSyncEnabledWhenRel
.Times(1)
.WillOnce(SetArgPointee<0>(this->mockSharingFcns->mockBufferDesc));
class MockCmdQ : public CommandQueue {
class MockCmdQ : public MockCommandQueue {
public:
MockCmdQ(Context *context, ClDevice *device, const cl_queue_properties *properties) : CommandQueue(context, device, properties){};
MockCmdQ(Context *context, ClDevice *device, const cl_queue_properties *properties) : MockCommandQueue(context, device, properties){};
cl_int finish() override {
finishCalled++;
return CL_SUCCESS;
@ -61,9 +61,9 @@ TYPED_TEST_P(D3DTests, givenSharedResourceBufferAndInteropUserSyncEnabledWhenRel
TYPED_TEST_P(D3DTests, givenNonSharedResourceBufferAndInteropUserSyncDisabledWhenReleaseIsCalledThenDoExplicitFinishTwice) {
this->context->setInteropUserSyncEnabled(false);
class MockCmdQ : public CommandQueue {
class MockCmdQ : public MockCommandQueue {
public:
MockCmdQ(Context *context, ClDevice *device, const cl_queue_properties *properties) : CommandQueue(context, device, properties){};
MockCmdQ(Context *context, ClDevice *device, const cl_queue_properties *properties) : MockCommandQueue(context, device, properties){};
cl_int finish() override {
finishCalled++;
return CL_SUCCESS;
@ -94,9 +94,9 @@ TYPED_TEST_P(D3DTests, givenSharedResourceBufferAndInteropUserSyncDisabledWhenRe
.Times(1)
.WillOnce(SetArgPointee<0>(this->mockSharingFcns->mockBufferDesc));
class MockCmdQ : public CommandQueue {
class MockCmdQ : public MockCommandQueue {
public:
MockCmdQ(Context *context, ClDevice *device, const cl_queue_properties *properties) : CommandQueue(context, device, properties){};
MockCmdQ(Context *context, ClDevice *device, const cl_queue_properties *properties) : MockCommandQueue(context, device, properties){};
cl_int finish() override {
finishCalled++;
return CL_SUCCESS;
@ -122,9 +122,9 @@ TYPED_TEST_P(D3DTests, givenSharedResourceBufferAndInteropUserSyncDisabledWhenRe
TYPED_TEST_P(D3DTests, givenNonSharedResourceBufferAndInteropUserSyncEnabledWhenReleaseIsCalledThenDoExplicitFinishOnce) {
this->context->setInteropUserSyncEnabled(true);
class MockCmdQ : public CommandQueue {
class MockCmdQ : public MockCommandQueue {
public:
MockCmdQ(Context *context, ClDevice *device, const cl_queue_properties *properties) : CommandQueue(context, device, properties){};
MockCmdQ(Context *context, ClDevice *device, const cl_queue_properties *properties) : MockCommandQueue(context, device, properties){};
cl_int finish() override {
finishCalled++;
return CL_SUCCESS;

View File

@ -320,7 +320,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, dispatchScheduler) {
DeviceQueue devQueue;
MockContext context;
MockProgram program(*device->getExecutionEnvironment());
CommandQueue cmdQ(nullptr, nullptr, 0);
MockCommandQueue cmdQ(nullptr, nullptr, 0);
KernelInfo info;
MockSchedulerKernel *kernel = new MockSchedulerKernel(&program, info, *device);
LinearStream cmdStream;

View File

@ -78,7 +78,7 @@ TEST(EventBuilder, givenVirtualEventWithCommandThenFinalizeAddChild) {
};
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
CommandQueue cmdQ(nullptr, device.get(), nullptr);
MockCommandQueue cmdQ(nullptr, device.get(), nullptr);
MockKernelWithInternals kernel(*device);
IndirectHeap *ih1 = nullptr, *ih2 = nullptr, *ih3 = nullptr;
@ -127,7 +127,7 @@ TEST(EventBuilder, givenVirtualEventWithSubmittedCommandAsParentThenFinalizeNotA
};
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
CommandQueue cmdQ(nullptr, device.get(), nullptr);
MockCommandQueue cmdQ(nullptr, device.get(), nullptr);
MockKernelWithInternals kernel(*device);
IndirectHeap *ih1 = nullptr, *ih2 = nullptr, *ih3 = nullptr;

View File

@ -111,7 +111,7 @@ TEST(Event, WhenGettingTaskCountThenCorrectValueIsReturned) {
TEST(Event, WhenGettingEventInfoThenCqIsReturned) {
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto ctx = std::unique_ptr<Context>(new MockContext());
auto cmdQ = std::unique_ptr<CommandQueue>(new MockCommandQueue(ctx.get(), mockDevice.get(), 0));
auto cmdQ = std::unique_ptr<MockCommandQueue>(new MockCommandQueue(ctx.get(), mockDevice.get(), 0));
Event *event = new Event(cmdQ.get(), CL_COMMAND_NDRANGE_KERNEL, 1, 5);
cl_event clEvent = event;
cl_command_queue cmdQResult = nullptr;
@ -457,7 +457,7 @@ class SurfaceMock : public Surface {
};
TEST_F(InternalsEventTest, GivenSubmitCommandFalseWhenSubmittingCommandsThenRefApiCountAndRefInternalGetHandledCorrectly) {
CommandQueue cmdQ(mockContext, pClDevice, nullptr);
MockCommandQueue cmdQ(mockContext, pClDevice, nullptr);
MockEvent<Event> event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER}));
@ -509,7 +509,7 @@ TEST_F(InternalsEventTest, GivenSubmitCommandFalseWhenSubmittingCommandsThenRefA
}
TEST_F(InternalsEventTest, GivenSubmitCommandTrueWhenSubmittingCommandsThenRefApiCountAndRefInternalGetHandledCorrectly) {
CommandQueue cmdQ(mockContext, pClDevice, nullptr);
MockCommandQueue cmdQ(mockContext, pClDevice, nullptr);
MockEvent<Event> event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
auto cmdStream = new LinearStream(pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER}));
@ -596,7 +596,7 @@ TEST_F(InternalsEventTest, givenBlockedKernelWithPrintfWhenSubmittedThenPrintOut
}
TEST_F(InternalsEventTest, GivenMapOperationWhenSubmittingCommandsThenTaskLevelIsIncremented) {
auto pCmdQ = make_releaseable<CommandQueue>(mockContext, pClDevice, nullptr);
auto pCmdQ = make_releaseable<MockCommandQueue>(mockContext, pClDevice, nullptr);
MockEvent<Event> event(nullptr, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
auto &csr = pCmdQ->getGpgpuCommandStreamReceiver();
@ -617,7 +617,7 @@ TEST_F(InternalsEventTest, GivenMapOperationWhenSubmittingCommandsThenTaskLevelI
}
TEST_F(InternalsEventTest, GivenMapOperationNonZeroCopyBufferWhenSubmittingCommandsThenTaskLevelIsIncremented) {
auto pCmdQ = make_releaseable<CommandQueue>(mockContext, pClDevice, nullptr);
auto pCmdQ = make_releaseable<MockCommandQueue>(mockContext, pClDevice, nullptr);
MockEvent<Event> event(nullptr, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
auto &csr = pCmdQ->getGpgpuCommandStreamReceiver();
@ -682,7 +682,7 @@ class InternalsEventProfilingTest : public InternalsEventTest,
TEST_P(InternalsEventProfilingTest, GivenProfilingWhenEventCreatedThenProfilingSet) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
std::unique_ptr<CommandQueue> pCmdQ(new CommandQueue(mockContext, pClDevice, props));
std::unique_ptr<MockCommandQueue> pCmdQ(new MockCommandQueue(mockContext, pClDevice, props));
std::unique_ptr<MockEvent<Event>> event(new MockEvent<Event>(pCmdQ.get(), GetParam(), 0, 0));
EXPECT_TRUE(event.get()->isProfilingEnabled());
@ -694,7 +694,7 @@ INSTANTIATE_TEST_CASE_P(InternalsEventProfilingTest,
TEST_F(InternalsEventTest, GivenProfilingWhenUserEventCreatedThenProfilingNotSet) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
std::unique_ptr<CommandQueue> pCmdQ(new CommandQueue(mockContext, pClDevice, props));
std::unique_ptr<MockCommandQueue> pCmdQ(new MockCommandQueue(mockContext, pClDevice, props));
std::unique_ptr<MockEvent<Event>> event(new MockEvent<Event>(pCmdQ.get(), CL_COMMAND_USER, 0, 0));
EXPECT_FALSE(event.get()->isProfilingEnabled());
@ -702,7 +702,7 @@ TEST_F(InternalsEventTest, GivenProfilingWhenUserEventCreatedThenProfilingNotSet
TEST_F(InternalsEventTest, GivenProfilingWHENMapOperationTHENTimesSet) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
CommandQueue *pCmdQ = new CommandQueue(mockContext, pClDevice, props);
MockCommandQueue *pCmdQ = new MockCommandQueue(mockContext, pClDevice, props);
MockEvent<Event> *event = new MockEvent<Event>(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
@ -729,7 +729,7 @@ TEST_F(InternalsEventTest, GivenProfilingWHENMapOperationTHENTimesSet) {
TEST_F(InternalsEventTest, GivenUnMapOperationWhenSubmittingCommandsThenTaskLevelIsIncremented) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
auto pCmdQ = make_releaseable<CommandQueue>(mockContext, pClDevice, props);
auto pCmdQ = make_releaseable<MockCommandQueue>(mockContext, pClDevice, props);
MockEvent<Event> event(nullptr, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
auto &csr = pCmdQ->getGpgpuCommandStreamReceiver();
@ -751,7 +751,7 @@ TEST_F(InternalsEventTest, GivenUnMapOperationWhenSubmittingCommandsThenTaskLeve
TEST_F(InternalsEventTest, givenBlockedMapCommandWhenSubmitIsCalledItReleasesMemObjectReference) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
auto pCmdQ = std::make_unique<CommandQueue>(mockContext, pClDevice, props);
auto pCmdQ = std::make_unique<MockCommandQueue>(mockContext, pClDevice, props);
MockEvent<Event> event(nullptr, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
auto buffer = new UnalignedBuffer;
@ -770,7 +770,7 @@ TEST_F(InternalsEventTest, givenBlockedMapCommandWhenSubmitIsCalledItReleasesMem
}
TEST_F(InternalsEventTest, GivenUnMapOperationNonZeroCopyBufferWhenSubmittingCommandsThenTaskLevelIsIncremented) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
auto pCmdQ = std::make_unique<CommandQueue>(mockContext, pClDevice, props);
auto pCmdQ = std::make_unique<MockCommandQueue>(mockContext, pClDevice, props);
MockEvent<Event> event(nullptr, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
auto &csr = pCmdQ->getGpgpuCommandStreamReceiver();
@ -792,7 +792,7 @@ TEST_F(InternalsEventTest, GivenUnMapOperationNonZeroCopyBufferWhenSubmittingCom
HWTEST_F(InternalsEventTest, givenCpuProfilingPathWhenEnqueuedMarkerThenDontUseTimeStampNode) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
CommandQueue *pCmdQ = new CommandQueue(mockContext, pClDevice, props);
MockCommandQueue *pCmdQ = new MockCommandQueue(mockContext, pClDevice, props);
MockEvent<Event> *event = new MockEvent<Event>(pCmdQ, CL_COMMAND_MARKER, 0, 0);
event->setCPUProfilingPath(true);
@ -830,7 +830,7 @@ struct InternalsEventWithPerfCountersTest
};
HWTEST_F(InternalsEventWithPerfCountersTest, givenCpuProfilingPerfCountersPathWhenEnqueuedMarkerThenDontUseTimeStampNodePerfCounterNode) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
CommandQueue *pCmdQ = new CommandQueue(mockContext, pClDevice, props);
MockCommandQueue *pCmdQ = new MockCommandQueue(mockContext, pClDevice, props);
bool ret = false;
ret = pCmdQ->setPerfCountersEnabled();
EXPECT_TRUE(ret);
@ -856,7 +856,7 @@ HWTEST_F(InternalsEventWithPerfCountersTest, givenCpuProfilingPerfCountersPathWh
HWTEST_F(InternalsEventWithPerfCountersTest, givenCpuProfilingPerfCountersPathWhenEnqueuedMarkerThenUseTimeStampNodePerfCounterNode) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
CommandQueue *pCmdQ = new CommandQueue(mockContext, pClDevice, props);
MockCommandQueue *pCmdQ = new MockCommandQueue(mockContext, pClDevice, props);
pCmdQ->setPerfCountersEnabled();
MockEvent<Event> *event = new MockEvent<Event>(pCmdQ, CL_COMMAND_MARKER, 0, 0);
event->setCPUProfilingPath(true);
@ -883,7 +883,7 @@ HWTEST_F(InternalsEventWithPerfCountersTest, givenCpuProfilingPerfCountersPathWh
TEST_F(InternalsEventWithPerfCountersTest, GivenPerfCountersEnabledWhenEventIsCreatedThenProfilingEnabledAndPerfCountersEnabledAreTrue) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
CommandQueue *pCmdQ = new CommandQueue(mockContext, pClDevice, props);
MockCommandQueue *pCmdQ = new MockCommandQueue(mockContext, pClDevice, props);
pCmdQ->setPerfCountersEnabled();
Event *ev = new Event(pCmdQ, CL_COMMAND_COPY_BUFFER, 3, 0);
EXPECT_TRUE(ev->isProfilingEnabled());
@ -978,7 +978,7 @@ HWTEST_F(InternalsEventTest, GivenBufferWithoutZeroCopyOnCommandMapOrUnmapFlushe
pDevice->resetCommandStreamReceiver(csr);
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
auto pCmdQ = make_releaseable<CommandQueue>(mockContext, pClDevice, props);
auto pCmdQ = make_releaseable<MockCommandQueue>(mockContext, pClDevice, props);
MockNonZeroCopyBuff buffer(executionStamp);
@ -1169,7 +1169,7 @@ TEST_F(EventTest, GivenProfilingDisabledWhenEventIsCreatedThenPerfCountersAreDis
TEST_F(InternalsEventTest, GivenOnlyProfilingEnabledWhenEventIsCreatedThenPerfCountersAreDisabled) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
CommandQueue *pCmdQ = new CommandQueue(mockContext, pClDevice, props);
MockCommandQueue *pCmdQ = new MockCommandQueue(mockContext, pClDevice, props);
Event *ev = new Event(pCmdQ, CL_COMMAND_COPY_BUFFER, 3, 0);
EXPECT_TRUE(ev->isProfilingEnabled());
@ -1245,7 +1245,7 @@ TEST_F(EventTest, givenOutEventWhenBlockingEnqueueHandledOnCpuThenUpdateTaskCoun
TEST_F(EventTest, givenCmdQueueWithProfilingWhenIsCpuProfilingIsCalledThenTrueIsReturned) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
std::unique_ptr<CommandQueue> pCmdQ(new CommandQueue(&mockContext, pClDevice, props));
std::unique_ptr<MockCommandQueue> pCmdQ(new MockCommandQueue(&mockContext, pClDevice, props));
MockEvent<Event> ev(pCmdQ.get(), CL_COMMAND_MAP_IMAGE, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
bool cpuProfiling = ev.isCPUProfilingPath() != 0;
@ -1433,7 +1433,7 @@ HWTEST_F(EventTest, givenNonQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestT
}
HWTEST_F(InternalsEventTest, givenCommandWhenSubmitCalledThenUpdateFlushStamp) {
auto pCmdQ = std::unique_ptr<CommandQueue>(new CommandQueue(mockContext, pClDevice, 0));
auto pCmdQ = std::unique_ptr<MockCommandQueue>(new MockCommandQueue(mockContext, pClDevice, 0));
MockEvent<Event> *event = new MockEvent<Event>(pCmdQ.get(), CL_COMMAND_MARKER, 0, 0);
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
csr.flushStamp->setStamp(5);
@ -1447,7 +1447,7 @@ HWTEST_F(InternalsEventTest, givenCommandWhenSubmitCalledThenUpdateFlushStamp) {
}
HWTEST_F(InternalsEventTest, givenAbortedCommandWhenSubmitCalledThenDontUpdateFlushStamp) {
auto pCmdQ = std::unique_ptr<CommandQueue>(new CommandQueue(mockContext, pClDevice, 0));
auto pCmdQ = std::unique_ptr<MockCommandQueue>(new MockCommandQueue(mockContext, pClDevice, 0));
MockEvent<Event> *event = new MockEvent<Event>(pCmdQ.get(), CL_COMMAND_MARKER, 0, 0);
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
csr.flushStamp->setStamp(5);

View File

@ -10,6 +10,7 @@
#include "opencl/source/event/event.h"
#include "opencl/source/event/event_tracker.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "event_fixture.h"
@ -78,7 +79,7 @@ TEST(EventsTracker, whenCallLabelFunctionWhenEventIsNotInMapThenGetStringWithout
}
TEST(EventsTracker, whenCallLabelFunctionThenGetStringWithProperCmdqId) {
CommandQueue cmdq;
MockCommandQueue cmdq;
std::string expect = "cq" + std::to_string(reinterpret_cast<uintptr_t>(&cmdq));
@ -86,7 +87,7 @@ TEST(EventsTracker, whenCallLabelFunctionThenGetStringWithProperCmdqId) {
}
TEST(EventsTracker, givenNullptrCmdqThenNotDumping) {
CommandQueue *cmdq_ptr = nullptr;
MockCommandQueue *cmdq_ptr = nullptr;
std::stringstream stream;
std::set<CommandQueue *> dumped;
@ -97,7 +98,7 @@ TEST(EventsTracker, givenNullptrCmdqThenNotDumping) {
}
TEST(EventsTracker, givenAlreadyDumpedCmdqThenNotDumping) {
CommandQueue cmdq;
MockCommandQueue cmdq;
std::stringstream stream;
std::set<CommandQueue *> dumped;
@ -109,7 +110,7 @@ TEST(EventsTracker, givenAlreadyDumpedCmdqThenNotDumping) {
}
TEST(EventsTracker, givenCmqdWithTaskCountAndLevelNotReadyThenDumpingCmdqWithNotReadyLabels) {
CommandQueue cmdq;
MockCommandQueue cmdq;
cmdq.taskCount = CompletionStamp::levelNotReady;
cmdq.taskLevel = CompletionStamp::levelNotReady;
@ -125,7 +126,7 @@ TEST(EventsTracker, givenCmqdWithTaskCountAndLevelNotReadyThenDumpingCmdqWithNot
}
TEST(EventsTracker, whenCallDumpQueueThenDumpingCmdqWithProperCountTaskAndLevelValues) {
CommandQueue cmdq;
MockCommandQueue cmdq;
cmdq.taskCount = 3;
cmdq.taskLevel = 1;
@ -228,7 +229,7 @@ TEST(EventsTracker, givenEventAndUserEventThenDumpingNodeWithProperLabels) {
TEST(EventsTracker, givenCmdqAndItsVirtualEventThenDumpingWithProperLabels) {
MockContext ctx;
CommandQueue cmdq;
MockCommandQueue cmdq;
VirtualEvent vEvent(&cmdq, &ctx);
vEvent.setCurrentCmdQVirtualEvent(true);
vEvent.updateTaskCount(1);
@ -391,7 +392,7 @@ TEST(EventsTracker, givenAlreadyDumpedEventThenNotDumpingGraph) {
TEST(EventsTracker, givenCmdqAndItsVirtualEventThenDumpingProperGraph) {
MockContext ctx;
CommandQueue cmdq;
MockCommandQueue cmdq;
VirtualEvent vEvent(&cmdq, &ctx);
vEvent.setCurrentCmdQVirtualEvent(true);
vEvent.updateTaskCount(1);

View File

@ -21,6 +21,7 @@
#include "opencl/test/unit_test/fixtures/device_fixture.h"
#include "opencl/test/unit_test/fixtures/image_fixture.h"
#include "opencl/test/unit_test/mocks/mock_buffer.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_platform.h"
#include "gmock/gmock.h"
@ -99,7 +100,7 @@ typedef ::testing::Types<
//Kernel,
//Sampler
//others...
CommandQueue,
MockCommandQueue,
DeviceQueue>
BaseObjectTypes;
@ -109,7 +110,7 @@ typedef ::testing::Types<
Context,
Program,
Buffer,
CommandQueue,
MockCommandQueue,
DeviceQueue>
BaseObjectTypesForCastInvalidMagicTest;

View File

@ -8,13 +8,14 @@
#include "opencl/source/accelerators/intel_accelerator.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/source/platform/platform.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "gtest/gtest.h"
namespace NEO {
TEST(BaseObjectTestsMt, givenObjectOwnershipForEachThreadWhenIncrementingNonAtomicValueThenNoDataRacesAreExpected) {
CommandQueue *object = new CommandQueue;
MockCommandQueue *object = new MockCommandQueue;
object->takeOwnership();
uint32_t counter = 0;
const uint32_t loopCount = 50;

View File

@ -98,7 +98,7 @@ TEST(CommandTest, givenWaitlistRequestWhenCommandComputeKernelIsCreatedThenMakeL
};
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
CommandQueue cmdQ(nullptr, device.get(), nullptr);
MockCommandQueue cmdQ(nullptr, device.get(), nullptr);
MockKernelWithInternals kernel(*device);
IndirectHeap *ih1 = nullptr, *ih2 = nullptr, *ih3 = nullptr;
@ -130,7 +130,7 @@ TEST(CommandTest, givenWaitlistRequestWhenCommandComputeKernelIsCreatedThenMakeL
TEST(KernelOperationDestruction, givenKernelOperationWhenItIsDestructedThenAllAllocationsAreStoredInInternalStorageForReuse) {
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
CommandQueue cmdQ(nullptr, device.get(), nullptr);
MockCommandQueue cmdQ(nullptr, device.get(), nullptr);
InternalAllocationStorage &allocationStorage = *device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage();
auto &allocationsForReuse = allocationStorage.getAllocationsForReuse();

View File

@ -10,6 +10,7 @@
#include "opencl/test/unit_test/fixtures/device_fixture.h"
#include "opencl/test/unit_test/fixtures/memory_management_fixture.h"
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
#include "test.h"
@ -90,7 +91,7 @@ TEST_F(PipeTest, givenPipeWhenEnqueueWriteForUnmapIsCalledThenReturnError) {
ASSERT_NE(nullptr, pipe);
EXPECT_EQ(CL_SUCCESS, errCode);
CommandQueue cmdQ;
MockCommandQueue cmdQ;
errCode = clEnqueueUnmapMemObject(&cmdQ, pipe.get(), nullptr, 0, nullptr, nullptr);
EXPECT_EQ(CL_INVALID_MEM_OBJECT, errCode);
}
@ -126,4 +127,4 @@ TEST_F(MultiRootDeviceTests, pipeGraphicsAllocationHasCorrectRootDeviceIndex) {
auto graphicsAllocation = pipe->getGraphicsAllocation();
ASSERT_NE(nullptr, graphicsAllocation);
EXPECT_EQ(expectedRootDeviceIndex, graphicsAllocation->getRootDeviceIndex());
}
}

View File

@ -8,12 +8,13 @@
#include "shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests_fixture.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "gtest/gtest.h"
using namespace NEO;
struct CommandQueueMock : public CommandQueue {
struct CommandQueueMock : public MockCommandQueue {
cl_int enqueueSVMUnmap(void *svmPtr,
cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event, bool externalAppCall) override {

View File

@ -64,6 +64,109 @@ class MockCommandQueue : public CommandQueue {
return CommandQueue::waitUntilComplete(taskCountToWait, flushStampToWait, useQuickKmdSleep);
}
cl_int enqueueCopyImage(Image *srcImage, Image *dstImage, const size_t srcOrigin[3],
const size_t dstOrigin[3], const size_t region[3],
cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueFillImage(Image *image, const void *fillColor,
const size_t *origin, const size_t *region, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueFillBuffer(Buffer *buffer, const void *pattern,
size_t patternSize, size_t offset,
size_t size, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueKernel(cl_kernel kernel, cl_uint workDim, const size_t *globalWorkOffset,
const size_t *globalWorkSize, const size_t *localWorkSize,
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueBarrierWithWaitList(cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueSVMMap(cl_bool blockingMap, cl_map_flags mapFlags, void *svmPtr, size_t size,
cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event, bool externalAppCall) override { return CL_SUCCESS; }
cl_int enqueueSVMUnmap(void *svmPtr, cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event, bool externalAppCall) override { return CL_SUCCESS; }
cl_int enqueueSVMFree(cl_uint numSvmPointers, void *svmPointers[],
void(CL_CALLBACK *pfnFreeFunc)(cl_command_queue queue,
cl_uint numSvmPointers,
void *svmPointers[],
void *userData),
void *userData, cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueSVMMemcpy(cl_bool blockingCopy, void *dstPtr, const void *srcPtr, size_t size,
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueSVMMemFill(void *svmPtr, const void *pattern, size_t patternSize, size_t size, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueMarkerWithWaitList(cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueMigrateMemObjects(cl_uint numMemObjects, const cl_mem *memObjects, cl_mem_migration_flags flags,
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueSVMMigrateMem(cl_uint numSvmPointers, const void **svmPointers, const size_t *sizes, const cl_mem_migration_flags flags,
cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueCopyBuffer(Buffer *srcBuffer, Buffer *dstBuffer, size_t srcOffset, size_t dstOffset,
size_t size, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueReadBuffer(Buffer *buffer, cl_bool blockingRead, size_t offset, size_t size, void *ptr,
GraphicsAllocation *mapAllocation, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueReadImage(Image *srcImage, cl_bool blockingRead, const size_t *origin, const size_t *region,
size_t rowPitch, size_t slicePitch, void *ptr,
GraphicsAllocation *mapAllocation, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueWriteImage(Image *dstImage, cl_bool blockingWrite, const size_t *origin, const size_t *region,
size_t inputRowPitch, size_t inputSlicePitch, const void *ptr, GraphicsAllocation *mapAllocation,
cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueCopyBufferRect(Buffer *srcBuffer, Buffer *dstBuffer, const size_t *srcOrigin, const size_t *dstOrigin,
const size_t *region, size_t srcRowPitch, size_t srcSlicePitch, size_t dstRowPitch,
size_t dstSlicePitch, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueWriteBufferRect(Buffer *buffer, cl_bool blockingWrite, const size_t *bufferOrigin,
const size_t *hostOrigin, const size_t *region, size_t bufferRowPitch,
size_t bufferSlicePitch, size_t hostRowPitch, size_t hostSlicePitch,
const void *ptr, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueReadBufferRect(Buffer *buffer, cl_bool blockingRead, const size_t *bufferOrigin,
const size_t *hostOrigin, const size_t *region, size_t bufferRowPitch,
size_t bufferSlicePitch, size_t hostRowPitch, size_t hostSlicePitch,
void *ptr, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueCopyBufferToImage(Buffer *srcBuffer, Image *dstImage, size_t srcOffset,
const size_t *dstOrigin, const size_t *region, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueCopyImageToBuffer(Image *srcImage, Buffer *dstBuffer, const size_t *srcOrigin, const size_t *region,
size_t dstOffset, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int enqueueResourceBarrier(BarrierCommand *resourceBarrier, cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event) override { return CL_SUCCESS; }
cl_int finish() override { return CL_SUCCESS; }
cl_int enqueueInitDispatchGlobals(DispatchGlobalsArgs *dispatchGlobalsArgs, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) override { return CL_SUCCESS; }
cl_int flush() override { return CL_SUCCESS; }
bool releaseIndirectHeapCalled = false;
cl_int writeBufferRetValue = CL_SUCCESS;

View File

@ -10,6 +10,7 @@
#include "opencl/source/device_queue/device_queue.h"
#include "opencl/source/helpers/base_object.h"
#include "opencl/source/sharings/sharing_factory.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_platform.h"
#include "gtest/gtest.h"
@ -33,7 +34,7 @@ typedef ::testing::Types<
//Kernel,
//Sampler
//others...
CommandQueue,
MockCommandQueue,
DeviceQueue>
BaseObjectTypes;