Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 1 | /// |
| 2 | /// Perform several driver tests for OpenMP offloading |
| 3 | /// |
| 4 | |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 5 | // REQUIRES: clang-driver |
| 6 | // REQUIRES: x86-registered-target |
| 7 | // REQUIRES: powerpc-registered-target |
| 8 | // REQUIRES: nvptx-registered-target |
| 9 | |
| 10 | /// ########################################################################### |
| 11 | |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 12 | /// Check -Xopenmp-target uses one of the archs provided when several archs are used. |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 13 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ |
| 14 | // RUN: -Xopenmp-target -march=sm_35 -Xopenmp-target -march=sm_60 %s 2>&1 \ |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 15 | // RUN: | FileCheck -check-prefix=CHK-FOPENMP-TARGET-ARCHS %s |
| 16 | |
| 17 | // CHK-FOPENMP-TARGET-ARCHS: ptxas{{.*}}" "--gpu-name" "sm_60" |
| 18 | // CHK-FOPENMP-TARGET-ARCHS: nvlink{{.*}}" "-arch" "sm_60" |
| 19 | |
| 20 | /// ########################################################################### |
| 21 | |
| 22 | /// Check -Xopenmp-target -march=sm_35 works as expected when two triples are present. |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 23 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp \ |
| 24 | // RUN: -fopenmp-targets=powerpc64le-ibm-linux-gnu,nvptx64-nvidia-cuda \ |
| 25 | // RUN: -Xopenmp-target=nvptx64-nvidia-cuda -march=sm_35 %s 2>&1 \ |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 26 | // RUN: | FileCheck -check-prefix=CHK-FOPENMP-TARGET-COMPILATION %s |
| 27 | |
| 28 | // CHK-FOPENMP-TARGET-COMPILATION: ptxas{{.*}}" "--gpu-name" "sm_35" |
| 29 | // CHK-FOPENMP-TARGET-COMPILATION: nvlink{{.*}}" "-arch" "sm_35" |
| 30 | |
| 31 | /// ########################################################################### |
| 32 | |
Jonas Hahnfeld | a981f67 | 2018-09-27 16:12:32 +0000 | [diff] [blame] | 33 | /// Check that -lomptarget-nvptx is passed to nvlink. |
| 34 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp \ |
| 35 | // RUN: -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \ |
| 36 | // RUN: | FileCheck -check-prefix=CHK-NVLINK %s |
| 37 | /// Check that the value of --libomptarget-nvptx-path is forwarded to nvlink. |
| 38 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp \ |
| 39 | // RUN: --libomptarget-nvptx-path=/path/to/libomptarget/ \ |
| 40 | // RUN: -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \ |
| 41 | // RUN: | FileCheck -check-prefixes=CHK-NVLINK,CHK-LIBOMPTARGET-NVPTX-PATH %s |
| 42 | |
| 43 | // CHK-NVLINK: nvlink |
| 44 | // CHK-LIBOMPTARGET-NVPTX-PATH-SAME: "-L/path/to/libomptarget/" |
| 45 | // CHK-NVLINK-SAME: "-lomptarget-nvptx" |
| 46 | |
| 47 | /// ########################################################################### |
| 48 | |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 49 | /// Check cubin file generation and usage by nvlink |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 50 | // RUN: %clang -### -no-canonical-prefixes -target powerpc64le-unknown-linux-gnu -fopenmp=libomp \ |
| 51 | // RUN: -fopenmp-targets=nvptx64-nvidia-cuda -save-temps %s 2>&1 \ |
| 52 | // RUN: | FileCheck -check-prefix=CHK-CUBIN-NVLINK %s |
| 53 | /// Check cubin file generation and usage by nvlink when toolchain has BindArchAction |
| 54 | // RUN: %clang -### -no-canonical-prefixes -target x86_64-apple-darwin17.0.0 -fopenmp=libomp \ |
| 55 | // RUN: -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \ |
| 56 | // RUN: | FileCheck -check-prefix=CHK-CUBIN-NVLINK %s |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 57 | |
Sergey Dmitriev | a0d8376 | 2019-10-09 20:42:58 +0000 | [diff] [blame] | 58 | // CHK-CUBIN-NVLINK: clang{{.*}}" {{.*}}"-fopenmp-is-device" {{.*}}"-o" "[[PTX:.*\.s]]" |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 59 | // CHK-CUBIN-NVLINK-NEXT: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX]]" |
| 60 | // CHK-CUBIN-NVLINK-NEXT: nvlink{{.*}}" {{.*}}"[[CUBIN]]" |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 61 | |
| 62 | /// ########################################################################### |
| 63 | |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 64 | /// Check unbundlink of assembly file, cubin file generation and usage by nvlink |
| 65 | // RUN: touch %t.s |
Jonas Hahnfeld | 4609b25 | 2017-11-21 15:06:28 +0000 | [diff] [blame] | 66 | // RUN: %clang -### -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ |
| 67 | // RUN: -no-canonical-prefixes -save-temps %t.s 2>&1 \ |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 68 | // RUN: | FileCheck -check-prefix=CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK %s |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 69 | |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 70 | /// Use DAG to ensure that assembly file has been unbundled. |
| 71 | // CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX:.*\.s]]" |
| 72 | // CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG: clang-offload-bundler{{.*}}" "-type=s" {{.*}}"-outputs={{.*}}[[PTX]] |
| 73 | // CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG-SAME: "-unbundle" |
| 74 | // CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK: nvlink{{.*}}" {{.*}}"[[CUBIN]]" |
| 75 | |
| 76 | /// ########################################################################### |
| 77 | |
| 78 | /// Check cubin file generation and bundling |
Jonas Hahnfeld | 4609b25 | 2017-11-21 15:06:28 +0000 | [diff] [blame] | 79 | // RUN: %clang -### -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ |
| 80 | // RUN: -no-canonical-prefixes -save-temps %s -c 2>&1 \ |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 81 | // RUN: | FileCheck -check-prefix=CHK-PTXAS-CUBIN-BUNDLING %s |
| 82 | |
| 83 | // CHK-PTXAS-CUBIN-BUNDLING: clang{{.*}}" "-o" "[[PTX:.*\.s]]" |
| 84 | // CHK-PTXAS-CUBIN-BUNDLING-NEXT: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX]]" |
| 85 | // CHK-PTXAS-CUBIN-BUNDLING: clang-offload-bundler{{.*}}" "-type=o" {{.*}}"-inputs={{.*}}[[CUBIN]] |
| 86 | |
| 87 | /// ########################################################################### |
| 88 | |
| 89 | /// Check cubin file unbundling and usage by nvlink |
| 90 | // RUN: touch %t.o |
Jonas Hahnfeld | 4609b25 | 2017-11-21 15:06:28 +0000 | [diff] [blame] | 91 | // RUN: %clang -### -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ |
Alexey Bataev | a5178f5 | 2018-09-28 16:17:59 +0000 | [diff] [blame] | 92 | // RUN: -no-canonical-prefixes -save-temps %t.o %S/Inputs/in.so 2>&1 \ |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 93 | // RUN: | FileCheck -check-prefix=CHK-CUBIN-UNBUNDLING-NVLINK %s |
| 94 | |
| 95 | /// Use DAG to ensure that cubin file has been unbundled. |
Alexey Bataev | a5178f5 | 2018-09-28 16:17:59 +0000 | [diff] [blame] | 96 | // CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 97 | // CHK-CUBIN-UNBUNDLING-NVLINK-DAG: nvlink{{.*}}" {{.*}}"[[CUBIN:.*\.cubin]]" |
| 98 | // CHK-CUBIN-UNBUNDLING-NVLINK-DAG: clang-offload-bundler{{.*}}" "-type=o" {{.*}}"-outputs={{.*}}[[CUBIN]] |
| 99 | // CHK-CUBIN-UNBUNDLING-NVLINK-DAG-SAME: "-unbundle" |
Alexey Bataev | a5178f5 | 2018-09-28 16:17:59 +0000 | [diff] [blame] | 100 | // CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 101 | |
| 102 | /// ########################################################################### |
| 103 | |
| 104 | /// Check cubin file generation and usage by nvlink |
| 105 | // RUN: touch %t1.o |
| 106 | // RUN: touch %t2.o |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 107 | // RUN: %clang -### -no-canonical-prefixes -target powerpc64le-unknown-linux-gnu -fopenmp=libomp \ |
| 108 | // RUN: -fopenmp-targets=nvptx64-nvidia-cuda %t1.o %t2.o 2>&1 \ |
| 109 | // RUN: | FileCheck -check-prefix=CHK-TWOCUBIN %s |
| 110 | /// Check cubin file generation and usage by nvlink when toolchain has BindArchAction |
| 111 | // RUN: %clang -### -no-canonical-prefixes -target x86_64-apple-darwin17.0.0 -fopenmp=libomp \ |
| 112 | // RUN: -fopenmp-targets=nvptx64-nvidia-cuda %t1.o %t2.o 2>&1 \ |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 113 | // RUN: | FileCheck -check-prefix=CHK-TWOCUBIN %s |
| 114 | |
Gheorghe-Teodor Bercea | 5636f4b | 2017-09-25 21:25:38 +0000 | [diff] [blame] | 115 | // CHK-TWOCUBIN: nvlink{{.*}}openmp-offload-{{.*}}.cubin" "{{.*}}openmp-offload-{{.*}}.cubin" |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 116 | |
| 117 | /// ########################################################################### |
| 118 | |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 119 | /// Check PTXAS is passed -c flag when offloading to an NVIDIA device using OpenMP. |
| 120 | // RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -no-canonical-prefixes %s 2>&1 \ |
| 121 | // RUN: | FileCheck -check-prefix=CHK-PTXAS-DEFAULT %s |
| 122 | |
| 123 | // CHK-PTXAS-DEFAULT: ptxas{{.*}}" "-c" |
| 124 | |
| 125 | /// ########################################################################### |
| 126 | |
| 127 | /// PTXAS is passed -c flag by default when offloading to an NVIDIA device using OpenMP - disable it. |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 128 | // RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -fnoopenmp-relocatable-target \ |
| 129 | // RUN: -save-temps -no-canonical-prefixes %s 2>&1 \ |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 130 | // RUN: | FileCheck -check-prefix=CHK-PTXAS-NORELO %s |
| 131 | |
| 132 | // CHK-PTXAS-NORELO-NOT: ptxas{{.*}}" "-c" |
| 133 | |
| 134 | /// ########################################################################### |
| 135 | |
| 136 | /// PTXAS is passed -c flag by default when offloading to an NVIDIA device using OpenMP |
| 137 | /// Check that the flag is passed when -fopenmp-relocatable-target is used. |
Jonas Hahnfeld | 7c78cc5 | 2017-11-21 14:44:45 +0000 | [diff] [blame] | 138 | // RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp-relocatable-target \ |
| 139 | // RUN: -save-temps -no-canonical-prefixes %s 2>&1 \ |
Gheorghe-Teodor Bercea | 9c52574 | 2017-08-11 15:46:22 +0000 | [diff] [blame] | 140 | // RUN: | FileCheck -check-prefix=CHK-PTXAS-RELO %s |
| 141 | |
| 142 | // CHK-PTXAS-RELO: ptxas{{.*}}" "-c" |
Gheorghe-Teodor Bercea | 20789a5 | 2017-09-25 21:56:32 +0000 | [diff] [blame] | 143 | |
| 144 | /// ########################################################################### |
| 145 | |
| 146 | /// Check that error is not thrown by toolchain when no cuda lib flag is used. |
| 147 | /// Check that the flag is passed when -fopenmp-relocatable-target is used. |
| 148 | // RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 \ |
| 149 | // RUN: -nocudalib -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \ |
| 150 | // RUN: | FileCheck -check-prefix=CHK-FLAG-NOLIBDEVICE %s |
| 151 | |
| 152 | // CHK-FLAG-NOLIBDEVICE-NOT: error:{{.*}}sm_60 |
Gheorghe-Teodor Bercea | 5a3608c | 2017-09-26 15:36:20 +0000 | [diff] [blame] | 153 | |
| 154 | /// ########################################################################### |
| 155 | |
| 156 | /// Check that error is not thrown by toolchain when no cuda lib device is found when using -S. |
| 157 | /// Check that the flag is passed when -fopenmp-relocatable-target is used. |
| 158 | // RUN: %clang -### -S -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 \ |
| 159 | // RUN: -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \ |
| 160 | // RUN: | FileCheck -check-prefix=CHK-NOLIBDEVICE %s |
| 161 | |
| 162 | // CHK-NOLIBDEVICE-NOT: error:{{.*}}sm_60 |
Gheorghe-Teodor Bercea | 0d5aa84 | 2018-03-13 23:19:52 +0000 | [diff] [blame] | 163 | |
| 164 | /// ########################################################################### |
| 165 | |
| 166 | /// Check that the runtime bitcode library is part of the compile line. Create a bogus |
| 167 | /// bitcode library and add it to the LIBRARY_PATH. |
| 168 | // RUN: env LIBRARY_PATH=%S/Inputs/libomptarget %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ |
| 169 | // RUN: -Xopenmp-target -march=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda \ |
| 170 | // RUN: -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \ |
| 171 | // RUN: | FileCheck -check-prefix=CHK-BCLIB %s |
Jonas Hahnfeld | a981f67 | 2018-09-27 16:12:32 +0000 | [diff] [blame] | 172 | /// The user can override default detection using --libomptarget-nvptx-path=. |
| 173 | // RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --libomptarget-nvptx-path=%S/Inputs/libomptarget \ |
| 174 | // RUN: -Xopenmp-target -march=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda \ |
| 175 | // RUN: -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \ |
| 176 | // RUN: | FileCheck -check-prefix=CHK-BCLIB %s |
Gheorghe-Teodor Bercea | 0d5aa84 | 2018-03-13 23:19:52 +0000 | [diff] [blame] | 177 | |
Matt Arsenault | a13746b | 2018-08-20 18:16:48 +0000 | [diff] [blame] | 178 | // CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_20.bc |
Gheorghe-Teodor Bercea | 0d5aa84 | 2018-03-13 23:19:52 +0000 | [diff] [blame] | 179 | // CHK-BCLIB-NOT: {{error:|warning:}} |
| 180 | |
| 181 | /// ########################################################################### |
| 182 | |
| 183 | /// Check that the warning is thrown when the libomptarget bitcode library is not found. |
| 184 | /// Libomptarget requires sm_35 or newer so an sm_20 bitcode library should never exist. |
| 185 | // RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ |
| 186 | // RUN: -Xopenmp-target -march=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda \ |
| 187 | // RUN: -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \ |
| 188 | // RUN: | FileCheck -check-prefix=CHK-BCLIB-WARN %s |
| 189 | |
| 190 | // CHK-BCLIB-WARN: No library 'libomptarget-nvptx-sm_20.bc' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices. |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 191 | |
| 192 | /// Check that debug info is emitted in dwarf-2 |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 193 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O1 --no-cuda-noopt-device-debug 2>&1 \ |
| 194 | // RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 195 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O3 2>&1 \ |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 196 | // RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 197 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O3 --no-cuda-noopt-device-debug 2>&1 \ |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 198 | // RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 199 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g0 2>&1 \ |
| 200 | // RUN: | FileCheck -check-prefix=NO_DEBUG %s |
| 201 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb0 -O3 --cuda-noopt-device-debug 2>&1 \ |
| 202 | // RUN: | FileCheck -check-prefix=NO_DEBUG %s |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 203 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -gline-directives-only 2>&1 \ |
| 204 | // RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 205 | |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 206 | // DEBUG_DIRECTIVES-NOT: warning: debug |
Alexey Bataev | b83b4e4 | 2018-07-27 19:45:14 +0000 | [diff] [blame] | 207 | // NO_DEBUG-NOT: warning: debug |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 208 | // NO_DEBUG: "-fopenmp-is-device" |
| 209 | // NO_DEBUG-NOT: "-debug-info-kind= |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 210 | // NO_DEBUG: ptxas |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 211 | // DEBUG_DIRECTIVES: "-triple" "nvptx64-nvidia-cuda" |
| 212 | // DEBUG_DIRECTIVES-SAME: "-debug-info-kind=line-directives-only" |
| 213 | // DEBUG_DIRECTIVES-SAME: "-fopenmp-is-device" |
| 214 | // DEBUG_DIRECTIVES: ptxas |
| 215 | // DEBUG_DIRECTIVES: "-lineinfo" |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 216 | // NO_DEBUG-NOT: "-g" |
| 217 | // NO_DEBUG: nvlink |
| 218 | // NO_DEBUG-NOT: "-g" |
| 219 | |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 220 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O0 --no-cuda-noopt-device-debug 2>&1 \ |
| 221 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 222 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g 2>&1 \ |
| 223 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
| 224 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O0 --cuda-noopt-device-debug 2>&1 \ |
| 225 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
| 226 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O3 --cuda-noopt-device-debug 2>&1 \ |
| 227 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
| 228 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g2 2>&1 \ |
| 229 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
| 230 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb2 -O0 --cuda-noopt-device-debug 2>&1 \ |
| 231 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
| 232 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g3 -O3 --cuda-noopt-device-debug 2>&1 \ |
| 233 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
| 234 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb3 -O2 --cuda-noopt-device-debug 2>&1 \ |
| 235 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 236 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -gline-tables-only 2>&1 \ |
| 237 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
| 238 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb1 -O2 --cuda-noopt-device-debug 2>&1 \ |
| 239 | // RUN: | FileCheck -check-prefix=HAS_DEBUG %s |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 240 | |
Alexey Bataev | b83b4e4 | 2018-07-27 19:45:14 +0000 | [diff] [blame] | 241 | // HAS_DEBUG-NOT: warning: debug |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 242 | // HAS_DEBUG: "-triple" "nvptx64-nvidia-cuda" |
Alexey Bataev | c92fc3c | 2018-12-12 14:52:27 +0000 | [diff] [blame] | 243 | // HAS_DEBUG-SAME: "-debug-info-kind={{limited|line-tables-only}}" |
Alexey Bataev | e36c67b | 2018-04-18 16:31:09 +0000 | [diff] [blame] | 244 | // HAS_DEBUG-SAME: "-dwarf-version=2" |
| 245 | // HAS_DEBUG-SAME: "-fopenmp-is-device" |
| 246 | // HAS_DEBUG: ptxas |
| 247 | // HAS_DEBUG-SAME: "-g" |
| 248 | // HAS_DEBUG-SAME: "--dont-merge-basicblocks" |
| 249 | // HAS_DEBUG-SAME: "--return-at-end" |
| 250 | // HAS_DEBUG: nvlink |
| 251 | // HAS_DEBUG-SAME: "-g" |
| 252 | |
Alexey Bataev | 80a9a61 | 2018-08-30 14:45:24 +0000 | [diff] [blame] | 253 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-mode 2>&1 \ |
| 254 | // RUN: | FileCheck -check-prefix=CUDA_MODE %s |
| 255 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-mode -fopenmp-cuda-mode 2>&1 \ |
| 256 | // RUN: | FileCheck -check-prefix=CUDA_MODE %s |
| 257 | // CUDA_MODE: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda" |
| 258 | // CUDA_MODE-SAME: "-fopenmp-cuda-mode" |
| 259 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-mode 2>&1 \ |
| 260 | // RUN: | FileCheck -check-prefix=NO_CUDA_MODE %s |
| 261 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-mode -fno-openmp-cuda-mode 2>&1 \ |
| 262 | // RUN: | FileCheck -check-prefix=NO_CUDA_MODE %s |
| 263 | // NO_CUDA_MODE-NOT: "-{{fno-|f}}openmp-cuda-mode" |
| 264 | |
| 265 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-force-full-runtime 2>&1 \ |
| 266 | // RUN: | FileCheck -check-prefix=FULL_RUNTIME %s |
| 267 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-force-full-runtime -fopenmp-cuda-force-full-runtime 2>&1 \ |
| 268 | // RUN: | FileCheck -check-prefix=FULL_RUNTIME %s |
| 269 | // FULL_RUNTIME: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda" |
| 270 | // FULL_RUNTIME-SAME: "-fopenmp-cuda-force-full-runtime" |
| 271 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-force-full-runtime 2>&1 \ |
| 272 | // RUN: | FileCheck -check-prefix=NO_FULL_RUNTIME %s |
| 273 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-force-full-runtime -fno-openmp-cuda-force-full-runtime 2>&1 \ |
| 274 | // RUN: | FileCheck -check-prefix=NO_FULL_RUNTIME %s |
| 275 | // NO_FULL_RUNTIME-NOT: "-{{fno-|f}}openmp-cuda-force-full-runtime" |
Alexey Bataev | 8061acd | 2019-02-20 16:36:22 +0000 | [diff] [blame] | 276 | |
| 277 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-teams-reduction-recs-num=2048 2>&1 \ |
| 278 | // RUN: | FileCheck -check-prefix=CUDA_RED_RECS %s |
| 279 | // CUDA_RED_RECS: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda" |
| 280 | // CUDA_RED_RECS-SAME: "-fopenmp-cuda-teams-reduction-recs-num=2048" |
Gheorghe-Teodor Bercea | e62c693 | 2019-05-08 15:52:33 +0000 | [diff] [blame] | 281 | |
| 282 | // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \ |
| 283 | // RUN: | FileCheck -check-prefix=OPENMP_NVPTX_WRAPPERS %s |
| 284 | // OPENMP_NVPTX_WRAPPERS: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda" |
| 285 | // OPENMP_NVPTX_WRAPPERS-SAME: "-internal-isystem" "{{.*}}openmp_wrappers" |