brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 4eacdd6 Raw
66 lines · plain
1! REQUIRES: amdgpu-registered-target2 3! Tests `host_eval` clause code-gen and loop nest bounds on host vs. device.4 5! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa   \6! RUN:   -fdo-concurrent-to-openmp=device %s -o -                           \7! RUN: | FileCheck %s --check-prefix=HOST -vv8 9! RUN: %flang_fc1 -triple amdgcn-amd-amdhsa -emit-hlfir -fopenmp            \10! RUN:   -fopenmp-is-target-device -fdo-concurrent-to-openmp=device %s -o - \11! RUN: | FileCheck %s --check-prefix=DEVICE12 13program do_concurrent_host_eval14    implicit none15    integer :: i, j16 17    do concurrent (i=1:10, j=1:20)18    end do19end program do_concurrent_host_eval20 21! HOST: omp.target host_eval(22! HOST-SAME:    %{{[^[:space:]]+}} -> %[[I_LB:[^,]+]],23! HOST-SAME:    %{{[^[:space:]]+}} -> %[[I_UB:[^,]+]],24! HOST-SAME:    %{{[^[:space:]]+}} -> %[[I_ST:[^,]+]],25! HOST-SAME:    %{{[^[:space:]]+}} -> %[[J_LB:[^,]+]],26! HOST-SAME:    %{{[^[:space:]]+}} -> %[[J_UB:[^,]+]],27! HOST-SAME:    %{{[^[:space:]]+}} -> %[[J_ST:[^,]+]] : {{.*}}) map_entries28 29! HOST: omp.loop_nest ({{.*}}, {{.*}}) : index = (%[[I_LB]], %[[J_LB]]) to30! HOST-SAME:    (%[[I_UB]], %[[J_UB]]) inclusive step31! HOST-SAME:    (%[[I_ST]], %[[J_ST]])32 33! DEVICE: omp.target map_entries(34! DEVICE-SAME:  %{{[^[:space:]]+}} -> %[[I_LB_MAP:[^,]+]],35! DEVICE-SAME:  %{{[^[:space:]]+}} -> %[[I_UB_MAP:[^,]+]],36! DEVICE-SAME:  %{{[^[:space:]]+}} -> %[[I_ST_MAP:[^,]+]],37 38! DEVICE-SAME:  %{{[^[:space:]]+}} -> %[[J_LB_MAP:[^,]+]],39! DEVICE-SAME:  %{{[^[:space:]]+}} -> %[[J_UB_MAP:[^,]+]],40! DEVICE-SAME:  %{{[^[:space:]]+}} -> %[[J_ST_MAP:[^,]+]],41 42! DEVICE-SAME:  %{{[^[:space:]]+}} -> %{{[^,]+}},43! DEVICE-SAME:  %{{[^[:space:]]+}} -> %{{[^,]+}} : {{.*}})44 45! DEVICE: %[[I_LB_DECL:.*]]:2 = hlfir.declare %[[I_LB_MAP]]46! DEVICE: %[[I_LB:.*]] = fir.load %[[I_LB_DECL]]#1 : !fir.ref<index>47 48! DEVICE: %[[I_UB_DECL:.*]]:2 = hlfir.declare %[[I_UB_MAP]]49! DEVICE: %[[I_UB:.*]] = fir.load %[[I_UB_DECL]]#1 : !fir.ref<index>50 51! DEVICE: %[[I_ST_DECL:.*]]:2 = hlfir.declare %[[I_ST_MAP]]52! DEVICE: %[[I_ST:.*]] = fir.load %[[I_ST_DECL]]#1 : !fir.ref<index>53 54! DEVICE: %[[J_LB_DECL:.*]]:2 = hlfir.declare %[[J_LB_MAP]]55! DEVICE: %[[J_LB:.*]] = fir.load %[[J_LB_DECL]]#1 : !fir.ref<index>56 57! DEVICE: %[[J_UB_DECL:.*]]:2 = hlfir.declare %[[J_UB_MAP]]58! DEVICE: %[[J_UB:.*]] = fir.load %[[J_UB_DECL]]#1 : !fir.ref<index>59 60! DEVICE: %[[J_ST_DECL:.*]]:2 = hlfir.declare %[[J_ST_MAP]]61! DEVICE: %[[J_ST:.*]] = fir.load %[[J_ST_DECL]]#1 : !fir.ref<index>62 63! DEVICE: omp.loop_nest ({{.*}}, {{.*}}) : index = (%[[I_LB]], %[[J_LB]]) to64! DEVICE-SAME:    (%[[I_UB]], %[[J_UB]]) inclusive step65! DEVICE-SAME:    (%[[I_ST]], %[[J_ST]])66