Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UT for EnqueueCommandBuffer #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kamil-goras-mobica
Copy link
Collaborator

UT for EnqueueCommandBuffer

@@ -3604,6 +3606,54 @@ void testCommandBufferInfoKHRCommandQueues(void)
TEST_ASSERT_EQUAL_PTR(make_command_queue(2), command_queues[2]());
#endif
}

static cl_int clEnqueueCommandBufferKHR_testEnqueueCommandBuffer(
cl_uint num_queues,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could verify num_queues at least once

{
#if defined(cl_khr_command_buffer)
std::vector<cl::CommandQueue> command_queues;
command_queues.emplace_back(commandQueuePool[0]());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's increase number of queues for second call with commandQueuePool[1], thanks

Comment on lines +3650 to +3651
ret = notValidCommandBuffer.enqueueCommandBuffer(command_queues, nullptr, nullptr);
TEST_ASSERT_EQUAL(ret, CL_INVALID_COMMAND_BUFFER_KHR);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least in one case we could deliver wait list. Then it should be tested in clEnqueueCommandBufferKHR_testEnqueueCommandBuffer like this:

    TEST_ASSERT_EQUAL(1, num_events_in_wait_list);
    TEST_ASSERT_EQUAL_PTR(make_event(1), event_wait_list[0]);
    TEST_ASSERT_EQUAL(0, num_calls);

    if (event != nullptr)
    {
        *event = make_event(2);
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shajder Corrections added for all comments

Copy link
Collaborator

@shajder shajder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants