| 44 | } |
| 45 | |
| 46 | void* tensor2memref(const megdnn::TensorND& tensor) { |
| 47 | switch (tensor.layout.ndim) { |
| 48 | #define cb(i) \ |
| 49 | case i: \ |
| 50 | return tensor2memref_dim<i>(tensor) |
| 51 | |
| 52 | cb(1); |
| 53 | cb(2); |
| 54 | cb(3); |
| 55 | cb(4); |
| 56 | cb(5); |
| 57 | default: |
| 58 | mgb_throw(InternalError, "Unsupported ndim, got %zu", tensor.layout.ndim); |
| 59 | #undef cb |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | } // namespace |
| 64 | MLIRCPUExecutable::MLIRCPUExecutable( |