[Clang] Make OpenMP offloading consistently use the bound architecture (#125135)
[llvm-project.git] / flang / test / Lower / OpenACC / acc-device-type.f90
blobae01d0dc5fcde35defa48b96e88dc759f78c17cb
1 ! This test checks lowering of OpenACC device_type clause on directive where its
2 ! position and the clauses that follow have special semantic
4 ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
6 subroutine sub1()
8 !$acc parallel num_workers(16)
9 !$acc end parallel
11 ! CHECK: acc.parallel num_workers(%c16{{.*}} : i32) {
13 !$acc parallel num_workers(1) device_type(nvidia) num_workers(16)
14 !$acc end parallel
16 ! CHECK: acc.parallel num_workers(%c1{{.*}} : i32, %c16{{.*}} : i32 [#acc.device_type<nvidia>])
18 !$acc parallel device_type(*) num_workers(1) device_type(nvidia) num_workers(16)
19 !$acc end parallel
21 ! CHECK: acc.parallel num_workers(%c1{{.*}} : i32 [#acc.device_type<star>], %c16{{.*}} : i32 [#acc.device_type<nvidia>])
23 !$acc parallel vector_length(1)
24 !$acc end parallel
26 ! CHECK: acc.parallel vector_length(%c1{{.*}} : i32)
28 !$acc parallel device_type(multicore) vector_length(1)
29 !$acc end parallel
31 ! CHECK: acc.parallel vector_length(%c1{{.*}} : i32 [#acc.device_type<multicore>])
33 !$acc parallel num_gangs(2) device_type(nvidia) num_gangs(4)
34 !$acc end parallel
36 ! CHECK: acc.parallel num_gangs({%c2{{.*}} : i32}, {%c4{{.*}} : i32} [#acc.device_type<nvidia>])
38 !$acc parallel num_gangs(2) device_type(nvidia) num_gangs(1, 1, 1)
39 !$acc end parallel
41 ! CHECK: acc.parallel num_gangs({%c2{{.*}} : i32}, {%c1{{.*}} : i32, %c1{{.*}} : i32, %c1{{.*}} : i32} [#acc.device_type<nvidia>])
43 !$acc parallel device_type(nvidia, default) num_gangs(1, 1, 1)
44 !$acc end parallel
46 ! CHECK: acc.parallel num_gangs({%c1{{.*}} : i32, %c1{{.*}} : i32, %c1{{.*}} : i32} [#acc.device_type<nvidia>], {%c1{{.*}} : i32, %c1{{.*}} : i32, %c1{{.*}} : i32} [#acc.device_type<default>])
48 end subroutine