1! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s 2! RUN: bbc -emit-hlfir -fcuda %s -o - | fir-opt -convert-hlfir-to-fir | FileCheck %s 3 4! Test lowering of CUDA attribute on procedures. 5 6attributes(host) subroutine sub_host(); end 7! CHECK: func.func @_QPsub_host() attributes {cuf.proc_attr = #cuf.cuda_proc<host>} 8 9attributes(device) subroutine sub_device(); end 10! CHECK: func.func @_QPsub_device() attributes {cuf.proc_attr = #cuf.cuda_proc<device>} 11 12attributes(host) attributes(device) subroutine sub_host_device; end 13! CHECK: func.func @_QPsub_host_device() attributes {cuf.proc_attr = #cuf.cuda_proc<host_device>} 14 15attributes(device) attributes(host) subroutine sub_device_host; end 16! CHECK: func.func @_QPsub_device_host() attributes {cuf.proc_attr = #cuf.cuda_proc<host_device>} 17 18attributes(global) subroutine sub_global(); end 19! CHECK: func.func @_QPsub_global() attributes {cuf.proc_attr = #cuf.cuda_proc<global>} 20 21attributes(grid_global) subroutine sub_grid_global(); end 22! CHECK: func.func @_QPsub_grid_global() attributes {cuf.proc_attr = #cuf.cuda_proc<grid_global>} 23 24attributes(host) integer function fct_host(); end 25! CHECK: func.func @_QPfct_host() -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc<host>} 26 27attributes(device) integer function fct_device(); end 28! CHECK: func.func @_QPfct_device() -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc<device>} 29 30attributes(host) attributes(device) integer function fct_host_device; end 31! CHECK: func.func @_QPfct_host_device() -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc<host_device>} 32 33attributes(device) attributes(host) integer function fct_device_host; end 34! CHECK: func.func @_QPfct_device_host() -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc<host_device>} 35 36attributes(global) launch_bounds(1, 2) subroutine sub_lbounds1(); end 37! CHECK: func.func @_QPsub_lbounds1() attributes {cuf.launch_bounds = #cuf.launch_bounds<maxTPB = 1 : i64, minBPM = 2 : i64>, cuf.proc_attr = #cuf.cuda_proc<global>} 38 39attributes(global) launch_bounds(1, 2, 3) subroutine sub_lbounds2(); end 40! CHECK: func.func @_QPsub_lbounds2() attributes {cuf.launch_bounds = #cuf.launch_bounds<maxTPB = 1 : i64, minBPM = 2 : i64, upperBoundClusterSize = 3 : i64>, cuf.proc_attr = #cuf.cuda_proc<global>} 41 42attributes(global) cluster_dims(1, 2, 3) subroutine sub_clusterdims1(); end 43! CHECK: func.func @_QPsub_clusterdims1() attributes {cuf.cluster_dims = #cuf.cluster_dims<x = 1 : i64, y = 2 : i64, z = 3 : i64>, cuf.proc_attr = #cuf.cuda_proc<global>} 44