brintos

brintos / llvm-project-archived public Read only

0
0
Text · 748 B · a501603 Raw
22 lines · plain
1// RUN: fir-opt --split-input-file %s | FileCheck %s2 3module attributes {gpu.container_module} {4  gpu.module @cuda_device_mod {5    gpu.func @_QMmod1Psub1() kernel {6      gpu.return7    }8  }9  func.func @_QMmod1Phost_sub() {10    %0 = fir.alloca i6411    %1 = arith.constant 1 : index12    %asyncTok = cuf.stream_cast %0 : !fir.ref<i64>13    gpu.launch_func [%asyncTok] @cuda_device_mod::@_QMmod1Psub1 blocks in (%1, %1, %1) threads in (%1, %1, %1) args() {cuf.proc_attr = #cuf.cuda_proc<grid_global>}14    return15  }16}17 18// CHECK-LABEL: func.func @_QMmod1Phost_sub()19// CHECK: %[[STREAM:.*]] = fir.alloca i6420// CHECK: %[[TOKEN:.*]] = cuf.stream_cast %[[STREAM]] : !fir.ref<i64>21// CHECK: gpu.launch_func [%[[TOKEN]]] @cuda_device_mod::@_QMmod1Psub122