Debian Codegraph @

flang/test/Fir/CUDA/cuda-external-mangling.mlir

raw
1 // RUN: fir-opt --split-input-file --external-name-interop %s | FileCheck %s
2
3 module @mod attributes {gpu.container_module} {
4
5 gpu.module @cuda_device_mod {
6 gpu.func @_QPfoo() kernel {
7 fir.call @_QPthreadfence() fastmath<contract> : () -> ()
8 gpu.return
9 }
10 func.func private @_QPthreadfence() attributes {cuf.proc_attr = #cuf.cuda_proc<device>}
11 }
12
13 func.func @test() -> () {
14 %0 = llvm.mlir.constant(0 : i64) : i64
15 %1 = llvm.mlir.constant(0 : i32) : i32
16 gpu.launch_func @cuda_device_mod::@_QPfoo blocks in (%0, %0, %0) threads in (%0, %0, %0) : i64 dynamic_shared_memory_size %1
17 return
18 }
19
20 // CHECK-LABEL: gpu.func @foo_()
21 // CHECK: fir.call @threadfence_()
22 // CHECK: func.func private @threadfence_()
23 // CHECK: gpu.launch_func @cuda_device_mod::@foo_
24
25 }