-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Enable devicelib when using -fsycl-link to generate partially … #2625
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
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_test.cpp -o %t_device.o | ||
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_test_ihdr.h %S/std_complex_math_test.cpp -I %sycl_include -Wno-sycl-strict | ||
// >> host compilation... | ||
// RUN: %clangxx -include std_complex_math_test_ihdr.h -c %S/std_complex_math_test.cpp -o %t_host.o -I %sycl_include -Wno-sycl-strict | ||
// RUN: %clangxx %t_host.o %t_device.o -o %t.out -lsycl | ||
// RUN: %CPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %ACC_RUN_PLACEHOLDER %t.out | ||
|
||
// RUN: %clangxx -fsycl -fsycl-link -fsycl-device-lib=all %S/std_complex_math_fp64_test.cpp -o %t_fp64_device.o | ||
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_fp64_test_ihdr.h %S/std_complex_math_fp64_test.cpp -I %sycl_include -Wno-sycl-strict | ||
// >> host compilation... | ||
// RUN: %clangxx -include std_complex_math_fp64_test_ihdr.h -c %S/std_complex_math_fp64_test.cpp -o %t_fp64_host.o -I %sycl_include -Wno-sycl-strict | ||
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -o %t_fp64.out -lsycl | ||
// RUN: %CPU_RUN_PLACEHOLDER %t_fp64.out | ||
// RUN: %ACC_RUN_PLACEHOLDER %t_fp64.out | ||
Comment on lines
+1
to
+15
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. I'm only curious: are there any other use-cases? 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, @s-kanaev 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. Yes, exactly. 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. We have supported for normal jit and aot including fintelfpga mode. However, there are many other use cases which is not so "popular", I believe we do have some use cases which have not been handled, for example: it seems that "-fsycl-link-targets=<T1,...,Tn>" also needs the support. |
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.
There is a current issue where usage of
-fintelfpga
is too liberal, where we should be using thespir64_fpga
triple instead. Should that be the case here? Downside would be that regular-fsycl-link
usage would not be possible with FPGA and usage of-fsycl-link
would be only to create FPGA specific device libraries.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.
Hi, @mdtoguchi
According to latest user manual, -fsycl-link has 2 different user scenario which depends on whether it is used together with -fintelfpga. In this PR, we only want to toch the "pure" fsycl-link mode which is used to create a device object which is later used in host link.
Do you mean compiler driver will change the behavior of "-fsycl-link", it will only be used to create FPGA specific device libraries? If so, what option/command should we use to create device object used for host link?
Thanks very much.
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.
Use of
-fsycl-link
is not changing. What I mean is that use of-fintelfpga
and-fsycl-targets=spir64_fpga-unknown-unknown-sycldevice
should be equivalent sans a couple implied defaults with-fintelfpga
.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.
So, I need to have a more solid check for FPGA in the patch? Checking -fintelfpga seems not to be enough, we need to check whether spir64_fpga triple is specified too. Did I get your point correctly?
Thanks very much.
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.
I would say just checking for SPIRSubArch_fpga should be sufficient, as
-fintelfpga
implies it.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.
Hi, @mdtoguchi
If -fsycl-link is used together with -fintelfpga, sycl device libraries will be added via: https://github.com/intel/llvm/blob/sycl/clang/lib/Driver/Driver.cpp#L4094
in the function appendLinkDependences.
If -fsycl-link is used without -fintelfpga, the code path is different, we will step into getDeviceDependences. I am not sure whether we have real world scenario for the combination: "-fsycl-link -fsycl-targets=spir64_fpga-unknown-unknwon-sycldevice", I tried this combination and found the we still need to add sycl device libraries in getDeviceDependences.
In a word, although -fintelfpga and -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice may be equivalent, we have different code paths in driver. I suggest to keep the check for fintelfpga here.
Thanks very much.
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.
Okay. You can continue to use
-fintelfpga
for this path, as the behavioral trigger is currently-fsycl-link -fintelfpga
. We may need to weigh in on-fsycl-link
behaviors with-fsycl-targets=spir64_fpga
as we look to keed a differentiator other than use of the FPGA triple. Thanks