-
Notifications
You must be signed in to change notification settings - Fork 200
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
Implement Negative Command Queue Tests #2010
base: main
Are you sure you want to change the base?
Implement Negative Command Queue Tests #2010
Conversation
2c71436
to
1e798fa
Compare
TEST_FAIL); | ||
|
||
|
||
err = clSetCommandQueueProperty(reinterpret_cast<cl_command_queue>(context), |
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.
Think these tests could be over ambitious with the reinterpret cast being an invalid object error on all implementations. There was some discussion here about what a valid openCL object is, resulting in merged PR KhronosGroup/OpenCL-Docs#842 that specifies
An OpenCL implementation must check for a
NULL
object to determine if an
object is valid. The behavior for all other invalid objects is implementation-defined.
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.
Agreed. Anything other than NULL is implementation defined so we should ideally skip these tests.
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.
Done.
err = clSetDefaultDeviceCommandQueue(nullptr, deviceID, queue); | ||
test_failure_error_ret( | ||
err, CL_INVALID_CONTEXT, | ||
"clSetDefaultDeviceCommandQueue should return CL_INVALID_CONTEXT when " | ||
"\"context is not a valid context\" using a nullptr", | ||
TEST_FAIL); |
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.
I think a lot of these cases need to be updated to allow for CL_INVALID_OPERATION
as well, when the passed-in device ID does not support a replaceable default on-device queue. This can happen if the device is a pre-OpenCL 2.0 device, or if the device is an OpenCL 3.0 device that does not support a replaceable default.
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.
Done.
return TEST_PASS; | ||
} | ||
|
||
int test_negative_set_command_queue_property(cl_device_id deviceID, |
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.
I think clSetCommandQueueProperty
needs to handle the cases when the device is newer than OpenCL 1.0 and hence can return CL_INVALID_OPERATION
.
See discussion and the latest changes in the now-merged #1182.
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.
Done.
"CL_INVALID_VALUE when: \"values specified in " | ||
"properties are not valid\" using a queue size " | ||
"greater than CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE", | ||
TEST_FAIL); |
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.
Spec:
CL_INVALID_VALUE if values specified in properties are not valid.
CL_INVALID_QUEUE_PROPERTIES if values specified in properties are valid but are not supported by the device.
Looks like this could equally be interpreted as a case for "CL_INVALID_QUEUE_PROPERTIES" since the size itself is "not supported by the device" having exceeded CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE.
Would like to discuss this in the next call.
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.
Agreed on 8/27 to accept either error code (CL_INVALID_VALUE or CL_INVALID_QUEUE_PROPERTIES) for this case. Arm will make this fix in a subsequent patch.
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.
@ahesham-arm Looks like the PR will need updating to address the request above.
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.
Done.
Removing the "focused review" label until the comments above have been addressed. |
1e798fa
to
c87e9e3
Compare
Implement negative tests for the following functions: - clCreateCommandQueueWithProperties - clCreateCommandQueue - clSetDefaultDeviceCommandQueue - clRetainCommandQueue - clReleaseCommandQueue - clGetCommandQueueInfo - clSetCommandQueueProperties Signed-off-by: Chetankumar Mistry <[email protected]> Signed-off-by: Ahmed Hesham <[email protected]>
c87e9e3
to
fc5b5c0
Compare
Implement negative tests for the following functions: