"volatile" in OpenCL code not recognized when compiling with -fstack-protector
Submitted by Gian-Carlo Pascutto
Assigned to mes..@..op.org
Link to original bug (#107369)
Description
https://github.com/CNugteren/CLBlast/issues/298 https://github.com/gcp/leela-zero/issues/1612
Using "volatile" in OpenCL kernels will generate an "unsupported initializer for address space" error for the combinations of:
Mesa 18.1.3 (POLARIS10, DRM 3.23.0, 4.16.0-1-amd64, LLVM 6.0.1) Mesa 17.3.9 AMD KABINI (DRM 2.49.0 / 4.9.0-6-amd64, LLVM 5.0.1)
But works for:
Mesa 18.0.4 (POLARIS11 / DRM 3.23.0 / 4.16.13-1-MANJARO, LLVM 6.0.0) Mesa 18.1.3 (POLARIS11, DRM 3.23.0, 4.16.18-1-MANJARO, LLVM 6.0.0)
So, this problem curiously seems to avoided by the POLARIS11 OpenCL support and not specific to the Mesa version itself.
volatile has been legal in OpenCL code at least since OpenCL 1.1 and is used in the above projects to improve register allocation (without which AMD hardware gets a performance penalty).
Version: 18.0