comparison clang/test/Driver/hip-device-libs.hip @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 0572611fdcc8
children c4bab56944e8
comparison
equal deleted inserted replaced
220:42394fc6a535 221:79ff65ed7e25
6 // expected denormal mode. 6 // expected denormal mode.
7 7
8 // Test subtarget with flushing on by default. 8 // Test subtarget with flushing on by default.
9 // RUN: %clang -### -target x86_64-linux-gnu \ 9 // RUN: %clang -### -target x86_64-linux-gnu \
10 // RUN: --cuda-gpu-arch=gfx803 \ 10 // RUN: --cuda-gpu-arch=gfx803 \
11 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 11 // RUN: --rocm-path=%S/Inputs/rocm \
12 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 12 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
13 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD 13 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD
14 14
15 15
16 // Test subtarget with flushing off by ddefault. 16 // Test subtarget with flushing off by ddefault.
17 // RUN: %clang -### -target x86_64-linux-gnu \ 17 // RUN: %clang -### -target x86_64-linux-gnu \
18 // RUN: --cuda-gpu-arch=gfx900 \ 18 // RUN: --cuda-gpu-arch=gfx900 \
19 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 19 // RUN: --rocm-path=%S/Inputs/rocm \
20 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 20 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
21 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD 21 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD
22 22
23 23
24 // Test explicit flag, opposite of target default. 24 // Test explicit flag, opposite of target default.
25 // RUN: %clang -### -target x86_64-linux-gnu \ 25 // RUN: %clang -### -target x86_64-linux-gnu \
26 // RUN: --cuda-gpu-arch=gfx900 \ 26 // RUN: --cuda-gpu-arch=gfx900 \
27 // RUN: -fcuda-flush-denormals-to-zero \ 27 // RUN: -fgpu-flush-denormals-to-zero \
28 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 28 // RUN: --rocm-path=%S/Inputs/rocm \
29 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 29 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
30 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD 30 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD
31 31
32 32
33 // Test explicit flag, opposite of target default. 33 // Test explicit flag, opposite of target default.
34 // RUN: %clang -### -target x86_64-linux-gnu \ 34 // RUN: %clang -### -target x86_64-linux-gnu \
35 // RUN: --cuda-gpu-arch=gfx803 \ 35 // RUN: --cuda-gpu-arch=gfx803 \
36 // RUN: -fno-cuda-flush-denormals-to-zero \ 36 // RUN: -fno-gpu-flush-denormals-to-zero \
37 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 37 // RUN: --rocm-path=%S/Inputs/rocm \
38 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 38 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
39 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD 39 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD
40 40
41 41
42 // Test explicit flag, same as target default. 42 // Test explicit flag, same as target default.
43 // RUN: %clang -### -target x86_64-linux-gnu \ 43 // RUN: %clang -### -target x86_64-linux-gnu \
44 // RUN: --cuda-gpu-arch=gfx900 \ 44 // RUN: --cuda-gpu-arch=gfx900 \
45 // RUN: -fno-cuda-flush-denormals-to-zero \ 45 // RUN: -fno-gpu-flush-denormals-to-zero \
46 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 46 // RUN: --rocm-path=%S/Inputs/rocm \
47 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 47 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
48 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD 48 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD
49 49
50 50
51 // Test explicit flag, same as target default. 51 // Test explicit flag, same as target default.
52 // RUN: %clang -### -target x86_64-linux-gnu \ 52 // RUN: %clang -### -target x86_64-linux-gnu \
53 // RUN: --cuda-gpu-arch=gfx803 \ 53 // RUN: --cuda-gpu-arch=gfx803 \
54 // RUN: -fcuda-flush-denormals-to-zero \ 54 // RUN: -fgpu-flush-denormals-to-zero \
55 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 55 // RUN: --rocm-path=%S/Inputs/rocm \
56 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 56 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
57 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD 57 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD
58 58
59 59
60 // Test last flag wins, not flushing 60 // Test last flag wins, not flushing
61 // RUN: %clang -### -target x86_64-linux-gnu \ 61 // RUN: %clang -### -target x86_64-linux-gnu \
62 // RUN: --cuda-gpu-arch=gfx803 \ 62 // RUN: --cuda-gpu-arch=gfx803 \
63 // RUN: -fcuda-flush-denormals-to-zero -fno-cuda-flush-denormals-to-zero \ 63 // RUN: -fgpu-flush-denormals-to-zero -fno-gpu-flush-denormals-to-zero \
64 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 64 // RUN: --rocm-path=%S/Inputs/rocm \
65 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 65 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
66 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD 66 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD
67 67
68 68
69 // RUN: %clang -### -target x86_64-linux-gnu \ 69 // RUN: %clang -### -target x86_64-linux-gnu \
70 // RUN: --cuda-gpu-arch=gfx900 \ 70 // RUN: --cuda-gpu-arch=gfx900 \
71 // RUN: -fcuda-flush-denormals-to-zero -fno-cuda-flush-denormals-to-zero \ 71 // RUN: -fgpu-flush-denormals-to-zero -fno-gpu-flush-denormals-to-zero \
72 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 72 // RUN: --rocm-path=%S/Inputs/rocm \
73 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 73 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
74 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD 74 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD
75 75
76 76
77 // RUN: %clang -### -target x86_64-linux-gnu \ 77 // RUN: %clang -### -target x86_64-linux-gnu \
78 // RUN: --cuda-gpu-arch=gfx900 \ 78 // RUN: --cuda-gpu-arch=gfx900 \
79 // RUN: -fno-cuda-flush-denormals-to-zero -fcuda-flush-denormals-to-zero \ 79 // RUN: -fno-gpu-flush-denormals-to-zero -fgpu-flush-denormals-to-zero \
80 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 80 // RUN: --rocm-path=%S/Inputs/rocm \
81 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 81 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
82 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD 82 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD
83 83
84 84
85 // RUN: %clang -### -target x86_64-linux-gnu \ 85 // RUN: %clang -### -target x86_64-linux-gnu \
86 // RUN: --cuda-gpu-arch=gfx803 \ 86 // RUN: --cuda-gpu-arch=gfx803 \
87 // RUN: -fno-cuda-flush-denormals-to-zero -fcuda-flush-denormals-to-zero \ 87 // RUN: -fno-gpu-flush-denormals-to-zero -fgpu-flush-denormals-to-zero \
88 // RUN: --rocm-path=%S/Inputs/rocm-device-libs \ 88 // RUN: --rocm-path=%S/Inputs/rocm \
89 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 89 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
90 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD 90 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD
91 91
92 92
93 // Test --hip-device-lib-path flag 93 // Test --hip-device-lib-path flag
94 // RUN: %clang -### -target x86_64-linux-gnu \ 94 // RUN: %clang -### -target x86_64-linux-gnu \
95 // RUN: --cuda-gpu-arch=gfx803 \ 95 // RUN: --cuda-gpu-arch=gfx803 -nogpuinc \
96 // RUN: --hip-device-lib-path=%S/Inputs/rocm-device-libs/amdgcn/bitcode \ 96 // RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode \
97 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 97 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
98 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD 98 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD
99 99
100 100
101 // Test environment variable HIP_DEVICE_LIB_PATH 101 // Test environment variable HIP_DEVICE_LIB_PATH
102 // RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm-device-libs/amdgcn/bitcode \ 102 // RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm/amdgcn/bitcode \
103 // RUN: %clang -### -target x86_64-linux-gnu \ 103 // RUN: %clang -### -target x86_64-linux-gnu \
104 // RUN: --cuda-gpu-arch=gfx900 \ 104 // RUN: --cuda-gpu-arch=gfx900 -nogpuinc \
105 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \ 105 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
106 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL 106 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL
107 107
108 // Test --gpu-instrument-lib
109 // RUN: %clang -### -target x86_64-linux-gnu \
110 // RUN: --cuda-gpu-arch=gfx900 \
111 // RUN: --rocm-path=%S/Inputs/rocm \
112 // RUN: --gpu-instrument-lib=%S/Inputs/hip_multiple_inputs/instrument.bc \
113 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
114 // RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,INST
115
116 // Test -fast-math
117 // RUN: %clang -### -target x86_64-linux-gnu --offload-arch=gfx900 \
118 // RUN: -ffast-math --rocm-path=%S/Inputs/rocm \
119 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
120 // RUN: 2>&1 | FileCheck %s --check-prefixes=FAST
121
122 // Test -ffinite-math-only
123 // RUN: %clang -### -target x86_64-linux-gnu --offload-arch=gfx900 \
124 // RUN: -ffinite-math-only --rocm-path=%S/Inputs/rocm \
125 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
126 // RUN: 2>&1 | FileCheck %s --check-prefixes=FINITE
127
128 // Test -funsafe-math-optimizations
129 // RUN: %clang -### -target x86_64-linux-gnu --offload-arch=gfx900 \
130 // RUN: -funsafe-math-optimizations --rocm-path=%S/Inputs/rocm \
131 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
132 // RUN: 2>&1 | FileCheck %s --check-prefixes=UNSAFE
133
134 // Test -fno-hip-fp32-correctly-rounded-divide-sqrt
135 // RUN: %clang -### -target x86_64-linux-gnu --offload-arch=gfx900 \
136 // RUN: -fno-hip-fp32-correctly-rounded-divide-sqrt \
137 // RUN: --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \
138 // RUN: 2>&1 | FileCheck %s --check-prefixes=DIVSQRT
139
140 // ALL-NOT: error:
108 // ALL: {{"[^"]*clang[^"]*"}} 141 // ALL: {{"[^"]*clang[^"]*"}}
109 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}hip.bc" 142 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}hip.bc"
110 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}ocml.bc" 143 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}ocml.bc"
111 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}ockl.bc" 144 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}ockl.bc"
112 145
116 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc" 149 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"
117 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_off.bc" 150 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_off.bc"
118 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc" 151 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"
119 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_wavefrontsize64_on.bc" 152 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_wavefrontsize64_on.bc"
120 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_isa_version_{{[0-9]+}}.bc" 153 // ALL-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_isa_version_{{[0-9]+}}.bc"
154 // INST-SAME: "-mlink-builtin-bitcode" "{{.*}}instrument.bc"
155
156 // FAST: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"
157 // FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_on.bc"
158 // FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_on.bc"
159 // FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"
160
161 // FINITE: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"
162 // FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"
163 // FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_on.bc"
164 // FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"
165
166 // UNSAFE: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"
167 // UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_on.bc"
168 // UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_off.bc"
169 // UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"
170
171 // DIVSQRT: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"
172 // DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"
173 // DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_off.bc"
174 // DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_off.bc"