checking clWaitForEvents return code.
fixed store_obstacle_id kernel to handle all cases of edge points.