-
Notifications
You must be signed in to change notification settings - Fork 0
[SYCL] Add support AOT compilation for Intel GPUs in clang-sycl-linker #1
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: main
Are you sure you want to change the base?
Changes from 1 commit
491af22
115fc75
52edf80
5e13405
57fd7e4
f50b9a8
b3a03ef
c4e9f0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ def device_libs_EQ : CommaJoined<["--", "-"], "device-libs=">, | |
Flags<[LinkerOnlyOption]>, | ||
HelpText<"A comma separated list of device libraries that are linked during the device link.">; | ||
|
||
def triple : Joined<["--"], "triple">, | ||
def triple_EQ : Joined<["--"], "triple=">, | ||
jzc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
HelpText<"The device target triple">; | ||
def arch : Separate<["--", "-"], "arch">, | ||
HelpText<"Specify the name of the target architecture.">; | ||
|
@@ -50,3 +50,20 @@ def llvm_spirv_path_EQ : Joined<["--"], "llvm-spirv-path=">, | |
def llvm_spirv_options_EQ : Joined<["--", "-"], "llvm-spirv-options=">, | ||
Flags<[LinkerOnlyOption]>, | ||
HelpText<"Options that will control llvm-spirv step">; | ||
|
||
def sycl_backend_compile_options_from_image_EQ : Joined<["--", "-"], "sycl-backend-compile-options-from-image=">, | ||
Flags<[LinkerOnlyOption]>, | ||
HelpText<"Compile options that will be transmitted to the SYCL backend compiler">; | ||
|
||
def sycl_backend_link_options_from_image_EQ : Joined<["--", "-"], "sycl-backend-link-options-from-image=">, | ||
Flags<[LinkerOnlyOption]>, | ||
HelpText<"Link options that will be transmitted to the SYCL backend compiler">; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
* - @sarnex, this statement might be controversial if OpenMP offload is going to use this tool as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah at some point we will have to use this for OpenMP offloading as well |
||
|
||
def gpu_tool_arg_EQ : | ||
Joined<["--", "-"], "gpu-tool-arg=">, | ||
Flags<[LinkerOnlyOption]>, | ||
HelpText<"Options that are passed to the backend of target device compiler for Intel GPU during AOT compilation">; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SYCL support non-Intel GPUs as well. Can this option be used to pass options to CUDA/HIP device compilers?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CUDA/HIP step is not implemented but in theory this could easily pass to those device compilers. I took all these flags from the intel/llvm version of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be we can call this gen-tool-arg? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gpu_tool_arg_EQ and cpu_tool_arg_EQ are options that are passed into clang-linker-wrapper by the driver based on command line options specified by user. OPT_sycl_backend_compile_options_from_image_EQ, and OPT_sycl_backend_link_options_from_image_EQ are options that are populated inside clang-linker-wrapper based on what is present inside the device image (in StringMap). Thanks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@asudarsa, could you provide an example of commands leading to setting If it possible to set OPT_sycl_backend_compile_options_from_image_EQ and gpu_tool_arg_EQ are setting options for the same tool - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @bader Here is the use case About combining the options, there is a problem. In the latest community version of clang-linker-wrapper, the input files are sent as is to clang driver for purpose of device code linking. So, we do not read the device image. Also, if multiple inputs are to be linked, then we might have different set of options in each device image metadata. After I wrote this, I see another issue. If module 1 has '-opt1' backend option embedded in its metadata and module 2 has '-opt2' backend option, then we should not 'link' these two modules. This needs further thought. Adding @mdtoguchi also for discussion here. Thanks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In this case, I think clang driver is expected to combine the flags. Anyway, whichever tool extracts device "code" from the device "image" should merge the flags from device image metadata to the flags passed via command line option. I would expose tool specific flags in the clang-sycl-linker interface for clarity similar to |
||
def cpu_tool_arg_EQ : | ||
Joined<["--", "-"], "cpu-tool-arg=">, | ||
Flags<[LinkerOnlyOption]>, | ||
HelpText<"Options that are passed to the backend of target device compiler for Intel CPU during AOT compilation">; |
Uh oh!
There was an error while loading. Please reload this page.