-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL] Add intelfpga vendor header files #511
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
Conversation
@domiyan, please, sign new commits. |
…FPGA extensions Signed-off-by: Domi Yan <[email protected]>
ee66b62
to
897a620
Compare
@bader. Not sure how to modify sign on the exiting one. I created a new branch, applied the diff and force-pushed. |
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 are a few things to clean up further.
|
||
#pragma once | ||
#include <CL/sycl/intel/fpga_device_selector.hpp> | ||
#include <CL/sycl/intel/fpga_reg.hpp> |
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.
Missing EOL.
#include <CL/sycl/intel/fpga_device_selector.hpp> | ||
... | ||
// force FPGA emulation device | ||
cl::sycl::queue deviceQueue(cl::sycl::intel::fpga_emulator_selector{}); |
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.
Since you are using {}
, replace the outer parenthesis too.
@@ -0,0 +1,31 @@ | |||
# FPGA reg | |||
|
|||
Intel FPGA extension fpga_reg() is implemented in header file |
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.
fpga_reg() → fpga_reg()
Intel FPGA extension fpga_reg() is implemented in header file | ||
`#include <CL/sycl/intel/fpga_extensions.hpp>`. | ||
|
||
fpga_reg is used to help compiler infer that at least one register is on the corresponding data path. |
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.
fpga_reg() → fpga_reg()
|
||
## Implementation | ||
|
||
The implementation is a wrapper class to map fpga_reg function call to built-in \_\_builtin_intel_fpga_reg() |
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.
fpga_reg → fpga_reg()
__builtin_intel_fpga_reg() → __builtin_intel_fpga_reg()
namespace sycl { | ||
namespace intel { | ||
|
||
class platform_selector : public default_selector { |
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.
Should this derive from device_selector instead of default_selector?
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.
good point. I will fix this in next patch.
This was added in OpenACC PR #511 in the 3.4 branch. From an AST/Sema perspective this is pretty trivial as the infrastructure for 'if' already exists, however the atomic construct needed to be taught to take clauses. This patch does that and adds some testing to do so.
With FPGA header files, users have shortcuts to access FPGA device selector and FPGA extension (fpga_reg).
Example of using FPGA device selector.
#include <CL/sycl/intel/fpga_extensions.hpp>
...
cl::sycl::queue deviceQueue(cl::sycl::intel::fpga_selector{}); // this force fpga hardware device
...
Example of using FPGA extensions.
#include <CL/sycl/intel/fpga_extensions.hpp>
...
r[k] = cl::sycl::intel::fpga_reg(a[k]) + b[k];
...
Signed-off-by: Domi Yan [email protected]