Please change the function to require an `oclMat` instead of `InputArray` to prevent cpu -> gpu upload on every call.