File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
mlir/test/Dialect/OpenACC Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -226,3 +226,23 @@ func.func @test(%a: memref<10xf32>) {
226226// CHECK: }
227227// CHECK: acc.yield
228228// CHECK: }
229+
230+ // -----
231+
232+ func.func @test (%a: memref <10 xf32 >) {
233+ %devptr = acc.use_device varPtr (%a : memref <10 xf32 >) varType (tensor <10 xf32 >) -> memref <10 xf32 >
234+ acc.host_data dataOperands (%devptr : memref <10 xf32 >) {
235+ func.call @foo (%a ) : (memref <10 xf32 >) -> ()
236+ acc.terminator
237+ }
238+ return
239+ }
240+ func.func private @foo (memref <10 xf32 >)
241+
242+ // CHECK-LABEL: func.func @test
243+ // CHECK-SAME: (%[[A:.*]]: memref<10xf32>)
244+ // CHECK: %[[USE_DEVICE:.*]] = acc.use_device varPtr(%[[A]] : memref<10xf32>) varType(tensor<10xf32>) -> memref<10xf32>
245+ // CHECK: acc.host_data dataOperands(%[[USE_DEVICE]] : memref<10xf32>) {
246+ // DEVICE: func.call @foo(%[[USE_DEVICE]]) : (memref<10xf32>) -> ()
247+ // CHECK: acc.terminator
248+ // CHECK: }
You can’t perform that action at this time.
0 commit comments