-
Notifications
You must be signed in to change notification settings - Fork 770
[SYCL] Implement loading SYCLBIN into kernel_bundle #18949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Conversation
This commit implements the functionality for loading SYCLBIN files into kernel bundles. This is done by mimicing 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. Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks super neat, just two nits and a question:
You don't seem to go through ProgramManager::addImage/removeImages
for 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 |
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
|
||
#if __has_include(<filesystem>) | ||
#include <filesystem> | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't these need an #else ? What will happen if the compiler doesn't have filesystem or span? IIRC, we are still trying to support GCC 7.5 whose support of C++17 filesystem feature is not complete. Take a look at what is done in os_util.cpp, where the fallback includes experimental/filesystem.
Also, std::span is C++20, iirc. But we have sycl::span
, so maybe use that?
OR if I'm operating on yesterdays information and this is no longer a problem, let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't these need an #else ? What will happen if the compiler doesn't have filesystem or span? IIRC, we are still trying to support GCC 7.5 whose support of C++17 filesystem feature is not complete. Take a look at what is done in os_util.cpp, where the fallback includes experimental/filesystem.
The filesystem functionality is part of the public interface. Similar to how the std::span
interface isn't available, we can't offer those interfaces if the user doesn't have the headers available.
Also, std::span is C++20, iirc. But we have
sycl::span
, so maybe use that?
Indeed! There is an overload of the new interfaces with sycl::span
, but one of the interfaces take a std::span
directly, so we need to optionally include it to offer that interface.
OR if I'm operating on yesterdays information and this is no longer a problem, let me know.
Definitely still a problem, but in this case the sycl::span
interface will always be available and the rest are cases of "too bad, you can't use those. Update your compiler."
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.