Skip to content
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

Document the -fintelfpga flag ? #1190

Closed
fwyzard opened this issue Feb 26, 2020 · 31 comments
Closed

Document the -fintelfpga flag ? #1190

fwyzard opened this issue Feb 26, 2020 · 31 comments
Labels
Documentation Missing documentation for the code, compiler or runtime features, etc.

Comments

@fwyzard
Copy link
Contributor

fwyzard commented Feb 26, 2020

Is there any documentation about the -fintelfpga flag ?

I've tried to build the simply SYCL application from the getting started page with

/data/user/fwyzard/sycl/build/bin/clang++ -O2 -g -Wno-unknown-cuda-version -fsycl -fintelfpga -DFPGA_EMULATOR simple-sycl-app.cpp -o simple-sycl-app-fpga_emu

but that failed with

clang-11: error: unable to execute command: Executable "aoc" doesn't exist!
clang-11: error: fpga compiler command failed with exit code 1 (use -v to see invocation)

Where do I get aoc (apart from the oneAPI beta) ?
One installed, Is there any way to point the location of aoc to clang++, other than having it in the PATH ?

I've also tried to build multiple backends at the same time, bit I got the error

clang-11: error: The option -fsycl-targets= conflicts with -fintelfpga

Is that a design choice, or just a short term issue to be improved later ?

@fwyzard
Copy link
Contributor Author

fwyzard commented Feb 26, 2020

It looks like -fintelfpga is roughly equivalent to -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -MMD -lOpenCL ?

@bader
Copy link
Contributor

bader commented Feb 26, 2020

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.

@fwyzard
Copy link
Contributor Author

fwyzard commented Feb 26, 2020

Thanks @bader.
I think I understand what it means, and I would find it useful to add a bit more information, e.g.

  • that it relies on the aoc external tool
  • that it is a shortcut for -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice or similar
  • that (unlike this) it is not compatible with other -fsycl-targets options

@bader
Copy link
Contributor

bader commented Feb 26, 2020

@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.

@AlexeySachkov AlexeySachkov added the Documentation Missing documentation for the code, compiler or runtime features, etc. label Feb 27, 2020
@fwyzard
Copy link
Contributor Author

fwyzard commented Feb 28, 2020

Done in #1218.

@bader
Copy link
Contributor

bader commented Mar 6, 2020

@fwyzard, can we close this issue or there is anything else you wanted to add regarding -fintelfpga flag?

@fwyzard
Copy link
Contributor Author

fwyzard commented Mar 6, 2020

Is there a way to install aoc without installing the full oneAPI beta ?

@AGindinson
Copy link
Contributor

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?

@GarveyJoe
Copy link
Contributor

There is not.

@fwyzard
Copy link
Contributor Author

fwyzard commented Mar 9, 2020

Thanks.
Do you know if the installation from beta 4 is compatible with this branch ?

@AlexeySachkov
Copy link
Contributor

Tagging @vladimirlaz to answer the question

@vladimirlaz
Copy link
Contributor

vladimirlaz commented Jul 9, 2020

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.

@j-stephan
Copy link
Contributor

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.

@GarveyJoe
Copy link
Contributor

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.

@j-stephan
Copy link
Contributor

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.

@AGindinson AGindinson removed their assignment Jan 26, 2022
@AGindinson
Copy link
Contributor

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.

@j-stephan
Copy link
Contributor

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.

@bader
Copy link
Contributor

bader commented Jan 26, 2022

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.

@bader
Copy link
Contributor

bader commented Jan 26, 2022

@j-stephan
Copy link
Contributor

According to @GarveyJoe a few comments above additional flags were added to -fintelfpga over time. Has this been reverted?

@AGindinson
Copy link
Contributor

AGindinson commented Jan 26, 2022

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.

@mdtoguchi
Copy link
Contributor

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

@j-stephan
Copy link
Contributor

So the -fsycl-link arguments cannot be used without -fintelfpga?

@mdtoguchi
Copy link
Contributor

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.

@KornevNikita
Copy link
Contributor

KornevNikita commented May 17, 2024

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? :)

  • Please provide an update if you have any (or just a small comment if you don't have any yet).
  • OR mark this issue with the 'confirmed' label if you have confirmed the problem/request and our team should work on it.
  • OR close the issue if it has been resolved.
  • OR take any other suitable action.

Thanks!

Copy link
Contributor

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:

  • provide an update if you have any
  • unassign yourself if you're not looking / going to look into this issue
  • mark this issue with the 'confirmed' label if you have confirmed the problem/request and our team should work on it
  • close the issue if it has been resolved
  • take any other suitable action.

Thanks!

3 similar comments
Copy link
Contributor

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:

  • provide an update if you have any
  • unassign yourself if you're not looking / going to look into this issue
  • mark this issue with the 'confirmed' label if you have confirmed the problem/request and our team should work on it
  • close the issue if it has been resolved
  • take any other suitable action.

Thanks!

Copy link
Contributor

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:

  • provide an update if you have any
  • unassign yourself if you're not looking / going to look into this issue
  • mark this issue with the 'confirmed' label if you have confirmed the problem/request and our team should work on it
  • close the issue if it has been resolved
  • take any other suitable action.

Thanks!

Copy link
Contributor

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:

  • provide an update if you have any
  • unassign yourself if you're not looking / going to look into this issue
  • mark this issue with the 'confirmed' label if you have confirmed the problem/request and our team should work on it
  • close the issue if it has been resolved
  • take any other suitable action.

Thanks!

@KornevNikita
Copy link
Contributor

KornevNikita commented Jan 29, 2025

Unassigning Michael for further work.

@AlexeySachkov
Copy link
Contributor

We are going to remove support for -fintelfpga flag in #16864. Please refer to #16929 for information about our motivation. In that context, I don't think that this issue describes something that we will address. Closing it as won't fix

@AlexeySachkov AlexeySachkov closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Missing documentation for the code, compiler or runtime features, etc.
Projects
None yet
Development

No branches or pull requests

9 participants