With `devPtr`, `step` and `refcount` parameter `Allocator` implementation must only allocate device memory for `devPtr`, allocate host memory for `refcount` and return `step`. 

If we pass `GpuMat*` all `Allocator` implementations should do more work : setup all `GpuMat` members like `flag`, `datastart`, `dataend`, etc. 

I don't think it is a good idea. `Allocator` must only allocate memory and return pointers, and `GpuMat` must setup own fields in appropriate way.