Hi
I have just tracked down a bug in a opencl kernel i have written. The code had been working fine until one of the users got a graphics driver update (versione 20.19.15.4835).
The code had worked for about 1 year on a wide assortment of CPU's and integrated and dedicated GPU's, both when compiled with x64 and x86. The old code still works on the CPU when compiled with either x64 or x86, and on the integrated gpu when compiled with x86. But when run on integrated graphics cards, with the newest driver, in x64 mode, it failes.
i have been able to track it down to this line of code:
float x1 = (xCoords + turbines * windDirIndex)[rel.downstream];
Seemingly randomly, this line would return 0 instead of the content in xCoords. Changing the code to the following fixes the bug.
float x1 = xCoords[rel.downstream + turbines * windDirIndex];
The variable types are as follows:
xCoords: global float*
turbines: ushort
windDirIndex: ushort
Can anybody explain why the two lines have different behaviour in this very specific case?