-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix edgedetection2 #89
Conversation
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 am waiting for the #88 to land first and the PR being rebased on top of it because it is unclear about what is the pure part of this PR.
daaca1b
to
6d81488
Compare
#if defined(__SYCL_XILINX_HW_EMU_MODE__) || defined(__SYCL_XILINX_HW_MODE__) | ||
__SYCL_DEVICE_ANNOTATE("xilinx_partition_array") | ||
#endif | ||
__attribute__((always_inline)) |
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.
Would this compile with MSVC?
It would be nice to have this work in plain CPU mode.
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.
Would this compile with MSVC?
I don't think so because the __ attribute format isn't supported by msvc as far AFAIK.
It would be nice to have this work in plain CPU mode.
yes on gcc/clang because __SYCL_DEVICE_ANNOTATE will disappear.
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.
Using a macro like __SYCL_ALWAYS_INLINE
or __TRISYCL_ALWAYS_INLINE
?
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.
ALWAYS_INLINE is the macro intel added so even if we create a new one we are not going to be shielded from collision on there code.
Builder.defineMacro("__SYCL_XILINX_HW_EMU_MODE__"); | ||
break; | ||
case llvm::Triple::FPGASubArch_hw: | ||
Builder.defineMacro("__SYCL_XILINX_HW_MODE__"); |
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.
These macros seems very useful.
They should be described somewhere in the documentation.
#if defined(__SYCL_XILINX_HW_EMU_MODE__) || defined(__SYCL_XILINX_HW_MODE__) | ||
__SYCL_DEVICE_ANNOTATE("xilinx_partition_array") | ||
#endif | ||
__attribute__((always_inline)) |
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.
Using a macro like __SYCL_ALWAYS_INLINE
or __TRISYCL_ALWAYS_INLINE
?
llvm/lib/SYCL/PrepareSYCLOpt.cpp
Outdated
bool runOnModule(Module &M) override { | ||
turnNonKernelsIntoPrivate(M); | ||
setCallingConventions(M); | ||
fixArrayPartition(M); |
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.
Is "fix" the right name?
llvm/lib/SYCL/PrepareSYCLOpt.cpp
Outdated
@@ -55,9 +59,39 @@ struct PrepareSYCLOpt : public ModulePass { | |||
} | |||
} | |||
|
|||
void fixArrayPartition(Module& M) { |
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.
Add a description comment describing what is done from a high-level point of view.
6d81488
to
d3f359d
Compare
llvm/lib/SYCL/PrepareSYCLOpt.cpp
Outdated
/// into an array. | ||
/// and change the argument received by xlx_array_partition into a pointer on |
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.
Fuse these lines or change the typesetting.
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.
It would be interesting to explain which transformation is actually done here.
#if defined(__SYCL_XILINX_HW_EMU_MODE__) || defined(__SYCL_XILINX_HW_MODE__) | ||
__SYCL_DEVICE_ANNOTATE("xilinx_partition_array") | ||
#endif | ||
ALWAYS_INLINE |
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.
The name has changed up-stream.
hw_emu has higher requierments than sw_emu
I thought it was fixed but couldn't get it working. in sw_emu edge detection failed because of array partition metadata. and in hw_emu and hw it failed because of pipeline metadata. array partition metadata don't cause any issues in hw or hw_emu so there just disabled in sw_emu. for pipeline metadata, what v++ generate and what the docs says it should generate don't match. previously we generated what v++ generate, now we generate what the doc says we should and it fixes ths issue.
d3f359d
to
3624a9e
Compare
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 have the feeling this has to be rebased on a more recent version to resolve the merge conflicts.
…nto FixEdgedetection2
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.
Thanks!
I thought edge detection was fixed but I saw issue with so here is a fix.
it dependes on #88
because this patch allows every part of the toolchain be be aware of the target (sw_emu/hw_emu/hw)