brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · bfb01ca Raw
54 lines · plain
1// RUN: mlir-opt %s -split-input-file -async-parallel-for=async-dispatch=false  \2// RUN: | FileCheck %s --dump-input=always3 4// The structure of @parallel_compute_fn checked in the async dispatch test.5// Here we only check the structure of the sequential dispatch loop.6 7// CHECK-LABEL: @loop_1d8func.func @loop_1d(%arg0: index, %arg1: index, %arg2: index, %arg3: memref<?xf32>) {9  // CHECK: %[[GROUP:.*]] = async.create_group10  // CHECK: scf.for11  // CHECK:   %[[TOKEN:.*]] = async.execute12  // CHECK:     call @parallel_compute_fn13  // CHECK:     async.yield14  // CHECK:   async.add_to_group %[[TOKEN]], %[[GROUP]]15  // CHECK: call @parallel_compute_fn16  // CHECK: async.await_all %[[GROUP]]17  scf.parallel (%i) = (%arg0) to (%arg1) step (%arg2) {18    %one = arith.constant 1.0 : f3219    memref.store %one, %arg3[%i] : memref<?xf32>20  }21  return22}23 24// CHECK-LABEL: func private @parallel_compute_fn25// CHECK:       scf.for26// CHECK:         memref.store27 28// -----29 30// CHECK-LABEL: @loop_2d31func.func @loop_2d(%arg0: index, %arg1: index, %arg2: index, // lb, ub, step32              %arg3: index, %arg4: index, %arg5: index, // lb, ub, step33              %arg6: memref<?x?xf32>) {34  // CHECK: %[[GROUP:.*]] = async.create_group35  // CHECK: scf.for36  // CHECK:   %[[TOKEN:.*]] = async.execute37  // CHECK:     call @parallel_compute_fn38  // CHECK:     async.yield39  // CHECK:   async.add_to_group %[[TOKEN]], %[[GROUP]]40  // CHECK: call @parallel_compute_fn41  // CHECK: async.await_all %[[GROUP]]42  scf.parallel (%i0, %i1) = (%arg0, %arg3) to (%arg1, %arg4)43                            step (%arg2, %arg5) {44    %one = arith.constant 1.0 : f3245    memref.store %one, %arg6[%i0, %i1] : memref<?x?xf32>46  }47  return48}49 50// CHECK-LABEL: func private @parallel_compute_fn51// CHECK:       scf.for52// CHECK:         scf.for53// CHECK:           memref.store54