AnsweredAssumed Answered

Use isa/il with OpenCL, Create BIF from isa/il

Question asked by tivxo on Oct 12, 2015



I'd like to compile OpenCL kernels with llvm (clang opencl frontend and amdgpu backend ( and run them with the AMD OpenCL interface. Since the llvm amdgpu backend produces gcn-isa, it would be nice be able to create a binary image - in the form of what the OpenCL framework produces, when you call clGetProgramInfo(...,CL_PROGRAM_BINARIES,... - loadable from OpenCL.


So, is there any "official" way/tool of using isa (gcn) or amdil for OpenCL? Can this be done directly from llvm? Any suggestions other than the nasty binary patching?


AMD uses llvm as part of their toolchain (see , Chapter 3), so there has to be a way, I guess.



I know that there have been discussions about patching a binary generated with the AMD OpenCL framework, like so " isa/il with OpenCL", "". I'd rather use an official or at least more elegant way. Since theses threads are fairly old, I guess it's okay to "repeat" the question. I also think that the public llvm amdgpu backend did not exist ~3 years ago.



Thanks for your help!