This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][Offloading] Fix test case issues in bug49334.cpp
ClosedPublic

Authored by tianshilei1992 on Feb 16 2022, 3:56 PM.

Details

Summary

bug49334.cpp has one issue that causes flaky result reported in #53730.
The root cause is BlockedC is never initialized but in BlockMatMul_TargetNowait
it is directly read and written (via +=). Fixes #53730.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Feb 16 2022, 3:56 PM
tianshilei1992 requested review of this revision.Feb 16 2022, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2022, 3:56 PM
tianshilei1992 edited the summary of this revision. (Show Details)Feb 16 2022, 3:57 PM
jhuber6 accepted this revision.Feb 17 2022, 7:12 AM
jhuber6 added a subscriber: jhuber6.

LG

This revision is now accepted and ready to land.Feb 17 2022, 7:12 AM
This revision was landed with ongoing or failed builds.Feb 17 2022, 7:22 AM
This revision was automatically updated to reflect the committed changes.
hyviquel added inline comments.
openmp/libomptarget/test/offloading/bug49334.cpp
76

@tianshilei1992 By changing N to 16, it uses only a single block thus becomes a simple matrix multiplication and the test lost the interest of having multiple concurent target tasks...

tianshilei1992 marked an inline comment as done.Feb 23 2022, 11:59 AM
tianshilei1992 added inline comments.
openmp/libomptarget/test/offloading/bug49334.cpp
76

Yes, but it can also make problems easier to be reproduced, like the one hidden in the test case itself. In addition, since the target region has nowait, one task or multiple tasks make no difference for the taskwait, which can meet our expectation for the test.

tianshilei1992 marked an inline comment as done.Feb 23 2022, 11:59 AM
tianshilei1992 added inline comments.
openmp/libomptarget/test/offloading/bug49334.cpp
76

I mean, the implicit task wait at the end of the parallel region.

Arguably, we can have both, can't we?

hyviquel added inline comments.Feb 23 2022, 12:51 PM
openmp/libomptarget/test/offloading/bug49334.cpp
76

I think it is important to enable concurrent access to the same entry of the HostDataToTargetMap which was the initial purpose of the test.

Arguably, we can have both, can't we?

I think it would be better.

I change it back to 256.

I change it back to 256.

I think what @jdoerfert and @hyviquel suggested is to make N a compile-time parameter and have two RUN lines, one setting -DN=16, one setting -DN=256.