| 48 | } |
| 49 | |
| 50 | inline bool NeedTransformLayout(const DataLayout& input, |
| 51 | const DataLayout& target, |
| 52 | const phi::Place& place, |
| 53 | const TransformFlag& transform_flag) { |
| 54 | if (FLAGS_use_stride_kernel && target == DataLayout::STRIDED) { |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | bool ret = transform_flag.need_trans_layout() && |
| 59 | (input != DataLayout::ALL_LAYOUT && |
| 60 | target != DataLayout::ALL_LAYOUT && input != target); |
| 61 | if (place.GetType() == phi::AllocationType::GPU) { |
| 62 | return false; |
| 63 | } |
| 64 | return ret; |
| 65 | } |
| 66 | |
| 67 | inline bool NeedTransform2Contiguous(bool is_stride_kernel, |
| 68 | bool is_contiguous) { |
no test coverage detected