cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Ono-Sendai
Journeyman III

Apparent miscompilation of OpenCL program

Hi,

The attached OpenCL program appears to be miscompiled by the AMD Windows drivers, when targeting my HD 7770.

It works fine when targeting the CPU device.

To replicate:

Compile the program with empty compilation flag string.

The kernel needs one argument of a buffer of 4 floats to write to.

Observed behaviour:

The kernel printf output gives:

Values: (0.000000, 0.000000)

Values: (0.000500, 0.000000)

Values: (0.000500, 0.000000)

And the values of the result buffer (argument to kernel) are:

Res: (0.0000000E+000, 0.0000000E+000, 0.0000000E+000, 0)

Expected behaviour:

The kernel printf output gives:

Values: (0.000000, 0.000000)

Values: (0.000500, 0.000000)

Values: (0.000000, 0.000500)

And the values of the result buffer (argument to kernel) are:

Res: (0.0000000E+000, 1.9999668E-004, 0.0000000E+000, 0)

I am guessing this is some kind of register spilling bug or related.

Catalyst Version: 15.7.1

0 Likes
3 Replies
dipak
Big Boss

Hi,

I'm able to reproduce the error on a Hawaii card. It seems an optimization issue. As I checked, the kernel worked as expected if optimization was disabled during compilation [i.e. with flag "-cl-opt-disable" or "-O0" during clBuildProgram ]

Could you please check and confirm?

Regards,

0 Likes

Hi,

I can confirm that if I pass in -cl-opt-disable then the program is compiled correctly.

0 Likes

Hi,

It looks like the above code is working fine with optimization enabled using the latest Crimson 15.11 driver. Could you please check once?

Regards,

0 Likes