llvm
llvm copied to clipboard
[SYCL] Implement loading SYCLBIN into kernel_bundle
This commit implements the functionality for loading SYCLBIN files into kernel bundles. This is done by mimicking the structure of regular device binaries, then letting the existing functionality handle compiling and linking.
This implements part of the sycl_ext_oneapi_syclbin extension.
Note that parts of this implementation uses functionality copied from LLVMSupport and LLVMObject. Eventually they should be replaced in favor of using the LLVM libraries directly.
You don't seem to go through
ProgramManager::addImage/removeImagesfor SYCLBINs -- do you still get support for eliminated arguments, and are the PM's datastructures cleaned when a SYCLBIN kernel bundle is destroyed?
Good question! I intentionally didn't want to go through addImages/removeImages to avoid the program manager being too aware of the contents of the binaries. I wanted kernel_bundle and device image structures to be the primary owners of the binaries. Looking at the parts that removeImages clean up, I definitely need to investigate whether the eliminated args mask and the device global variables work here. Maybe we can refactor their registration.