24 lines · plain
1// RUN: mlir-opt %s --split-input-file --pass-pipeline="builtin.module(func.func(test-acc-pointer-like-interface{test-mode=copy}))" 2>&1 | FileCheck %s2 3func.func @test_copy_static() {4 %src = memref.alloca() {test.src_ptr} : memref<10x20xf32>5 %dest = memref.alloca() {test.dest_ptr} : memref<10x20xf32>6 7 // CHECK: Successfully generated copy from source: %[[SRC:.*]] = memref.alloca() {test.src_ptr} : memref<10x20xf32> to destination: %[[DEST:.*]] = memref.alloca() {test.dest_ptr} : memref<10x20xf32>8 // CHECK: Generated: memref.copy %[[SRC]], %[[DEST]] : memref<10x20xf32> to memref<10x20xf32>9 return10}11 12// -----13 14func.func @test_copy_dynamic() {15 %c10 = arith.constant 10 : index16 %c20 = arith.constant 20 : index17 %src = memref.alloc(%c10, %c20) {test.src_ptr} : memref<?x?xf32>18 %dest = memref.alloc(%c10, %c20) {test.dest_ptr} : memref<?x?xf32>19 20 // CHECK: Successfully generated copy from source: %[[SRC:.*]] = memref.alloc(%[[C10:.*]], %[[C20:.*]]) {test.src_ptr} : memref<?x?xf32> to destination: %[[DEST:.*]] = memref.alloc(%[[C10]], %[[C20]]) {test.dest_ptr} : memref<?x?xf32>21 // CHECK: Generated: memref.copy %[[SRC]], %[[DEST]] : memref<?x?xf32> to memref<?x?xf32>22 return23}24