w-m
w-m

Reputation: 11232

OpenCL clBuildProgram fails on AMD GPU on OS X with non-descriptive build log

I'm trying to compile a set of OpenCL kernels in a C++ project on OS X El Capitan 10.11.2.

The machine used is a iMac (Retina 5K, 27-inch, Late 2015), containing a AMD Radeon R9 M395X 4096 MB that is chosen as the OpenCL device. I'm using the OpenCL framework that ships with the OS.

On a particular kernel, the OpenCL program build fails with this CL_PROGRAM_BUILD_LOG:

SC failed. No reason given.

The same kernels compile fine when choosing the CPU of the same machine as an OpenCL device or a similar machine with an Nvidia GPU.

Upvotes: 3

Views: 425

Answers (1)

w-m
w-m

Reputation: 11232

The problematic kernel source can be boiled down to the following:

kernel void sampleKernel (bool param) {}

Using a bool as a parameter of an OpenCL kernel is not supported by the OpenCL C specification, see e.g. https://stackoverflow.com/a/4441865/463796

Replacing the type of the parameter with a char solves the problem.

Upvotes: 3

Related Questions