2
votes

I am trying to view the assembly code of an OpenCL kernel that runs on the AMD GPU of my Mac.

Based on this SO question, OpenCL online compilation: get assembly from cl::program or cl::kernel, I used --save-temps to my clBuildProgram call, as below.

err = clBuildProgram(program, num_devices, deviceList, "-save-temps", NULL, NULL);

However, this fails with error code -43, which translates to CL_INVALID_BUILD_OPTIONS. Based on https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/clBuildProgram.html, it looks like this option is not supported by the spec.

Tools such as CodeXL shader/kernel analyzer, do not have installation options for Mac.

Is there any other way to see the assembly code for an OpenCL kernel for AMD GPU on OSX?

1

1 Answers

0
votes

You can call clGetProgramInfo with CL_PROGRAM_BINARIES to get the "binary" for your platform. It is device/platform specific, and may wrap the machine code in some wrapper structure.