Add debug flag to override device enqueue support

Enabling the new debug flag will disable support of device enqueue feature.

Related-To: NEO-4368

Change-Id: Icd17b44986bb682873364a2603633b7e44723a06
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-04-28 13:00:33 +02:00
committed by sys_ocldev
parent bc9e2e1c6a
commit 22f9893495
26 changed files with 184 additions and 87 deletions

View File

@@ -483,6 +483,7 @@ class DeviceQueueHwWithKernel : public ExecutionModelKernelFixture {
public:
void SetUp() override {
ExecutionModelKernelFixture::SetUp();
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(defaultHwInfo);
cl_queue_properties properties[5] = {
CL_QUEUE_PROPERTIES,
CL_QUEUE_ON_DEVICE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
@@ -501,16 +502,22 @@ class DeviceQueueHwWithKernel : public ExecutionModelKernelFixture {
ASSERT_NE(nullptr, devQueue);
}
void TearDown() override {
delete devQueue;
delete context;
delete clDevice;
if (devQueue) {
delete devQueue;
}
if (context) {
delete context;
}
if (clDevice) {
delete clDevice;
}
ExecutionModelKernelFixture::TearDown();
}
Device *device;
ClDevice *clDevice;
DeviceQueue *devQueue;
MockContext *context;
Device *device = nullptr;
ClDevice *clDevice = nullptr;
DeviceQueue *devQueue = nullptr;
MockContext *context = nullptr;
};
HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, WhenSetiingIUpIndirectStateThenDshIsNotUsed) {
@@ -649,7 +656,13 @@ INSTANTIATE_TEST_CASE_P(DeviceQueueHwWithKernel,
::testing::Values(binaryFile),
::testing::ValuesIn(KernelNames)));
typedef testing::Test TheSimplestDeviceQueueFixture;
struct TheSimplestDeviceQueueFixture : testing::Test {
void SetUp() override {
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(defaultHwInfo);
}
void TearDown() override {
}
};
HWCMDTEST_F(IGFX_GEN8_CORE, TheSimplestDeviceQueueFixture, WhenResettingDeviceQueueThenEarlyReturnValuesAreSet) {

View File

@@ -48,11 +48,9 @@ class DeviceQueueTest : public DeviceHostQueueFixture<DeviceQueue> {
using BaseClass = DeviceHostQueueFixture<DeviceQueue>;
void SetUp() override {
BaseClass::SetUp();
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(pContext);
device = pContext->getDevice(0);
if (!device->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
GTEST_SKIP();
}
ASSERT_NE(device, nullptr);
}
@@ -71,19 +69,9 @@ class DeviceQueueTest : public DeviceHostQueueFixture<DeviceQueue> {
ClDevice *device;
};
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueueWhenNoDeviceQueueIsSupported) {
auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues;
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 0;
auto deviceQueue = createQueueObject();
EXPECT_EQ(deviceQueue, nullptr);
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenSingleDeviceQueueIsSupported) {
auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues;
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 1;
auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues;
const_cast<ClDeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = 1;
auto deviceQueue1 = createQueueObject();
ASSERT_NE(deviceQueue1, nullptr);
@@ -94,27 +82,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenSingleDeviceQ
delete deviceQueue1;
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenMultipleDeviceQueuesAreSupported) {
auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues;
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 2;
auto deviceQueue1 = createQueueObject();
ASSERT_NE(deviceQueue1, nullptr);
EXPECT_EQ(deviceQueue1->getReference(), 1);
auto deviceQueue2 = createQueueObject();
ASSERT_NE(deviceQueue2, nullptr);
EXPECT_EQ(deviceQueue2->getReference(), 1);
EXPECT_NE(deviceQueue2, deviceQueue1);
delete deviceQueue1;
delete deviceQueue2;
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
const_cast<ClDeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, GivenDeviceQueueWhenEventPoolIsCreatedThenTimestampResolutionIsSet) {
@@ -238,8 +206,8 @@ typedef DeviceQueueTest DefaultDeviceQueue;
HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenSingleDeviceQueueIsSupported) {
cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_ON_DEVICE_DEFAULT, 0, 0, 0};
auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues;
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 1;
auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues;
const_cast<ClDeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = 1;
auto deviceQueue1 = createQueueObject(properties);
ASSERT_NE(deviceQueue1, nullptr);
@@ -258,14 +226,14 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueW
deviceQueue1->release();
deviceQueue2->release();
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
const_cast<ClDeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenMultipleDeviceQueuesAreSupported) {
cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_ON_DEVICE_DEFAULT, 0, 0, 0};
auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues;
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 2;
auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues;
const_cast<ClDeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = 2;
auto deviceQueue1 = createQueueObject(properties);
ASSERT_NE(deviceQueue1, nullptr);
@@ -284,7 +252,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueW
deviceQueue1->release();
deviceQueue2->release();
const_cast<DeviceInfo *>(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
const_cast<ClDeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
typedef DeviceQueueTest DeviceQueueEventPool;

View File

@@ -17,9 +17,7 @@ class GetDeviceQueueInfoTest : public DeviceHostQueueFixture<DeviceQueue> {
void SetUp() override {
BaseClass::SetUp();
if (!this->pContext->getDevice(0u)->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
GTEST_SKIP();
}
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(pContext);
deviceQueue = createQueueObject(deviceQueueProperties::allProperties);
ASSERT_NE(deviceQueue, nullptr);
}