The kernel in this code snippet (just the kernel matters--the Python bits around it just make it runnable) crashes many of the most recent CPU CL compilers with the following error message:
Unhandled signal in divisionErrorHandler()
[1] 22355 abort python amd-crash.py
The associated backtrace looks like this:
#0 0x00007fffdf4af4ff in ?? () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so
#1 0x00007fffdf4b3687 in ?? () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so
#2 0x00007fffdf4b4544 in ?? () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so
#3 0x00007fffdce2c5a0 in ?? () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl12cl64.so
#4 0x00007fffdf4b0195 in ?? () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so
#5 0x00007fffdf4b0c42 in ?? () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so
#6 0x00007fffdf4910ff in ?? () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so
#7 0x00007fffdf4a1504 in ?? () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so
#8 0x00007fffdf481b70 in clBuildProgram () from /usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so
In other words, this happens somewhere deep in clBuildProgram.
Versions affected include the recent beta (16.15.2-277429 from AMD Radeon™ Software AMD GPU-PRO Beta Driver – Linux® for Vulkan™ Release Notes) and the 15.12 driver. 15.5 is the last version that works. I am running this on an Intel Broadwell chip, but it's reproducible on many other CPUs, including AMD ones.
Unrelatedly, I would appreciate being whitelisted for the OpenCL community.