Fix getCommandQueueInfo for param CL_QUEUE_DEVICE_DEFAULT

Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska 2022-01-20 16:17:42 +00:00 committed by Compute-Runtime-Automation
parent 8e03ce9c54
commit 26308a59bc
2 changed files with 16 additions and 0 deletions

View File

@ -104,6 +104,9 @@ cl_int getQueueInfo(QueueType *queue,
case CL_QUEUE_PROPERTIES:
retVal = changeGetInfoStatusToCLResultType(getInfoHelper.set<cl_command_queue_properties>(queue->getCommandQueueProperties()));
break;
case CL_QUEUE_DEVICE_DEFAULT:
retVal = changeGetInfoStatusToCLResultType(getInfoHelper.set<cl_command_queue>(nullptr));
break;
case CL_QUEUE_SIZE:
retVal = CL_INVALID_COMMAND_QUEUE;
break;

View File

@ -93,6 +93,19 @@ TEST_P(GetCommandQueueInfoTest, givenNonDeviceQueueWhenQueryingQueueSizeThenInva
EXPECT_EQ(CL_INVALID_COMMAND_QUEUE, retVal);
}
TEST_P(GetCommandQueueInfoTest, GivenClQueueDeviceDefaultWhenGettingCommandQueueInfoThenSuccessIsReturned) {
cl_command_queue commandQueueReturned = reinterpret_cast<cl_command_queue>(static_cast<uintptr_t>(0x1234));
size_t sizeReturned = 0u;
auto retVal = pCmdQ->getCommandQueueInfo(
CL_QUEUE_DEVICE_DEFAULT,
sizeof(commandQueueReturned),
&commandQueueReturned,
&sizeReturned);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(nullptr, commandQueueReturned);
EXPECT_EQ(sizeof(cl_command_queue), sizeReturned);
}
TEST_P(GetCommandQueueInfoTest, GivenInvalidParameterWhenGettingCommandQueueInfoThenInvalidValueIsReturned) {
cl_uint parameterReturned = 0;
cl_command_queue_info invalidParameter = 0xdeadbeef;