Conversation
…ion if test fails in the second subtest
lakshmih
left a comment
There was a problem hiding this comment.
It isn't clear what additional coverage this is adding or why so would like that clarification
|
Hi, input_ptr is being used as a host_ptr for streams[0], but then it is modified and used for clEnqueueWriteBuffer:
To ensure latest data is seen in input_ptr, the test needs to map streams[0] first before modifying input_ptr as this acts as a synchronisation point between host and device. |
rjodinchr
left a comment
There was a problem hiding this comment.
Please do not format lines you are not changing, this is making the diff very complicated to read.
I agree with the err part at the end.
But I don't see any reason to add the map/unmap. Is it failing on your device?
|
From looking at the change streams[0] (the cl_mem object) is never used again for the rest of the function, so there's no point in trying to synchronize between the host and device when the device memory object is never used again. The error_count accumulation at the end is useful. |
For the second subtest, map streams[0] (created with input_ptr as CL_MEM_USE_HOST_PTR]) before modifying its host_ptr.
Set err to error_count at the end of the test, otherwise if the second subtest fails, it will print the last one failed too.
Rest of changes is formatting.