Open fwyzard opened 4 years ago
It looks like -fintelfpga
is roughly equivalent to -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -MMD -lOpenCL
?
SYCL specific compiler options are documented here: https://github.com/intel/llvm/blob/sycl/sycl/doc/SYCLCompilerUserManual.md#intel-fpga-specific-options
Please, let us know if it's not clear.
Thanks @bader. I think I understand what it means, and I would find it useful to add a bit more information, e.g.
aoc
external tool-fsycl-targets=spir64_fpga-unknown-unknown-sycldevice
or similar-fsycl-targets
options@fwyzard, if you could propose a new wording via PR, it would be great. If not, @AGindinson and/or @mdtoguchi should be able to help.
Done in #1218.
@fwyzard, can we close this issue or there is anything else you wanted to add regarding -fintelfpga
flag?
Is there a way to install aoc
without installing the full oneAPI beta ?
Is there a way to install
aoc
without installing the full oneAPI beta ?
None that I'm aware of. @GarveyJoe, could you please chime in?
There is not.
Thanks. Do you know if the installation from beta 4 is compatible with this branch ?
Tagging @vladimirlaz to answer the question
Tagging @vladimirlaz to answer the question
Late anawer is better than nothing. There is no hard correlation between aoc and siycl compiler. So the latest one should be ok.
It looks like -fintelfpga is roughly equivalent to -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -MMD -lOpenCL ?
Is this still true? I tried to use dpcpp
(DevCloud / 2020.1-beta10
) together with CMake and pass these options to both the compile and the link flags (using target_compile_options
and target_link_options
). Running make VERBOSE=1
shows me the following compiler command lines:
# Compilation step
dpcpp -O3 -DNDEBUG -fsycl -sycl-std=2020 -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xsycl-target-backend=spir64_fpga-unknown-unknown-sycldevice -g -MMD -o axpy.cpp.o -c axpy.cpp
# Linking step
dpcpp -O3 -DNDEBUG -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xsycl-target-backend=spir64_fpga-unknown-unknown-sycldevice -g -MMD -Xsycl-target-backend=spir64_fpga-unknown-unknown-sycldevice -hardware -Xsycl-target-backend=spir64_fpga-unknown-unknown-sycldevice -board=pac_a10 -Xsycl-target-backend=spir64_fpga-unknown-unknown-sycldevice -board-package=/glob/development-tools/versions/oneapi/beta10/inteloneapi/intelfpgadpcpp/2021.1-beta10/board/intel_a10gx_pac axpy.cpp.o -o axpy /glob/development-tools/versions/oneapi/beta10/inteloneapi/compiler/2021.1-beta10/linux/lib/libOpenCL.so -lsycl
This emits the following warning:
aoc: Warning: Cannot find dependency file "/home/u55018/tmp/axpy-f07400.d" for source file "/home/u55018/tmp/axpy-f07400.spv". Source code will not be available in the HLD Reports. Ensure you ran dpcpp with the -fintelfpga flag.
A few extra flags were added over time to tweak the default behaviour to be more amenable for FPGA users. You can always check the latest flags by running "dpcpp -v -fintelfpga <some .cpp file>" as this will emit the full clang++ command that dpcpp runs under the hood. The relevant flag for your warning is "-dependency-file" which is needed by the reports to map generated hardware to code in your program. Another notable difference is that -fintelfpga also now adds "-fno-sycl-early-optimizations" to disable early optimizations by the frontend. Performing these optimization early can result in less useful reports and the backend can perform most of the same optimizations. The flag is desirable for just-in-time (JiT) compilation because it reduces JiT time but -fintelfpga forces ahead-of-time (AoT) compilation.
As an aside, if you are targeting an FPGA, why aren't you simply using "-fintelfpga"? Its purpose is to make targeting an FPGA easier so you don't have to deal with all these flags yourself.
Thanks for the hint!
As an aside, if you are targeting an FPGA, why aren't you simply using "-fintelfpga"? Its purpose is to make targeting an FPGA easier so you don't have to deal with all these flags yourself.
As far as I understand the documentation -fintelfpga
doesn't work together with the other device types. I want users to be able to compile for all device types, hence I am supplying those flags manually.
In view of the extensive existing documentation at https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top.html, I would suggest re-assessing whether the issue is still relevant.
Well, what does this flag do exactly? According to the official Intel documentation it is equivalent to -fsycl-targets=spir64-unknown-unknown
but the discussion in this topic so far points in a different direction.
Hm... it looks like a bug to me. I thought that -fintelfpga is a short alias for setting compiler flags defaults for FPGA target and that -fsycl-targets
option value for FPGA is -fsycl-targets=spir64_fpga-unknown-unknown
.
The option is documented in https://github.com/intel/llvm/blob/sycl/sycl/doc/UsersManual.md#intel-fpga-specific-options.
According to @GarveyJoe a few comments above additional flags were added to -fintelfpga
over time. Has this been reverted?
According to @GarveyJoe a few comments above additional flags were added to
-fintelfpga
over time. Has this been reverted?
Over time, @mdtoguchi has minimized the gap between the -fsycl-targets=spir64_fpga
and -fintelfpga
effects - not by "reverting" Intel FPGA functional features, but by letting the -fsycl-targets
spelling enable them too. As far as I recall, the only major difference is the default -g -MMD
setting that comes with -fintelfpga
- Mike will be quick to correct me in case I'm missing some of the details.
According to @GarveyJoe a few comments above additional flags were added to
-fintelfpga
over time. Has this been reverted?Over time, @mdtoguchi has minimized the gap between the
-fsycl-targets=spir64_fpga
and-fintelfpga
effects - not by "reverting" Intel FPGA functional features, but by letting the-fsycl-targets
spelling enable them too. As far as I recall, the only major difference is the default-g -MMD
setting that comes with-fintelfpga
- Mike will be quick to correct me in case I'm missing some of the details.
The differences are -g -MMD -lOpenCL
when comparing -fintelfpga
to -fsycl-targets=spir64_fpga
. Behaviors are also different when dealing with -fsycl-link=early
or -fsycl-link=image
which are specific to usage with -fintelfpga
So the -fsycl-link
arguments cannot be used without -fintelfpga
?
So the
-fsycl-link
arguments cannot be used without-fintelfpga
?
Use of -fsycl-link
with -fintelfpga
will generate either aoco
or aocx
based archives. Use of -fsycl-link
with -fsycl-targets=spir64_fpga
will generate host-linkable device objects. At least this is the intention. Some quick experiments with -fsycl-link -fsycl-targets=spir64_fpga
looks to have uncovered a bug.
Hi! There have been no updates for at least the last 60 days, though the ticket has assignee(s).
@mdtoguchi, could I ask you to take one of the following actions? :)
Thanks!
Hi! There have been no updates for at least the last 60 days, though the issue has assignee(s).
@mdtoguchi, could you please take one of the following actions:
Thanks!
Hi! There have been no updates for at least the last 60 days, though the issue has assignee(s).
@mdtoguchi, could you please take one of the following actions:
Thanks!
Is there any documentation about the
-fintelfpga
flag ?I've tried to build the simply SYCL application from the getting started page with
but that failed with
Where do I get
aoc
(apart from the oneAPI beta) ? One installed, Is there any way to point the location ofaoc
toclang++
, other than having it in thePATH
?I've also tried to build multiple backends at the same time, bit I got the error
Is that a design choice, or just a short term issue to be improved later ?