Skip to content

Commit 3b30c18

Browse files
committed
[Comgr] Fix sincos test with update to folding
We have disabled sincos folding, so we need non-constant args to trigger sincos linking. llvm@04bb8ec
1 parent 944ce1f commit 3b30c18

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

amd/comgr/test-lit/device-lib-linking.cl

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,28 @@ extern const __constant bool __oclc_wavefrontsize64;
2222
extern const __constant int __oclc_ISA_version;
2323
extern const __constant int __oclc_ABI_version;
2424

25-
void kernel device_libs(__global float *status) {
25+
void kernel device_libs(__global float *status, float x, float y, float z) {
2626

2727
if (__oclc_finite_only_opt) status[0] = 1.0;
2828
if (__oclc_unsafe_math_opt) status[1] = 1.0;
29-
if (__oclc_correctly_rounded_sqrt32) status[3] = 1.0;
30-
if (__oclc_wavefrontsize64) status[4] = 1.0;
31-
if (__oclc_ISA_version) status[5] = 1.0;
32-
if (__oclc_ABI_version) status[6] = 1.0;
29+
if (__oclc_correctly_rounded_sqrt32) status[2] = 1.0;
30+
if (__oclc_wavefrontsize64) status[3] = 1.0;
31+
if (__oclc_ISA_version) status[4] = 1.0;
32+
if (__oclc_ABI_version) status[5] = 1.0;
3333

3434
// Math functions to test AMDGPULibCalls Folding optimizations
3535
// fold_sincos()
36-
float x = 0.25;
37-
status[7] = sin(x) + cos(x);
38-
status[8] = cos(x) + sin(x);
36+
status[6] = sin(x) + cos(x);
37+
status[7] = cos(x) + sin(x);
3938

4039
// fold_rootn()
41-
float y = 725.0;
42-
status[9] = rootn(y, 3);
43-
status[10] = rootn(y, -1);
44-
status[11] = rootn(y, -2);
40+
status[8] = rootn(y, 3);
41+
status[9] = rootn(y, -1);
42+
status[10] = rootn(y, -2);
4543

4644
// fold_pow()
47-
float z = 12.16;
48-
status[12] = pow(z, (float) 0.5);
49-
status[13] = powr(y, (float) 7.23);
45+
status[11] = pow(z, (float) 0.5);
46+
status[12] = powr(y, (float) 7.23);
5047

5148
// printf()
5249
printf("testy\n");

0 commit comments

Comments
 (0)