2017-08-11 23:46:22 +08:00
///
/// Perform several driver tests for OpenMP offloading
///
2020-12-13 04:19:50 +08:00
2017-08-11 23:46:22 +08:00
// REQUIRES: clang-driver
// REQUIRES: x86-registered-target
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1
Summary:
Allow AMDGCN as a GPU offloading target for OpenMP during compiler
invocation and allow setting CUDAMode for it.
Originally authored by Greg Rodgers (@gregrodgers).
Reviewers: ronlieb, yaxunl, b-sumner, scchan, JonChesterfield, jdoerfert, sameerds, msearles, hliao, arsenm
Reviewed By: sameerds
Subscribers: sstefan1, jvesely, wdng, arsenm, guansong, dexonsmith, cfe-commits, llvm-commits, gregrodgers
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D79754
2020-05-14 14:09:04 +08:00
// REQUIRES: amdgpu-registered-target
2017-08-11 23:46:22 +08:00
/// ###########################################################################
/// Check -Xopenmp-target uses one of the archs provided when several archs are used.
2017-11-21 22:44:45 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
/ / RUN : - Xopenmp - target - march = sm_35 - Xopenmp - target - march = sm_60 % s 2 > & 1 \
2017-08-11 23:46:22 +08:00
// RUN: | FileCheck -check-prefix=CHK-FOPENMP-TARGET-ARCHS %s
// CHK-FOPENMP-TARGET-ARCHS: ptxas{{.*}}" "--gpu-name" "sm_60"
// CHK-FOPENMP-TARGET-ARCHS: nvlink{{.*}}" "-arch" "sm_60"
/// ###########################################################################
/// Check -Xopenmp-target -march=sm_35 works as expected when two triples are present.
2017-11-21 22:44:45 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp \
/ / RUN : - fopenmp - targets = powerpc64le - ibm - linux - gnu , nvptx64 - nvidia - cuda \
/ / RUN : - Xopenmp - target = nvptx64 - nvidia - cuda - march = sm_35 % s 2 > & 1 \
2017-08-11 23:46:22 +08:00
// RUN: | FileCheck -check-prefix=CHK-FOPENMP-TARGET-COMPILATION %s
// CHK-FOPENMP-TARGET-COMPILATION: ptxas{{.*}}" "--gpu-name" "sm_35"
// CHK-FOPENMP-TARGET-COMPILATION: nvlink{{.*}}" "-arch" "sm_35"
/// ###########################################################################
/// Check cubin file generation and usage by nvlink
2017-11-21 22:44:45 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - target powerpc64le - unknown - linux - gnu - fopenmp = libomp \
/ / RUN : - fopenmp - targets = nvptx64 - nvidia - cuda - save - temps % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-CUBIN-NVLINK %s
/// Check cubin file generation and usage by nvlink when toolchain has BindArchAction
/ / RUN : % clang - # # # - no - canonical - prefixes - target x86_64 - apple - darwin17 .0 .0 - fopenmp = libomp \
/ / RUN : - fopenmp - targets = nvptx64 - nvidia - cuda % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-CUBIN-NVLINK %s
2019-10-10 04:42:58 +08:00
// CHK-CUBIN-NVLINK: clang{{.*}}" {{.*}}"-fopenmp-is-device" {{.*}}"-o" "[[PTX:.*\.s]]"
2017-11-21 22:44:45 +08:00
// CHK-CUBIN-NVLINK-NEXT: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX]]"
// CHK-CUBIN-NVLINK-NEXT: nvlink{{.*}}" {{.*}}"[[CUBIN]]"
/// ###########################################################################
2017-08-11 23:46:22 +08:00
2017-11-21 22:44:45 +08:00
/// Check unbundlink of assembly file, cubin file generation and usage by nvlink
// RUN: touch %t.s
2017-11-21 23:06:28 +08:00
/ / RUN : % clang - # # # - target powerpc64le - unknown - linux - gnu - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
/ / RUN : - no - canonical - prefixes - save - temps % t . s 2 > & 1 \
2017-11-21 22:44:45 +08:00
// RUN: | FileCheck -check-prefix=CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK %s
2017-08-11 23:46:22 +08:00
2017-11-21 22:44:45 +08:00
/// Use DAG to ensure that assembly file has been unbundled.
// CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX:.*\.s]]"
// CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG: clang-offload-bundler{{.*}}" "-type=s" {{.*}}"-outputs={{.*}}[[PTX]]
// CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG-SAME: "-unbundle"
// CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK: nvlink{{.*}}" {{.*}}"[[CUBIN]]"
2017-08-11 23:46:22 +08:00
/// ###########################################################################
2017-11-21 22:44:45 +08:00
/// Check cubin file generation and bundling
2017-11-21 23:06:28 +08:00
/ / RUN : % clang - # # # - target powerpc64le - unknown - linux - gnu - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
/ / RUN : - no - canonical - prefixes - save - temps % s - c 2 > & 1 \
2017-11-21 22:44:45 +08:00
// RUN: | FileCheck -check-prefix=CHK-PTXAS-CUBIN-BUNDLING %s
2017-08-11 23:46:22 +08:00
2017-11-21 22:44:45 +08:00
// CHK-PTXAS-CUBIN-BUNDLING: clang{{.*}}" "-o" "[[PTX:.*\.s]]"
// CHK-PTXAS-CUBIN-BUNDLING-NEXT: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX]]"
// CHK-PTXAS-CUBIN-BUNDLING: clang-offload-bundler{{.*}}" "-type=o" {{.*}}"-inputs={{.*}}[[CUBIN]]
2017-08-11 23:46:22 +08:00
/// ###########################################################################
2017-11-21 22:44:45 +08:00
/// Check cubin file unbundling and usage by nvlink
// RUN: touch %t.o
2017-11-21 23:06:28 +08:00
/ / RUN : % clang - # # # - target powerpc64le - unknown - linux - gnu - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
2018-09-29 00:17:59 +08:00
/ / RUN : - no - canonical - prefixes - save - temps % t . o % S / Inputs / in . so 2 > & 1 \
2017-11-21 22:44:45 +08:00
// RUN: | FileCheck -check-prefix=CHK-CUBIN-UNBUNDLING-NVLINK %s
2017-08-11 23:46:22 +08:00
2017-11-21 22:44:45 +08:00
/// Use DAG to ensure that cubin file has been unbundled.
2018-09-29 00:17:59 +08:00
// CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so
2017-11-21 22:44:45 +08:00
// CHK-CUBIN-UNBUNDLING-NVLINK-DAG: nvlink{{.*}}" {{.*}}"[[CUBIN:.*\.cubin]]"
// CHK-CUBIN-UNBUNDLING-NVLINK-DAG: clang-offload-bundler{{.*}}" "-type=o" {{.*}}"-outputs={{.*}}[[CUBIN]]
// CHK-CUBIN-UNBUNDLING-NVLINK-DAG-SAME: "-unbundle"
2018-09-29 00:17:59 +08:00
// CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so
2017-08-11 23:46:22 +08:00
/// ###########################################################################
2017-11-21 22:44:45 +08:00
/// Check cubin file generation and usage by nvlink
2017-08-11 23:46:22 +08:00
// RUN: touch %t1.o
// RUN: touch %t2.o
2017-11-21 22:44:45 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - target powerpc64le - unknown - linux - gnu - fopenmp = libomp \
/ / RUN : - fopenmp - targets = nvptx64 - nvidia - cuda % t1 . o % t2 . o 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-TWOCUBIN %s
/// Check cubin file generation and usage by nvlink when toolchain has BindArchAction
/ / RUN : % clang - # # # - no - canonical - prefixes - target x86_64 - apple - darwin17 .0 .0 - fopenmp = libomp \
/ / RUN : - fopenmp - targets = nvptx64 - nvidia - cuda % t1 . o % t2 . o 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-TWOCUBIN %s
2017-08-11 23:46:22 +08:00
2017-11-21 22:44:45 +08:00
// CHK-TWOCUBIN: nvlink{{.*}}openmp-offload-{{.*}}.cubin" "{{.*}}openmp-offload-{{.*}}.cubin"
2017-08-11 23:46:22 +08:00
/// ###########################################################################
/// Check PTXAS is passed -c flag when offloading to an NVIDIA device using OpenMP.
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - no - canonical - prefixes % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-PTXAS-DEFAULT %s
// CHK-PTXAS-DEFAULT: ptxas{{.*}}" "-c"
/// ###########################################################################
/// PTXAS is passed -c flag by default when offloading to an NVIDIA device using OpenMP - disable it.
2017-11-21 22:44:45 +08:00
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - fnoopenmp - relocatable - target \
/ / RUN : - save - temps - no - canonical - prefixes % s 2 > & 1 \
2017-08-11 23:46:22 +08:00
// RUN: | FileCheck -check-prefix=CHK-PTXAS-NORELO %s
// CHK-PTXAS-NORELO-NOT: ptxas{{.*}}" "-c"
/// ###########################################################################
/// PTXAS is passed -c flag by default when offloading to an NVIDIA device using OpenMP
/// Check that the flag is passed when -fopenmp-relocatable-target is used.
2017-11-21 22:44:45 +08:00
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - fopenmp - relocatable - target \
/ / RUN : - save - temps - no - canonical - prefixes % s 2 > & 1 \
2017-08-11 23:46:22 +08:00
// RUN: | FileCheck -check-prefix=CHK-PTXAS-RELO %s
// CHK-PTXAS-RELO: ptxas{{.*}}" "-c"
2017-09-26 05:56:32 +08:00
/// ###########################################################################
/// Check that error is not thrown by toolchain when no cuda lib flag is used.
/// Check that the flag is passed when -fopenmp-relocatable-target is used.
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 \
/ / RUN : - nocudalib - fopenmp - relocatable - target - save - temps - no - canonical - prefixes % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-FLAG-NOLIBDEVICE %s
// CHK-FLAG-NOLIBDEVICE-NOT: error:{{.*}}sm_60
2017-09-26 23:36:20 +08:00
/// ###########################################################################
/// Check that error is not thrown by toolchain when no cuda lib device is found when using -S.
/// Check that the flag is passed when -fopenmp-relocatable-target is used.
/ / RUN : % clang - # # # - S - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 \
/ / RUN : - fopenmp - relocatable - target - save - temps - no - canonical - prefixes % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-NOLIBDEVICE %s
// CHK-NOLIBDEVICE-NOT: error:{{.*}}sm_60
2018-03-14 07:19:52 +08:00
/// ###########################################################################
/// Check that the runtime bitcode library is part of the compile line. Create a bogus
/// bitcode library and add it to the LIBRARY_PATH.
/ / RUN : env LIBRARY_PATH = % S / Inputs / libomptarget % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
2021-02-22 23:59:55 +08:00
/ / RUN : - Xopenmp - target - march = sm_35 - - cuda - path = % S / Inputs / CUDA_102 / usr / local / cuda \
2018-03-14 07:19:52 +08:00
/ / RUN : - fopenmp - relocatable - target - save - temps - no - canonical - prefixes % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-BCLIB %s
2021-01-24 03:42:32 +08:00
/// The user can override default detection using --libomptarget-nvptx-bc-path=.
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
/ / RUN : - - libomptarget - nvptx - bc - path = % S / Inputs / libomptarget / libomptarget - nvptx - test . bc \
2021-02-22 23:59:55 +08:00
/ / RUN : - Xopenmp - target - march = sm_35 - - cuda - path = % S / Inputs / CUDA_102 / usr / local / cuda \
2018-09-28 00:12:32 +08:00
/ / RUN : - fopenmp - relocatable - target - save - temps - no - canonical - prefixes % s 2 > & 1 \
2021-01-24 03:42:32 +08:00
// RUN: | FileCheck -check-prefix=CHK-BCLIB-USER %s
2018-03-14 07:19:52 +08:00
2021-03-09 01:02:55 +08:00
// CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_35.bc
2021-01-24 03:42:32 +08:00
// CHK-BCLIB-USER: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
2018-03-14 07:19:52 +08:00
// CHK-BCLIB-NOT: {{error:|warning:}}
/// ###########################################################################
/// Check that the warning is thrown when the libomptarget bitcode library is not found.
2021-02-21 04:13:22 +08:00
/// Libomptarget requires sm_35 or newer so an sm_35 bitcode library should never exist.
2018-03-14 07:19:52 +08:00
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
2021-02-22 23:59:55 +08:00
/ / RUN : - Xopenmp - target - march = sm_35 - - cuda - path = % S / Inputs / CUDA_102 / usr / local / cuda \
2018-03-14 07:19:52 +08:00
/ / RUN : - fopenmp - relocatable - target - save - temps - no - canonical - prefixes % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-BCLIB-WARN %s
2021-03-09 01:02:55 +08:00
// CHK-BCLIB-WARN: No library 'libomptarget-nvptx-sm_35.bc' found in the default clang lib directory or in LIBRARY_PATH. Please use --libomptarget-nvptx-bc-path to specify nvptx bitcode library.
2021-01-24 03:42:32 +08:00
/// ###########################################################################
/// Check that the error is thrown when the libomptarget bitcode library does not exist.
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
2021-02-22 23:59:55 +08:00
/ / RUN : - Xopenmp - target - march = sm_35 - - cuda - path = % S / Inputs / CUDA_102 / usr / local / cuda \
2021-01-24 03:42:32 +08:00
/ / RUN : - - libomptarget - nvptx - bc - path = not - exist . bc \
/ / RUN : - fopenmp - relocatable - target - save - temps - no - canonical - prefixes % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-BCLIB-ERROR %s
// CHK-BCLIB-ERROR: Bitcode library 'not-exist.bc' does not exist.
2018-04-19 00:31:09 +08:00
2021-02-22 23:59:55 +08:00
/// ###########################################################################
/// Check that the error is thrown when CUDA 9.1 or lower version is used.
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
/ / RUN : - Xopenmp - target - march = sm_35 - - cuda - path = % S / Inputs / CUDA_90 / usr / local / cuda \
/ / RUN : - fopenmp - relocatable - target - save - temps - no - canonical - prefixes % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=CHK-CUDA-VERSION-ERROR %s
// CHK-CUDA-VERSION-ERROR: NVPTX target requires CUDA 9.2 or above. CUDA 9.0 is detected.
2018-04-19 00:31:09 +08:00
/// Check that debug info is emitted in dwarf-2
2018-12-12 22:52:27 +08:00
/ / 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 \
// RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s
2018-04-19 00:31:09 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 % s - g - O3 2 > & 1 \
2018-12-12 22:52:27 +08:00
// RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s
2018-04-19 00:31:09 +08:00
/ / 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 \
2018-12-12 22:52:27 +08:00
// RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s
2018-04-19 00:31:09 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 % s - g0 2 > & 1 \
// RUN: | FileCheck -check-prefix=NO_DEBUG %s
/ / 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 \
// RUN: | FileCheck -check-prefix=NO_DEBUG %s
2018-12-12 22:52:27 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 % s - gline - directives - only 2 > & 1 \
// RUN: | FileCheck -check-prefix=DEBUG_DIRECTIVES %s
2018-04-19 00:31:09 +08:00
2018-12-12 22:52:27 +08:00
// DEBUG_DIRECTIVES-NOT: warning: debug
2018-07-28 03:45:14 +08:00
// NO_DEBUG-NOT: warning: debug
2018-12-12 22:52:27 +08:00
// NO_DEBUG: "-fopenmp-is-device"
// NO_DEBUG-NOT: "-debug-info-kind=
2018-04-19 00:31:09 +08:00
// NO_DEBUG: ptxas
2018-12-12 22:52:27 +08:00
// DEBUG_DIRECTIVES: "-triple" "nvptx64-nvidia-cuda"
// DEBUG_DIRECTIVES-SAME: "-debug-info-kind=line-directives-only"
// DEBUG_DIRECTIVES-SAME: "-fopenmp-is-device"
// DEBUG_DIRECTIVES: ptxas
// DEBUG_DIRECTIVES: "-lineinfo"
2018-04-19 00:31:09 +08:00
// NO_DEBUG-NOT: "-g"
// NO_DEBUG: nvlink
// NO_DEBUG-NOT: "-g"
2018-12-12 22:52:27 +08:00
/ / 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 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
2018-04-19 00:31:09 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 % s - g 2 > & 1 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
/ / 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 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
/ / 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 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 % s - g2 2 > & 1 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
/ / 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 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
/ / 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 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
/ / 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 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
2018-12-12 22:52:27 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 % s - gline - tables - only 2 > & 1 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
/ / 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 \
// RUN: | FileCheck -check-prefix=HAS_DEBUG %s
2018-04-19 00:31:09 +08:00
2018-07-28 03:45:14 +08:00
// HAS_DEBUG-NOT: warning: debug
2018-04-19 00:31:09 +08:00
// HAS_DEBUG: "-triple" "nvptx64-nvidia-cuda"
2020-07-29 02:23:59 +08:00
// HAS_DEBUG-SAME: "-debug-info-kind={{limited|line-tables-only}}"
2018-04-19 00:31:09 +08:00
// HAS_DEBUG-SAME: "-dwarf-version=2"
// HAS_DEBUG-SAME: "-fopenmp-is-device"
// HAS_DEBUG: ptxas
// HAS_DEBUG-SAME: "-g"
// HAS_DEBUG-SAME: "--dont-merge-basicblocks"
// HAS_DEBUG-SAME: "--return-at-end"
// HAS_DEBUG: nvlink
// HAS_DEBUG-SAME: "-g"
2018-08-30 22:45:24 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 % s - fopenmp - cuda - mode 2 > & 1 \
// RUN: | FileCheck -check-prefix=CUDA_MODE %s
/ / 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 \
// RUN: | FileCheck -check-prefix=CUDA_MODE %s
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1
Summary:
Allow AMDGCN as a GPU offloading target for OpenMP during compiler
invocation and allow setting CUDAMode for it.
Originally authored by Greg Rodgers (@gregrodgers).
Reviewers: ronlieb, yaxunl, b-sumner, scchan, JonChesterfield, jdoerfert, sameerds, msearles, hliao, arsenm
Reviewed By: sameerds
Subscribers: sstefan1, jvesely, wdng, arsenm, guansong, dexonsmith, cfe-commits, llvm-commits, gregrodgers
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D79754
2020-05-14 14:09:04 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = amdgcn - amd - amdhsa - Xopenmp - target - march = gfx906 % s - fopenmp - cuda - mode 2 > & 1 \
// RUN: | FileCheck -check-prefix=CUDA_MODE %s
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = amdgcn - amd - amdhsa - Xopenmp - target - march = gfx906 % s - fno - openmp - cuda - mode - fopenmp - cuda - mode 2 > & 1 \
// RUN: | FileCheck -check-prefix=CUDA_MODE %s
// CUDA_MODE: clang{{.*}}"-cc1"{{.*}}"-triple" "{{nvptx64-nvidia-cuda|amdgcn-amd-amdhsa}}"
2018-08-30 22:45:24 +08:00
// CUDA_MODE-SAME: "-fopenmp-cuda-mode"
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda - Xopenmp - target - march = sm_60 % s - fno - openmp - cuda - mode 2 > & 1 \
// RUN: | FileCheck -check-prefix=NO_CUDA_MODE %s
/ / 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 \
// RUN: | FileCheck -check-prefix=NO_CUDA_MODE %s
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1
Summary:
Allow AMDGCN as a GPU offloading target for OpenMP during compiler
invocation and allow setting CUDAMode for it.
Originally authored by Greg Rodgers (@gregrodgers).
Reviewers: ronlieb, yaxunl, b-sumner, scchan, JonChesterfield, jdoerfert, sameerds, msearles, hliao, arsenm
Reviewed By: sameerds
Subscribers: sstefan1, jvesely, wdng, arsenm, guansong, dexonsmith, cfe-commits, llvm-commits, gregrodgers
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D79754
2020-05-14 14:09:04 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = amdgcn - amd - amdhsa - Xopenmp - target - march = gfx906 % s - fno - openmp - cuda - mode 2 > & 1 \
// RUN: | FileCheck -check-prefix=NO_CUDA_MODE %s
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = amdgcn - amd - amdhsa - Xopenmp - target - march = gfx906 % s - fopenmp - cuda - mode - fno - openmp - cuda - mode 2 > & 1 \
// RUN: | FileCheck -check-prefix=NO_CUDA_MODE %s
2018-08-30 22:45:24 +08:00
// NO_CUDA_MODE-NOT: "-{{fno-|f}}openmp-cuda-mode"
/ / 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 \
// RUN: | FileCheck -check-prefix=FULL_RUNTIME %s
/ / 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 \
// RUN: | FileCheck -check-prefix=FULL_RUNTIME %s
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1
Summary:
Allow AMDGCN as a GPU offloading target for OpenMP during compiler
invocation and allow setting CUDAMode for it.
Originally authored by Greg Rodgers (@gregrodgers).
Reviewers: ronlieb, yaxunl, b-sumner, scchan, JonChesterfield, jdoerfert, sameerds, msearles, hliao, arsenm
Reviewed By: sameerds
Subscribers: sstefan1, jvesely, wdng, arsenm, guansong, dexonsmith, cfe-commits, llvm-commits, gregrodgers
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D79754
2020-05-14 14:09:04 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = amdgcn - amd - amdhsa - Xopenmp - target - march = gfx906 % s - fopenmp - cuda - force - full - runtime 2 > & 1 \
// RUN: | FileCheck -check-prefix=FULL_RUNTIME %s
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = amdgcn - amd - amdhsa - Xopenmp - target - march = gfx906 % s - fno - openmp - cuda - force - full - runtime - fopenmp - cuda - force - full - runtime 2 > & 1 \
// RUN: | FileCheck -check-prefix=FULL_RUNTIME %s
// FULL_RUNTIME: clang{{.*}}"-cc1"{{.*}}"-triple" "{{nvptx64-nvidia-cuda|amdgcn-amd-amdhsa}}"
2018-08-30 22:45:24 +08:00
// FULL_RUNTIME-SAME: "-fopenmp-cuda-force-full-runtime"
/ / 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 \
// RUN: | FileCheck -check-prefix=NO_FULL_RUNTIME %s
/ / 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 \
// RUN: | FileCheck -check-prefix=NO_FULL_RUNTIME %s
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1
Summary:
Allow AMDGCN as a GPU offloading target for OpenMP during compiler
invocation and allow setting CUDAMode for it.
Originally authored by Greg Rodgers (@gregrodgers).
Reviewers: ronlieb, yaxunl, b-sumner, scchan, JonChesterfield, jdoerfert, sameerds, msearles, hliao, arsenm
Reviewed By: sameerds
Subscribers: sstefan1, jvesely, wdng, arsenm, guansong, dexonsmith, cfe-commits, llvm-commits, gregrodgers
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D79754
2020-05-14 14:09:04 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = amdgcn - amd - amdhsa - Xopenmp - target - march = gfx906 % s - fno - openmp - cuda - force - full - runtime 2 > & 1 \
// RUN: | FileCheck -check-prefix=NO_FULL_RUNTIME %s
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = amdgcn - amd - amdhsa - Xopenmp - target - march = gfx906 % s - fopenmp - cuda - force - full - runtime - fno - openmp - cuda - force - full - runtime 2 > & 1 \
// RUN: | FileCheck -check-prefix=NO_FULL_RUNTIME %s
2018-08-30 22:45:24 +08:00
// NO_FULL_RUNTIME-NOT: "-{{fno-|f}}openmp-cuda-force-full-runtime"
2019-02-21 00:36:22 +08:00
/ / 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 \
// RUN: | FileCheck -check-prefix=CUDA_RED_RECS %s
// CUDA_RED_RECS: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda"
// CUDA_RED_RECS-SAME: "-fopenmp-cuda-teams-reduction-recs-num=2048"
[OpenMP][Clang] Support for target math functions
Summary:
In this patch we propose a temporary solution to resolving math functions for the NVPTX toolchain, temporary until OpenMP variant is supported by Clang.
We intercept the inclusion of math.h and cmath headers and if we are in the OpenMP-NVPTX case, we re-use CUDA's math function resolution mechanism.
Authors:
@gtbercea
@jdoerfert
Reviewers: hfinkel, caomhin, ABataev, tra
Reviewed By: hfinkel, ABataev, tra
Subscribers: JDevlieghere, mgorny, guansong, cfe-commits, jdoerfert
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61399
llvm-svn: 360265
2019-05-08 23:52:33 +08:00
/ / RUN : % clang - # # # - no - canonical - prefixes - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda % s 2 > & 1 \
// RUN: | FileCheck -check-prefix=OPENMP_NVPTX_WRAPPERS %s
// OPENMP_NVPTX_WRAPPERS: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda"
// OPENMP_NVPTX_WRAPPERS-SAME: "-internal-isystem" "{{.*}}openmp_wrappers"
2021-02-23 20:43:57 +08:00
/ / RUN : % clang - # # # - fopenmp = libomp - fopenmp - targets = nvptx64 - nvidia - cuda \
/ / RUN : - save - temps - no - canonical - prefixes - ccc - print - bindings % s - o openmp - offload - gpu 2 > & 1 \
// RUN: | FileCheck -check-prefix=SAVE_TEMPS_NAMES %s
// SAVE_TEMPS_NAMES-NOT: "GNU::Linker"{{.*}}["[[SAVE_TEMPS_INPUT1:.*\.o]]", "[[SAVE_TEMPS_INPUT1]]"]