OpenCL compiler bug with big switches

Discussion created by kvalme on Jun 4, 2018
Latest reply on Jun 11, 2018 by dipak


Recently I found an issue with AMD OpenCL compiler.

I got OpenCL code that generated on CPU and results in big switch-case construction (about 4k case).

Attempt to compile such kernel with AMD compiler leads to :

  • RGA 2.0/Vega in-driver compiler (latest on win10)
    • Compiler eats 6Gb of host ram and unable to compile in 3 hours
  • RGA 1.4/Vega in-driver compiler(amdgpu-pro-18.20-579836 kubuntu 18.04)
    • Compiler eats 24Gb of host ram and that crashes with not enought memory


Reducing "case" count to 2k results in successful kernel compilation.


Here is kernel source: