-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
a42cce8
to
bb0ff46
Compare
static cl_int clCreateKernelsInProgram_testcreateKernels( | ||
cl_program program, cl_uint num_kernels, cl_kernel *kernels, | ||
cl_uint *num_kernels_ret, int num_calls) { |
There was a problem hiding this comment.
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
tests/test_openclhpp.cpp
Outdated
return CL_SUCCESS; | ||
case 3: | ||
TEST_ASSERT_EQUAL(make_program(1), program); | ||
return CL_DEVICE_NOT_FOUND; |
There was a problem hiding this comment.
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.
ret = programPool[0].createKernels(&kernels); | ||
TEST_ASSERT_EQUAL(CL_SUCCESS, ret); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
8a21a07
to
413d854
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.