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

Fix edgedetection2 #89

Merged
merged 5 commits into from
Nov 3, 2020
Merged

Conversation

Ralender
Copy link
Contributor

@Ralender Ralender commented Oct 7, 2020

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)

@Ralender Ralender changed the base branch from sycl/unified/master to sycl/unified/next October 7, 2020 09:26
Copy link
Member

@keryell keryell left a 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.

#if defined(__SYCL_XILINX_HW_EMU_MODE__) || defined(__SYCL_XILINX_HW_MODE__)
__SYCL_DEVICE_ANNOTATE("xilinx_partition_array")
#endif
__attribute__((always_inline))
Copy link
Member

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.

Copy link
Contributor Author

@Ralender Ralender Oct 16, 2020

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.

Copy link
Member

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?

Copy link
Contributor Author

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__");
Copy link
Member

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))
Copy link
Member

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?

bool runOnModule(Module &M) override {
turnNonKernelsIntoPrivate(M);
setCallingConventions(M);
fixArrayPartition(M);
Copy link
Member

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?

@@ -55,9 +59,39 @@ struct PrepareSYCLOpt : public ModulePass {
}
}

void fixArrayPartition(Module& M) {
Copy link
Member

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.

Comment on lines 65 to 66
/// into an array.
/// and change the argument received by xlx_array_partition into a pointer on
Copy link
Member

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.

Copy link
Member

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
Copy link
Member

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.

Ralender and others added 3 commits October 27, 2020 17:36
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.
Copy link
Member

@keryell keryell left a 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.

Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@keryell keryell merged commit d50960d into triSYCL:sycl/unified/next Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

llvm/sycl/test/xocc_tests/disabled/edge_detection example does not work
2 participants