[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / rocm-device-libs.cl
blobc536661f04153a0b902f025e1875150dbb8f0405
1 // REQUIRES: amdgpu-registered-target
2 // REQUIRES: !system-windows
4 // Test flush-denormals-to-zero enabled uses oclc_daz_opt_on
6 // RUN: %clang -### -target amdgcn-amd-amdhsa \
7 // RUN: -x cl -mcpu=gfx900 \
8 // RUN: --rocm-path=%S/Inputs/rocm \
9 // RUN: %s \
10 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
14 // Make sure the different denormal default is respected for gfx8
15 // RUN: %clang -### -target amdgcn-amd-amdhsa \
16 // RUN: -x cl -mcpu=gfx803 \
17 // RUN: --rocm-path=%S/Inputs/rocm \
18 // RUN: %s \
19 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX803-DEFAULT,GFX803,WAVE64 %s
23 // Make sure the non-canonical name works
24 // RUN: %clang -### -target amdgcn-amd-amdhsa \
25 // RUN: -x cl -mcpu=fiji \
26 // RUN: --rocm-path=%S/Inputs/rocm \
27 // RUN: %s \
28 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX803-DEFAULT,GFX803,WAVE64 %s
32 // RUN: %clang -### -target amdgcn-amd-amdhsa \
33 // RUN: -x cl -mcpu=gfx900 \
34 // RUN: -cl-denorms-are-zero \
35 // RUN: --rocm-path=%S/Inputs/rocm \
36 // RUN: %s \
37 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DAZ,GFX900,WAVE64 %s
40 // RUN: %clang -### -target amdgcn-amd-amdhsa \
41 // RUN: -x cl -mcpu=gfx803 \
42 // RUN: -cl-denorms-are-zero \
43 // RUN: --rocm-path=%S/Inputs/rocm \
44 // RUN: %s \
45 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DAZ,GFX803,WAVE64 %s
49 // RUN: %clang -### -target amdgcn-amd-amdhsa \
50 // RUN: -x cl -mcpu=gfx803 \
51 // RUN: -cl-finite-math-only \
52 // RUN: --rocm-path=%S/Inputs/rocm \
53 // RUN: %s \
54 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-FINITE-ONLY,GFX803,WAVE64 %s
58 // RUN: %clang -### -target amdgcn-amd-amdhsa \
59 // RUN: -x cl -mcpu=gfx803 \
60 // RUN: -cl-fp32-correctly-rounded-divide-sqrt \
61 // RUN: --rocm-path=%S/Inputs/rocm \
62 // RUN: %s \
63 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-CORRECT-SQRT,GFX803,WAVE64 %s
67 // RUN: %clang -### -target amdgcn-amd-amdhsa \
68 // RUN: -x cl -mcpu=gfx803 \
69 // RUN: -cl-fast-relaxed-math \
70 // RUN: --rocm-path=%S/Inputs/rocm \
71 // RUN: %s \
72 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-FAST-RELAXED,GFX803,WAVE64 %s
76 // RUN: %clang -### -target amdgcn-amd-amdhsa \
77 // RUN: -x cl -mcpu=gfx803 \
78 // RUN: -cl-unsafe-math-optimizations \
79 // RUN: --rocm-path=%S/Inputs/rocm \
80 // RUN: %s 2>&1 | \
81 // RUN: FileCheck --check-prefixes=COMMON,GFX803,WAVE64 %s
83 // RUN: %clang -### -target amdgcn-amd-amdhsa \
84 // RUN: -x cl -mcpu=gfx1010 \
85 // RUN: --rocm-path=%S/Inputs/rocm \
86 // RUN: %s 2>&1 | \
87 // RUN: FileCheck --check-prefix=WAVE32 %s
89 // RUN: %clang -### -target amdgcn-amd-amdhsa \
90 // RUN: -x cl -mcpu=gfx1011 \
91 // RUN: --rocm-path=%S/Inputs/rocm \
92 // RUN: %s 2>&1 | \
93 // RUN: FileCheck --check-prefix=WAVE32 %s
95 // RUN: %clang -### -target amdgcn-amd-amdhsa \
96 // RUN: -x cl -mcpu=gfx1012 \
97 // RUN: --rocm-path=%S/Inputs/rocm \
98 // RUN: %s 2>&1 | \
99 // RUN: FileCheck --check-prefix=WAVE32 %s
102 // RUN: %clang -### -target amdgcn-amd-amdhsa \
103 // RUN: -x cl -mcpu=gfx1010 -mwavefrontsize64 \
104 // RUN: --rocm-path=%S/Inputs/rocm \
105 // RUN: %s 2>&1 | \
106 // RUN: FileCheck --check-prefix=WAVE64 %s
108 // RUN: %clang -### -target amdgcn-amd-amdhsa \
109 // RUN: -x cl -mcpu=gfx1010 -mwavefrontsize64 -mno-wavefrontsize64 \
110 // RUN: --rocm-path=%S/Inputs/rocm \
111 // RUN: %s 2>&1 | \
112 // RUN: FileCheck --check-prefix=WAVE32 %s
114 // Ignore -mno-wavefrontsize64 without wave32 support
115 // RUN: %clang -### -target amdgcn-amd-amdhsa \
116 // RUN: -x cl -mcpu=gfx803 -mno-wavefrontsize64 \
117 // RUN: --rocm-path=%S/Inputs/rocm \
118 // RUN: %s 2>&1 | \
119 // RUN: FileCheck --check-prefixes=GFX803,WAVE64 %s
123 // Test --hip-device-lib-path format
124 // RUN: %clang -### -target amdgcn-amd-amdhsa \
125 // RUN: -x cl -mcpu=gfx900 \
126 // RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode \
127 // RUN: %S/opencl.cl \
128 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
130 // Test environment variable HIP_DEVICE_LIB_PATH
131 // RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm/amdgcn/bitcode %clang -### -target amdgcn-amd-amdhsa \
132 // RUN: -x cl -mcpu=gfx900 \
133 // RUN: %S/opencl.cl \
134 // RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
138 // COMMON: "-triple" "amdgcn-amd-amdhsa"
139 // COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/opencl.bc"
140 // COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ocml.bc"
141 // COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ockl.bc"
143 // GFX900-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_off.bc"
144 // GFX803-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
145 // GFX700-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
146 // COMMON-DAZ-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
149 // COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
150 // COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
151 // COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
154 // COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
155 // COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_on.bc"
156 // COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
159 // COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
160 // COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
161 // COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc"
164 // COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_on.bc"
165 // COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_on.bc"
166 // COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
169 // COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_on.bc"
170 // COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
171 // COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
173 // WAVE64: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_wavefrontsize64_on.bc"
174 // WAVE32: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_wavefrontsize64_off.bc"
176 // GFX900: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_isa_version_900.bc"
177 // GFX803: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_isa_version_803.bc"
179 kernel void func(void);