Return error on device queue creation attempts if not supported.

Change-Id: I571433ec3f02ac7570c85949b636c86efc133abe
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
Mrozek, Michal
2019-09-03 12:57:47 +02:00
committed by sys_ocldev
parent 1635bef9a8
commit c1f0949a67
7 changed files with 39 additions and 5 deletions

View File

@@ -263,6 +263,9 @@ TEST_F(clCreateCommandQueueWithPropertiesApi, GivenDefaultDeviceQueueWithoutQueu
}
HWCMDTEST_F(IGFX_GEN8_CORE, clCreateCommandQueueWithPropertiesApi, GivenNumberOfDevicesGreaterThanMaxWhenCreatingCommandQueueWithPropertiesThenOutOfResourcesErrorIsReturned) {
if (!this->pContext->getDevice(0u)->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
GTEST_SKIP();
}
cl_int retVal = CL_SUCCESS;
auto pDevice = castToObject<Device>(devices[0]);
cl_queue_properties odq[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE, 0, 0};
@@ -287,6 +290,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, clCreateCommandQueueWithPropertiesApi, GivenNumberOf
}
HWCMDTEST_F(IGFX_GEN8_CORE, clCreateCommandQueueWithPropertiesApi, GivenFailedAllocationWhenCreatingCommandQueueWithPropertiesThenOutOfHostMemoryErrorIsReturned) {
if (!this->pContext->getDevice(0u)->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
GTEST_SKIP();
}
InjectedFunction method = [this](size_t failureIndex) {
cl_queue_properties ooq[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | CL_QUEUE_ON_DEVICE_DEFAULT, 0, 0};
auto retVal = CL_INVALID_VALUE;

View File

@@ -27,13 +27,22 @@ struct clSetDefaultDeviceCommandQueueApiTest : public api_tests {
0,
0};
deviceQueue = clCreateCommandQueueWithProperties(pContext, devices[0], properties, &retVal);
ASSERT_NE(nullptr, deviceQueue);
ASSERT_EQ(CL_SUCCESS, retVal);
if (!pContext->getDevice(0u)->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
ASSERT_EQ(nullptr, deviceQueue);
EXPECT_EQ(CL_INVALID_QUEUE_PROPERTIES, retVal);
GTEST_SKIP();
} else {
ASSERT_NE(nullptr, deviceQueue);
ASSERT_EQ(CL_SUCCESS, retVal);
}
}
void TearDown() override {
retVal = clReleaseCommandQueue(deviceQueue);
EXPECT_EQ(CL_SUCCESS, retVal);
if (deviceQueue) {
retVal = clReleaseCommandQueue(deviceQueue);
EXPECT_EQ(CL_SUCCESS, retVal);
}
api_tests::TearDown();
}