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 createKernels #5

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

Conversation

piotr-wozniak-mobica
Copy link
Collaborator

No description provided.

Comment on lines +4520 to +4522
static cl_int clCreateKernelsInProgram_testcreateKernels(
cl_program program, cl_uint num_kernels, cl_kernel *kernels,
cl_uint *num_kernels_ret, int num_calls) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should test num_kernels value and kernels pointer against nullptr. If that is the case we should return CL_INVALID_VALUE. If this procedure returns CL_SUCCESS then num_kernels_ret should be set to num_kernels

return CL_SUCCESS;
case 3:
TEST_ASSERT_EQUAL(make_program(1), program);
return CL_DEVICE_NOT_FOUND;
Copy link
Collaborator

Choose a reason for hiding this comment

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

In case 3 and 4 we should set num_kernels_ret to zero for consistency.

Comment on lines +4554 to +4555
ret = programPool[0].createKernels(&kernels);
TEST_ASSERT_EQUAL(CL_SUCCESS, ret);
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 also test size of the vector.

@@ -4516,5 +4516,46 @@ void testgetObjectInfo() {
TEST_ASSERT_EQUAL(buffer.getObjectInfo(&type, &bufobj), CL_SUCCESS);
TEST_ASSERT_EQUAL(type, CL_GL_OBJECT_BUFFER);
TEST_ASSERT_EQUAL(bufobj, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is a compilation error. Missing } at the end of this procedure.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@shajder Added some corrections to all comments. Please take a look and review.

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.

3 participants