问题
I have 2 computers, one with Raden R9 290x, and Raden R7 250 in another. The following discussion focuses only on AMD graphics cards. On both machines the same driver installed. I wrote OpenCL kernel, compile it into a binary and use clCreateProgramWithBinary. But I was faced with the following challenges:
Compiled binaries for these two devices are different: for R7 binary weighs ~ 500KB, and for R9 ~ 1.5MB.
I have no problem when using the binary on the device for which it was compiled, everything happens instantly. But if I try to run the binary for R7 at R9, then clBuildProgram executed a very long time (~ 1 min.), And contrary (binary from R9 load to R7) clBuildProgram - causes access violation.
I need to get the binary that will run on all of AMD's graphics cards, support OpenCL. How to compile OpenCL kernel that it would work properly on all devices?
来源:https://stackoverflow.com/questions/36621232/universal-binaries-for-opencl