Debian Codegraph @

flang/test/Lower/OpenACC/acc-device-type.f90

raw
1 ! This test checks lowering of OpenACC device_type clause on directive where its
2 ! position and the clauses that follow have special semantic
3
4 ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
5
6 subroutine sub1()
7
8 !$acc parallel num_workers(16)
9 !$acc end parallel
10
11 ! CHECK: acc.parallel num_workers(%c16{{.*}} : i32) {
12
13 !$acc parallel num_workers(1) device_type(nvidia) num_workers(16)
14 !$acc end parallel
15
16 ! CHECK: acc.parallel num_workers(%c1{{.*}} : i32, %c16{{.*}} : i32 [#acc.device_type<nvidia>])
17
18 !$acc parallel device_type(*) num_workers(1) device_type(nvidia) num_workers(16)
19 !$acc end parallel
20
21 ! CHECK: acc.parallel num_workers(%c1{{.*}} : i32 [#acc.device_type<star>], %c16{{.*}} : i32 [#acc.device_type<nvidia>])
22
23 !$acc parallel vector_length(1)
24 !$acc end parallel
25
26 ! CHECK: acc.parallel vector_length(%c1{{.*}} : i32)
27
28 !$acc parallel device_type(multicore) vector_length(1)
29 !$acc end parallel
30
31 ! CHECK: acc.parallel vector_length(%c1{{.*}} : i32 [#acc.device_type<multicore>])
32
33 !$acc parallel num_gangs(2) device_type(nvidia) num_gangs(4)
34 !$acc end parallel
35
36 ! CHECK: acc.parallel num_gangs({%c2{{.*}} : i32}, {%c4{{.*}} : i32} [#acc.device_type<nvidia>])
37
38 !$acc parallel num_gangs(2) device_type(nvidia) num_gangs(1, 1, 1)
39 !$acc end parallel
40
41 ! CHECK: acc.parallel num_gangs({%c2{{.*}} : i32}, {%c1{{.*}} : i32, %c1{{.*}} : i32, %c1{{.*}} : i32} [#acc.device_type<nvidia>])
42
43 !$acc parallel device_type(nvidia, default) num_gangs(1, 1, 1)
44 !$acc end parallel
45
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>])
47
48 end subroutine