lamblin/Theano — comment on commit b9b760e854ca17510f8e0a6c719edbea05d0d6b7
File: theano/sandbox/cuda/cuda_ndarray.cu line 2922
By lamblin:

The first condition (with all the &&) triggers if none of the two strides are equal to 1. The last two "or" clauses trigger if either stride is negative.
For instance, if "CudaNdarray_HOST_STRIDES(A)[0] == 1", and "CudaNdarray_HOST_STRIDES(A)[1] == -5" , the first clause is false, but we still need to make a copy.