Skip to content

[OMPIRBuilder] - Handle dependencies in createTarget #93977

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8060e0b
Add a flag to choose new codegen
bhandarkar-pranav May 7, 2024
83f09a5
clang prints for debugging
bhandarkar-pranav May 13, 2024
e2aa768
add an option -new-ompirbuilder-target-codegen to enable dependency-b…
bhandarkar-pranav May 13, 2024
e15bb96
checkpoint commit -> able to create an inlined version of the task th…
bhandarkar-pranav May 16, 2024
53759cc
checkpoint commit
bhandarkar-pranav May 20, 2024
83cea83
checkpoint commit
bhandarkar-pranav May 22, 2024
d5c2449
Simple test working. checkpoint commit. next steps clean up code, uni…
bhandarkar-pranav May 24, 2024
e323356
clean up, clean up, everybody clean up
bhandarkar-pranav May 28, 2024
264dfa6
Add an MLIR lit test
bhandarkar-pranav May 29, 2024
25021eb
add an end-to-end offloading test for target depend
bhandarkar-pranav May 30, 2024
e484ee2
Clean up, clean up, everybody clean up (some more)
bhandarkar-pranav May 30, 2024
febda4f
Add back some ws that was removed
bhandarkar-pranav May 30, 2024
9cc0234
More cleanup and comments
bhandarkar-pranav May 30, 2024
141dccc
clang-format fixes
bhandarkar-pranav May 30, 2024
6697f1e
remove commented out createFakeIntVal
bhandarkar-pranav May 30, 2024
e75c853
more cleanup
bhandarkar-pranav May 30, 2024
799751f
Fix dependencies when nowait is used on target construct
bhandarkar-pranav May 31, 2024
77e5753
Add comments for emitTargetTask and emitDepArray
bhandarkar-pranav May 31, 2024
073d194
Fix comment in target-depend.f90
bhandarkar-pranav May 31, 2024
29566b1
Incorporate changes for review comments
bhandarkar-pranav Jun 11, 2024
a12ffb4
Update testcase to make it more reliable by correcting the use of the…
bhandarkar-pranav Jun 21, 2024
ac34fd1
Address more review comments
bhandarkar-pranav Jul 1, 2024
c0e2ceb
Incorporate one more review comment
bhandarkar-pranav Jul 2, 2024
9b49c09
Incorporate changes from review comments
bhandarkar-pranav Jul 9, 2024
cda5bc6
Simplify test to make it faster yet effective
bhandarkar-pranav Jul 19, 2024
a314a84
Use SmallVector instead of std::stack in CreateFakeIntVal
bhandarkar-pranav Jul 19, 2024
b060e36
Use SmallVectorImpl in emitTaskDependencies
bhandarkar-pranav Jul 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,26 @@ class OpenMPIRBuilder {
EmitFallbackCallbackTy EmitTargetCallFallbackCB, TargetKernelArgs &Args,
Value *DeviceID, Value *RTLoc, InsertPointTy AllocaIP);

/// Generate a target-task for the target construct
///
/// \param OutlinedFn The outlined device/target kernel function.
/// \param OutlinedFnID The ooulined function ID.
/// \param EmitTargetCallFallbackCB Call back function to generate host
/// fallback code.
/// \param Args Data structure holding information about the kernel arguments.
/// \param DeviceID Identifier for the device via the 'device' clause.
/// \param RTLoc Source location identifier
/// \param AllocaIP The insertion point to be used for alloca instructions.
/// \param Dependencies Vector of DependData objects holding information of
/// dependencies as specified by the 'depend' clause.
/// \param HasNoWait True if the target construct had 'nowait' on it, false
/// otherwise
InsertPointTy emitTargetTask(
Function *OutlinedFn, Value *OutlinedFnID,
EmitFallbackCallbackTy EmitTargetCallFallbackCB, TargetKernelArgs &Args,
Value *DeviceID, Value *RTLoc, InsertPointTy AllocaIP,
SmallVector<OpenMPIRBuilder::DependData> &Dependencies, bool HasNoWait);

/// Emit the arguments to be passed to the runtime library based on the
/// arrays of base pointers, pointers, sizes, map types, and mappers. If
/// ForEndCall, emit map types to be passed for the end of the region instead
Expand Down Expand Up @@ -2245,6 +2265,8 @@ class OpenMPIRBuilder {
/// \param BodyGenCB Callback that will generate the region code.
/// \param ArgAccessorFuncCB Callback that will generate accessors
/// instructions for passed in target arguments where neccessary
/// \param Dependencies A vector of DependData objects that carry
// dependency information as passed in the depend clause
InsertPointTy createTarget(const LocationDescription &Loc,
OpenMPIRBuilder::InsertPointTy AllocaIP,
OpenMPIRBuilder::InsertPointTy CodeGenIP,
Expand All @@ -2253,7 +2275,8 @@ class OpenMPIRBuilder {
SmallVectorImpl<Value *> &Inputs,
GenMapInfoCallbackTy GenMapInfoCB,
TargetBodyGenCallbackTy BodyGenCB,
TargetGenArgAccessorsCallbackTy ArgAccessorFuncCB);
TargetGenArgAccessorsCallbackTy ArgAccessorFuncCB,
SmallVector<DependData> Dependencies = {});

/// Returns __kmpc_for_static_init_* runtime function for the specified
/// size \a IVSize and sign \a IVSigned. Will create a distribute call
Expand Down
Loading