! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s ! Test CUDA Fortran procedures available in cudadevice module attributes(global) subroutine devsub() implicit none integer :: ret call syncthreads() call syncwarp(1) call threadfence() call threadfence_block() call threadfence_system() ret = syncthreads_and(1) ret = syncthreads_count(1) ret = syncthreads_or(1) end ! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc} ! CHECK: fir.call @__syncthreads() ! CHECK: fir.call @__syncwarp(%{{.*}}) fastmath {is_bind_c} : (!fir.ref) -> () ! CHECK: fir.call @__threadfence() ! CHECK: fir.call @__threadfence_block() ! CHECK: fir.call @__threadfence_system() ! CHECK: %{{.*}} = fir.call @__syncthreads_and(%{{.*}}) fastmath {is_bind_c} : (!fir.ref) -> i32 ! CHECK: %{{.*}} = fir.call @__syncthreads_count(%{{.*}}) fastmath {is_bind_c} : (!fir.ref) -> i32 ! CHECK: %{{.*}} = fir.call @__syncthreads_or(%{{.*}}) fastmath {is_bind_c} : (!fir.ref) -> i32 ! CHECK: func.func private @__syncthreads() attributes {cuf.proc_attr = #cuf.cuda_proc, fir.bindc_name = "__syncthreads"} ! CHECK: func.func private @__syncwarp(!fir.ref {cuf.data_attr = #cuf.cuda}) attributes {cuf.proc_attr = #cuf.cuda_proc, fir.bindc_name = "__syncwarp"} ! CHECK: func.func private @__threadfence() attributes {cuf.proc_attr = #cuf.cuda_proc, fir.bindc_name = "__threadfence"} ! CHECK: func.func private @__threadfence_block() attributes {cuf.proc_attr = #cuf.cuda_proc, fir.bindc_name = "__threadfence_block"} ! CHECK: func.func private @__threadfence_system() attributes {cuf.proc_attr = #cuf.cuda_proc, fir.bindc_name = "__threadfence_system"} ! CHECK: func.func private @__syncthreads_and(!fir.ref {cuf.data_attr = #cuf.cuda}) -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc, fir.bindc_name = "__syncthreads_and"} ! CHECK: func.func private @__syncthreads_count(!fir.ref {cuf.data_attr = #cuf.cuda}) -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc, fir.bindc_name = "__syncthreads_count"} ! CHECK: func.func private @__syncthreads_or(!fir.ref {cuf.data_attr = #cuf.cuda}) -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc, fir.bindc_name = "__syncthreads_or"}