Implement may_share_memory for GpuArray.

This is needed to have debugmode to don't uselessly warn about op that
declared to be inplace but didn't.