2018-08-15 23:25:25 +08:00
|
|
|
// REQUIRES: clang-driver
|
|
|
|
// REQUIRES: amdgpu-registered-target
|
2020-04-11 06:47:48 +08:00
|
|
|
// REQUIRES: !system-windows
|
2018-08-15 23:25:25 +08:00
|
|
|
|
|
|
|
// Test flush-denormals-to-zero enabled uses oclc_daz_opt_on
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx900 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure the different denormal default is respected for gfx8
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx803 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-DEFAULT,GFX803-DEFAULT,GFX803,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure the non-canonical name works
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=fiji \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-DEFAULT,GFX803-DEFAULT,GFX803,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx900 \
|
|
|
|
// RUN: -cl-denorms-are-zero \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-DAZ,GFX900,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx803 \
|
|
|
|
// RUN: -cl-denorms-are-zero \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-DAZ,GFX803,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx803 \
|
|
|
|
// RUN: -cl-finite-math-only \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-FINITE-ONLY,GFX803,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx803 \
|
|
|
|
// RUN: -cl-fp32-correctly-rounded-divide-sqrt \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-CORRECT-SQRT,GFX803,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx803 \
|
|
|
|
// RUN: -cl-fast-relaxed-math \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-FAST-RELAXED,GFX803,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx803 \
|
|
|
|
// RUN: -cl-unsafe-math-optimizations \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-UNSAFE,GFX803,WAVE64 %s
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx1010 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMMON,GFX1010,WAVE32 %s
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx1011 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMMON,GFX1011,WAVE32 %s
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx1012 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMMON,GFX1012,WAVE32 %s
|
|
|
|
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx1010 -mwavefrontsize64 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMMON,GFX1010,WAVE64 %s
|
|
|
|
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx1010 -mwavefrontsize64 -mno-wavefrontsize64 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMMON,GFX1010,WAVE32 %s
|
|
|
|
|
|
|
|
// Ignore -mno-wavefrontsize64 without wave32 support
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx803 -mno-wavefrontsize64 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --rocm-path=%S/Inputs/rocm \
|
2020-04-13 12:16:46 +08:00
|
|
|
// RUN: %s \
|
2018-08-15 23:25:25 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMMON,GFX803,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
HIP: Merge builtin library handling
Merge with the new --rocm-path handling used for OpenCL. This looks
for a usable set of device libraries upfront, rather than giving a
generic "no such file or directory error". If any of the required
bitcode libraries are missing, this will now produce a "cannot find
ROCm installation." error. This differs from the existing hip specific
flags by pointing to a rocm root install instead of a single directory
with bitcode files.
This tries to maintain compatibility with the existing the
--hip-device-lib and --hip-device-lib-path flags, as well as the
HIP_DEVICE_LIB_PATH environment variable, or at least the range of
uses with testcases. The existing range of uses and behavior doesn't
entirely make sense to me, so some of the untested edge cases change
behavior. Currently the two path forms seem to have the double purpose
of a search path for an arbitrary --hip-device-lib, and for finding
the stock set of libraries. Since the stock set of libraries This also
changes the behavior when multiple paths are specified, and only takes
the last one (and the environment variable only handles a single
path).
If --hip-device-lib is used, it now only treats --hip-device-lib-path
as the search path for it, and does not attempt to find the rocm
installation. If not, --hip-device-lib-path and the environment
variable are used as the directory to search instead of the rocm root
based path.
This should also automatically fix handling of the options to use
wave64.
2020-03-28 00:28:24 +08:00
|
|
|
// Test --hip-device-lib-path format
|
|
|
|
// RUN: %clang -### -target amdgcn-amd-amdhsa \
|
|
|
|
// RUN: -x cl -mcpu=gfx900 \
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode \
|
HIP: Merge builtin library handling
Merge with the new --rocm-path handling used for OpenCL. This looks
for a usable set of device libraries upfront, rather than giving a
generic "no such file or directory error". If any of the required
bitcode libraries are missing, this will now produce a "cannot find
ROCm installation." error. This differs from the existing hip specific
flags by pointing to a rocm root install instead of a single directory
with bitcode files.
This tries to maintain compatibility with the existing the
--hip-device-lib and --hip-device-lib-path flags, as well as the
HIP_DEVICE_LIB_PATH environment variable, or at least the range of
uses with testcases. The existing range of uses and behavior doesn't
entirely make sense to me, so some of the untested edge cases change
behavior. Currently the two path forms seem to have the double purpose
of a search path for an arbitrary --hip-device-lib, and for finding
the stock set of libraries. Since the stock set of libraries This also
changes the behavior when multiple paths are specified, and only takes
the last one (and the environment variable only handles a single
path).
If --hip-device-lib is used, it now only treats --hip-device-lib-path
as the search path for it, and does not attempt to find the rocm
installation. If not, --hip-device-lib-path and the environment
variable are used as the directory to search instead of the rocm root
based path.
This should also automatically fix handling of the options to use
wave64.
2020-03-28 00:28:24 +08:00
|
|
|
// RUN: %S/opencl.cl \
|
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
|
|
|
|
|
|
|
|
// Test environment variable HIP_DEVICE_LIB_PATH
|
2020-06-06 04:49:38 +08:00
|
|
|
// RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm/amdgcn/bitcode %clang -### -target amdgcn-amd-amdhsa \
|
HIP: Merge builtin library handling
Merge with the new --rocm-path handling used for OpenCL. This looks
for a usable set of device libraries upfront, rather than giving a
generic "no such file or directory error". If any of the required
bitcode libraries are missing, this will now produce a "cannot find
ROCm installation." error. This differs from the existing hip specific
flags by pointing to a rocm root install instead of a single directory
with bitcode files.
This tries to maintain compatibility with the existing the
--hip-device-lib and --hip-device-lib-path flags, as well as the
HIP_DEVICE_LIB_PATH environment variable, or at least the range of
uses with testcases. The existing range of uses and behavior doesn't
entirely make sense to me, so some of the untested edge cases change
behavior. Currently the two path forms seem to have the double purpose
of a search path for an arbitrary --hip-device-lib, and for finding
the stock set of libraries. Since the stock set of libraries This also
changes the behavior when multiple paths are specified, and only takes
the last one (and the environment variable only handles a single
path).
If --hip-device-lib is used, it now only treats --hip-device-lib-path
as the search path for it, and does not attempt to find the rocm
installation. If not, --hip-device-lib-path and the environment
variable are used as the directory to search instead of the rocm root
based path.
This should also automatically fix handling of the options to use
wave64.
2020-03-28 00:28:24 +08:00
|
|
|
// RUN: -x cl -mcpu=gfx900 \
|
|
|
|
// RUN: %S/opencl.cl \
|
|
|
|
// RUN: 2>&1 | FileCheck -dump-input-on-failure --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-15 23:25:25 +08:00
|
|
|
// COMMON: "-triple" "amdgcn-amd-amdhsa"
|
2020-04-11 00:56:20 +08:00
|
|
|
// COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/opencl.bc"
|
|
|
|
// COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ocml.bc"
|
|
|
|
// COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ockl.bc"
|
2018-08-15 23:25:25 +08:00
|
|
|
|
2020-04-11 00:56:20 +08:00
|
|
|
// GFX900-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_off.bc"
|
|
|
|
// GFX803-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
|
|
|
|
// GFX700-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
|
|
|
|
// COMMON-DAZ-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
|
2018-08-15 23:25:25 +08:00
|
|
|
|
|
|
|
|
2020-04-11 00:56:20 +08:00
|
|
|
// COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
|
|
|
|
// COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
|
|
|
|
// COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
|
2018-08-15 23:25:25 +08:00
|
|
|
|
|
|
|
|
2020-04-11 00:56:20 +08:00
|
|
|
// COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
|
|
|
|
// COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_on.bc"
|
|
|
|
// COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
|
2018-08-15 23:25:25 +08:00
|
|
|
|
|
|
|
|
2020-04-11 00:56:20 +08:00
|
|
|
// COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
|
|
|
|
// COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
|
|
|
|
// COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc"
|
2018-08-15 23:25:25 +08:00
|
|
|
|
|
|
|
|
2020-04-11 00:56:20 +08:00
|
|
|
// COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_on.bc"
|
|
|
|
// COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_on.bc"
|
|
|
|
// COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
|
2018-08-15 23:25:25 +08:00
|
|
|
|
|
|
|
|
2020-04-11 00:56:20 +08:00
|
|
|
// COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_on.bc"
|
|
|
|
// COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
|
|
|
|
// COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
|
2018-08-15 23:25:25 +08:00
|
|
|
|
2020-04-11 00:56:20 +08:00
|
|
|
// WAVE64: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_wavefrontsize64_on.bc"
|
|
|
|
// WAVE32: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_wavefrontsize64_off.bc"
|
2018-08-15 23:25:25 +08:00
|
|
|
|
2020-04-11 00:56:20 +08:00
|
|
|
// GFX900: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_isa_version_900.bc"
|
|
|
|
// GFX803: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_isa_version_803.bc"
|
2020-04-13 12:16:46 +08:00
|
|
|
|
|
|
|
kernel void func(void);
|