Skip to content

Commit d679471

Browse files
kparzyszskatrak
andauthored
[flang][OpenMP] Implement HAS_DEVICE_ADDR clause (#128568)
The HAS_DEVICE_ADDR indicates that the object(s) listed exists at an address that is a valid device address. Specifically, `has_device_addr(x)` means that (in C/C++ terms) `&x` is a device address. When entering a target region, `x` does not need to be allocated on the device, or have its contents copied over (in the absence of additional mapping clauses). Passing its address verbatim to the region for use is sufficient, and is the intended goal of the clause. Some Fortran objects use descriptors in their in-memory representation. If `x` had a descriptor, both the descriptor and the contents of `x` would be located in the device memory. However, the descriptors are managed by the compiler, and can be regenerated at various points as needed. The address of the effective descriptor may change, hence it's not safe to pass the address of the descriptor to the target region. Instead, the descriptor itself is always copied, but for objects like `x`, no further mapping takes place (as this keeps the storage pointer in the descriptor unchanged). --------- Co-authored-by: Sergio Afonso <[email protected]>
1 parent 773e88f commit d679471

File tree

20 files changed

+402
-79
lines changed

20 files changed

+402
-79
lines changed

flang/include/flang/Support/OpenMP-utils.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct EntryBlockArgsEntry {
3434
/// Structure holding the information needed to create and bind entry block
3535
/// arguments associated to all clauses that can define them.
3636
struct EntryBlockArgs {
37+
EntryBlockArgsEntry hasDeviceAddr;
3738
llvm::ArrayRef<mlir::Value> hostEvalVars;
3839
EntryBlockArgsEntry inReduction;
3940
EntryBlockArgsEntry map;
@@ -44,21 +45,21 @@ struct EntryBlockArgs {
4445
EntryBlockArgsEntry useDevicePtr;
4546

4647
bool isValid() const {
47-
return inReduction.isValid() && map.isValid() && priv.isValid() &&
48-
reduction.isValid() && taskReduction.isValid() &&
48+
return hasDeviceAddr.isValid() && inReduction.isValid() && map.isValid() &&
49+
priv.isValid() && reduction.isValid() && taskReduction.isValid() &&
4950
useDeviceAddr.isValid() && useDevicePtr.isValid();
5051
}
5152

5253
auto getSyms() const {
53-
return llvm::concat<const semantics::Symbol *const>(inReduction.syms,
54-
map.syms, priv.syms, reduction.syms, taskReduction.syms,
55-
useDeviceAddr.syms, useDevicePtr.syms);
54+
return llvm::concat<const semantics::Symbol *const>(hasDeviceAddr.syms,
55+
inReduction.syms, map.syms, priv.syms, reduction.syms,
56+
taskReduction.syms, useDeviceAddr.syms, useDevicePtr.syms);
5657
}
5758

5859
auto getVars() const {
59-
return llvm::concat<const mlir::Value>(hostEvalVars, inReduction.vars,
60-
map.vars, priv.vars, reduction.vars, taskReduction.vars,
61-
useDeviceAddr.vars, useDevicePtr.vars);
60+
return llvm::concat<const mlir::Value>(hasDeviceAddr.vars, hostEvalVars,
61+
inReduction.vars, map.vars, priv.vars, reduction.vars,
62+
taskReduction.vars, useDeviceAddr.vars, useDevicePtr.vars);
6263
}
6364
};
6465

flang/lib/Lower/OpenMP/ClauseProcessor.cpp

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -849,14 +849,34 @@ bool ClauseProcessor::processDepend(mlir::omp::DependClauseOps &result) const {
849849
}
850850

851851
bool ClauseProcessor::processHasDeviceAddr(
852-
mlir::omp::HasDeviceAddrClauseOps &result,
853-
llvm::SmallVectorImpl<const semantics::Symbol *> &isDeviceSyms) const {
854-
return findRepeatableClause<omp::clause::HasDeviceAddr>(
855-
[&](const omp::clause::HasDeviceAddr &devAddrClause,
856-
const parser::CharBlock &) {
857-
addUseDeviceClause(converter, devAddrClause.v, result.hasDeviceAddrVars,
858-
isDeviceSyms);
852+
lower::StatementContext &stmtCtx, mlir::omp::HasDeviceAddrClauseOps &result,
853+
llvm::SmallVectorImpl<const semantics::Symbol *> &hasDeviceSyms) const {
854+
// For HAS_DEVICE_ADDR objects, implicitly map the top-level entities.
855+
// Their address (or the whole descriptor, if the entity had one) will be
856+
// passed to the target region.
857+
std::map<Object, OmpMapParentAndMemberData> parentMemberIndices;
858+
bool clauseFound = findRepeatableClause<omp::clause::HasDeviceAddr>(
859+
[&](const omp::clause::HasDeviceAddr &clause,
860+
const parser::CharBlock &source) {
861+
mlir::Location location = converter.genLocation(source);
862+
llvm::omp::OpenMPOffloadMappingFlags mapTypeBits =
863+
llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_TO |
864+
llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_IMPLICIT;
865+
omp::ObjectList baseObjects;
866+
llvm::transform(clause.v, std::back_inserter(baseObjects),
867+
[&](const omp::Object &object) {
868+
if (auto maybeBase = getBaseObject(object, semaCtx))
869+
return *maybeBase;
870+
return object;
871+
});
872+
processMapObjects(stmtCtx, location, baseObjects, mapTypeBits,
873+
parentMemberIndices, result.hasDeviceAddrVars,
874+
hasDeviceSyms);
859875
});
876+
877+
insertChildMapInfoIntoParent(converter, semaCtx, stmtCtx, parentMemberIndices,
878+
result.hasDeviceAddrVars, hasDeviceSyms);
879+
return clauseFound;
860880
}
861881

862882
bool ClauseProcessor::processIf(

flang/lib/Lower/OpenMP/ClauseProcessor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ class ClauseProcessor {
7272
bool processFinal(lower::StatementContext &stmtCtx,
7373
mlir::omp::FinalClauseOps &result) const;
7474
bool processHasDeviceAddr(
75+
lower::StatementContext &stmtCtx,
7576
mlir::omp::HasDeviceAddrClauseOps &result,
76-
llvm::SmallVectorImpl<const semantics::Symbol *> &isDeviceSyms) const;
77+
llvm::SmallVectorImpl<const semantics::Symbol *> &hasDeviceSyms) const;
7778
bool processHint(mlir::omp::HintClauseOps &result) const;
7879
bool processInclusive(mlir::Location currentLocation,
7980
mlir::omp::InclusiveClauseOps &result) const;

flang/lib/Lower/OpenMP/Clauses.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ std::optional<Object> getBaseObject(const Object &object,
159159
return Object{SymbolAndDesignatorExtractor::symbol_addr(comp->symbol()),
160160
ea.Designate(evaluate::DataRef{
161161
SymbolAndDesignatorExtractor::AsRvalueRef(*comp)})};
162-
} else if (base.UnwrapSymbolRef()) {
162+
} else if (auto *symRef = base.UnwrapSymbolRef()) {
163+
// This is the base symbol of the array reference, which is the same
164+
// as the symbol in the input object,
165+
// e.g. A(i) is represented as {Symbol(A), Designator(ArrayRef(A, i))}.
166+
// Here we have the Symbol(A), which is what we started with.
167+
assert(&**symRef == object.sym());
163168
return std::nullopt;
164169
}
165170
} else {

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ static void bindEntryBlockArgs(lower::AbstractConverter &converter,
321321
// Process in clause name alphabetical order to match block arguments order.
322322
// Do not bind host_eval variables because they cannot be used inside of the
323323
// corresponding region, except for very specific cases handled separately.
324+
bindMapLike(args.hasDeviceAddr.syms, op.getHasDeviceAddrBlockArgs());
324325
bindPrivateLike(args.inReduction.syms, args.inReduction.vars,
325326
op.getInReductionBlockArgs());
326327
bindMapLike(args.map.syms, op.getMapBlockArgs());
@@ -1654,7 +1655,7 @@ static void genTargetClauses(
16541655
cp.processBare(clauseOps);
16551656
cp.processDepend(clauseOps);
16561657
cp.processDevice(stmtCtx, clauseOps);
1657-
cp.processHasDeviceAddr(clauseOps, hasDeviceAddrSyms);
1658+
cp.processHasDeviceAddr(stmtCtx, clauseOps, hasDeviceAddrSyms);
16581659
if (!hostEvalInfo.empty()) {
16591660
// Only process host_eval if compiling for the host device.
16601661
processHostEvalClauses(converter, semaCtx, stmtCtx, eval, loc);
@@ -2200,6 +2201,10 @@ genTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
22002201
if (dsp.getAllSymbolsToPrivatize().contains(&sym))
22012202
return;
22022203

2204+
// These symbols are mapped individually in processHasDeviceAddr.
2205+
if (llvm::is_contained(hasDeviceAddrSyms, &sym))
2206+
return;
2207+
22032208
// Structure component symbols don't have bindings, and can only be
22042209
// explicitly mapped individually. If a member is captured implicitly
22052210
// we map the entirety of the derived type when we find its symbol.
@@ -2290,10 +2295,13 @@ genTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
22902295

22912296
auto targetOp = firOpBuilder.create<mlir::omp::TargetOp>(loc, clauseOps);
22922297

2293-
llvm::SmallVector<mlir::Value> mapBaseValues;
2298+
llvm::SmallVector<mlir::Value> hasDeviceAddrBaseValues, mapBaseValues;
2299+
extractMappedBaseValues(clauseOps.hasDeviceAddrVars, hasDeviceAddrBaseValues);
22942300
extractMappedBaseValues(clauseOps.mapVars, mapBaseValues);
22952301

22962302
EntryBlockArgs args;
2303+
args.hasDeviceAddr.syms = hasDeviceAddrSyms;
2304+
args.hasDeviceAddr.vars = hasDeviceAddrBaseValues;
22972305
args.hostEvalVars = clauseOps.hostEvalVars;
22982306
// TODO: Add in_reduction syms and vars.
22992307
args.map.syms = mapSyms;

flang/lib/Lower/OpenMP/Utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ mlir::Value createParentSymAndGenIntermediateMaps(
303303
/// Checks if an omp::Object is an array expression with a subscript, e.g.
304304
/// array(1,2).
305305
auto isArrayExprWithSubscript = [](omp::Object obj) {
306-
if (auto maybeRef = evaluate::ExtractDataRef(*obj.ref())) {
306+
if (auto maybeRef = evaluate::ExtractDataRef(obj.ref())) {
307307
evaluate::DataRef ref = *maybeRef;
308308
if (auto *arr = std::get_if<evaluate::ArrayRef>(&ref.u))
309309
return !arr->subscript().empty();
@@ -454,7 +454,7 @@ getComponentObject(std::optional<Object> object,
454454
if (!object)
455455
return std::nullopt;
456456

457-
auto ref = evaluate::ExtractDataRef(*object.value().ref());
457+
auto ref = evaluate::ExtractDataRef(object.value().ref());
458458
if (!ref)
459459
return std::nullopt;
460460

flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,24 @@ class MapInfoFinalizationPass
250250

251251
mapFlags flags = mapFlags::OMP_MAP_TO |
252252
(mapFlags(mapTypeFlag) &
253-
(mapFlags::OMP_MAP_IMPLICIT | mapFlags::OMP_MAP_CLOSE));
253+
(mapFlags::OMP_MAP_IMPLICIT | mapFlags::OMP_MAP_CLOSE |
254+
mapFlags::OMP_MAP_ALWAYS));
254255
return llvm::to_underlying(flags);
255256
}
256257

258+
/// Check if the mapOp is present in the HasDeviceAddr clause on
259+
/// the userOp. Only applies to TargetOp.
260+
bool isHasDeviceAddr(mlir::omp::MapInfoOp mapOp, mlir::Operation *userOp) {
261+
assert(userOp && "Expecting non-null argument");
262+
if (auto targetOp = llvm::dyn_cast<mlir::omp::TargetOp>(userOp)) {
263+
for (mlir::Value hda : targetOp.getHasDeviceAddrVars()) {
264+
if (hda.getDefiningOp() == mapOp)
265+
return true;
266+
}
267+
}
268+
return false;
269+
}
270+
257271
mlir::omp::MapInfoOp genDescriptorMemberMaps(mlir::omp::MapInfoOp op,
258272
fir::FirOpBuilder &builder,
259273
mlir::Operation *target) {
@@ -263,11 +277,11 @@ class MapInfoFinalizationPass
263277
// TODO: map the addendum segment of the descriptor, similarly to the
264278
// base address/data pointer member.
265279
mlir::Value descriptor = getDescriptorFromBoxMap(op, builder);
266-
auto baseAddr = genBaseAddrMap(descriptor, op.getBounds(),
267-
op.getMapType().value_or(0), builder);
280+
268281
mlir::ArrayAttr newMembersAttr;
269282
mlir::SmallVector<mlir::Value> newMembers;
270283
llvm::SmallVector<llvm::SmallVector<int64_t>> memberIndices;
284+
bool IsHasDeviceAddr = isHasDeviceAddr(op, target);
271285

272286
if (!mapMemberUsers.empty() || !op.getMembers().empty())
273287
getMemberIndicesAsVectors(
@@ -281,6 +295,12 @@ class MapInfoFinalizationPass
281295
// member information to now have one new member for the base address, or
282296
// we are expanding a parent that is a descriptor and we have to adjust
283297
// all of its members to reflect the insertion of the base address.
298+
//
299+
// If we're expanding a top-level descriptor for a map operation that
300+
// resulted from "has_device_addr" clause, then we want the base pointer
301+
// from the descriptor to be used verbatim, i.e. without additional
302+
// remapping. To avoid this remapping, simply don't generate any map
303+
// information for the descriptor members.
284304
if (!mapMemberUsers.empty()) {
285305
// Currently, there should only be one user per map when this pass
286306
// is executed. Either a parent map, holding the current map in its
@@ -291,6 +311,8 @@ class MapInfoFinalizationPass
291311
assert(mapMemberUsers.size() == 1 &&
292312
"OMPMapInfoFinalization currently only supports single users of a "
293313
"MapInfoOp");
314+
auto baseAddr = genBaseAddrMap(descriptor, op.getBounds(),
315+
op.getMapType().value_or(0), builder);
294316
ParentAndPlacement mapUser = mapMemberUsers[0];
295317
adjustMemberIndices(memberIndices, mapUser.index);
296318
llvm::SmallVector<mlir::Value> newMemberOps;
@@ -302,7 +324,9 @@ class MapInfoFinalizationPass
302324
mapUser.parent.getMembersMutable().assign(newMemberOps);
303325
mapUser.parent.setMembersIndexAttr(
304326
builder.create2DI64ArrayAttr(memberIndices));
305-
} else {
327+
} else if (!IsHasDeviceAddr) {
328+
auto baseAddr = genBaseAddrMap(descriptor, op.getBounds(),
329+
op.getMapType().value_or(0), builder);
306330
newMembers.push_back(baseAddr);
307331
if (!op.getMembers().empty()) {
308332
for (auto &indices : memberIndices)
@@ -316,15 +340,26 @@ class MapInfoFinalizationPass
316340
}
317341
}
318342

343+
// Descriptors for objects listed on the `has_device_addr` will always
344+
// be copied. This is because the descriptor can be rematerialized by the
345+
// compiler, and so the address of the descriptor for a given object at
346+
// one place in the code may differ from that address in another place.
347+
// The contents of the descriptor (the base address in particular) will
348+
// remain unchanged though.
349+
uint64_t MapType = op.getMapType().value_or(0);
350+
if (IsHasDeviceAddr) {
351+
MapType |= llvm::to_underlying(
352+
llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_ALWAYS);
353+
}
354+
319355
mlir::omp::MapInfoOp newDescParentMapOp =
320356
builder.create<mlir::omp::MapInfoOp>(
321357
op->getLoc(), op.getResult().getType(), descriptor,
322358
mlir::TypeAttr::get(fir::unwrapRefType(descriptor.getType())),
323359
/*varPtrPtr=*/mlir::Value{}, newMembers, newMembersAttr,
324360
/*bounds=*/mlir::SmallVector<mlir::Value>{},
325-
builder.getIntegerAttr(
326-
builder.getIntegerType(64, false),
327-
getDescriptorMapType(op.getMapType().value_or(0), target)),
361+
builder.getIntegerAttr(builder.getIntegerType(64, false),
362+
getDescriptorMapType(MapType, target)),
328363
/*mapperId*/ mlir::FlatSymbolRefAttr(), op.getMapCaptureTypeAttr(),
329364
op.getNameAttr(),
330365
/*partial_map=*/builder.getBoolAttr(false));
@@ -443,6 +478,12 @@ class MapInfoFinalizationPass
443478
addOperands(useDevPtrMutableOpRange, target,
444479
argIface.getUseDevicePtrBlockArgsStart() +
445480
argIface.numUseDevicePtrBlockArgs());
481+
} else if (auto targetOp = llvm::dyn_cast<mlir::omp::TargetOp>(target)) {
482+
mlir::MutableOperandRange hasDevAddrMutableOpRange =
483+
targetOp.getHasDeviceAddrVarsMutable();
484+
addOperands(hasDevAddrMutableOpRange, target,
485+
argIface.getHasDeviceAddrBlockArgsStart() +
486+
argIface.numHasDeviceAddrBlockArgs());
446487
}
447488
}
448489

flang/lib/Support/OpenMP-utils.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ mlir::Block *genEntryBlock(mlir::OpBuilder &builder, const EntryBlockArgs &args,
1818

1919
llvm::SmallVector<mlir::Type> types;
2020
llvm::SmallVector<mlir::Location> locs;
21-
unsigned numVars = args.hostEvalVars.size() + args.inReduction.vars.size() +
22-
args.map.vars.size() + args.priv.vars.size() +
23-
args.reduction.vars.size() + args.taskReduction.vars.size() +
24-
args.useDeviceAddr.vars.size() + args.useDevicePtr.vars.size();
21+
unsigned numVars = args.hasDeviceAddr.vars.size() + args.hostEvalVars.size() +
22+
args.inReduction.vars.size() + args.map.vars.size() +
23+
args.priv.vars.size() + args.reduction.vars.size() +
24+
args.taskReduction.vars.size() + args.useDeviceAddr.vars.size() +
25+
args.useDevicePtr.vars.size();
2526
types.reserve(numVars);
2627
locs.reserve(numVars);
2728

@@ -34,6 +35,7 @@ mlir::Block *genEntryBlock(mlir::OpBuilder &builder, const EntryBlockArgs &args,
3435

3536
// Populate block arguments in clause name alphabetical order to match
3637
// expected order by the BlockArgOpenMPOpInterface.
38+
extractTypeLoc(args.hasDeviceAddr.vars);
3739
extractTypeLoc(args.hostEvalVars);
3840
extractTypeLoc(args.inReduction.vars);
3941
extractTypeLoc(args.map.vars);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=51 %s -mmlir -mlir-print-op-generic -o - | FileCheck %s
2+
!RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=51 %s -mlir-print-op-generic -o - | FileCheck %s
3+
4+
! Check that we don't generate member information for the descriptor of `a`
5+
! on entry to the target region.
6+
7+
integer function s(a)
8+
integer :: a(:)
9+
integer :: t
10+
!$omp target data map(to:a) use_device_addr(a)
11+
!$omp target map(from:t) has_device_addr(a)
12+
t = size(a, 1)
13+
!$omp end target
14+
!$omp end target data
15+
s = t
16+
end
17+
18+
! Check that the map.info for `a` only takes a single parameter.
19+
20+
!CHECK-DAG: %[[MAP_A:[0-9]+]] = "omp.map.info"(%[[STORAGE_A:[0-9#]+]]) <{map_capture_type = #omp<variable_capture_kind(ByRef)>, map_type = 517 : ui64, name = "a", operandSegmentSizes = array<i32: 1, 0, 0, 0>, partial_map = false, var_type = !fir.box<!fir.array<?xi32>>}> : (!fir.ref<!fir.box<!fir.array<?xi32>>>) -> !fir.ref<!fir.array<?xi32>>
21+
!CHECK-DAG: %[[MAP_T:[0-9]+]] = "omp.map.info"(%[[STORAGE_T:[0-9#]+]]) <{map_capture_type = #omp<variable_capture_kind(ByRef)>, map_type = 2 : ui64, name = "t", operandSegmentSizes = array<i32: 1, 0, 0, 0>, partial_map = false, var_type = i32}> : (!fir.ref<i32>) -> !fir.ref<i32>
22+
23+
!CHECK: "omp.target"(%[[MAP_A]], %[[MAP_T]])

mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,18 @@ class OpenMP_HasDeviceAddrClauseSkip<
462462
bit description = false, bit extraClassDeclaration = false
463463
> : OpenMP_Clause<traits, arguments, assemblyFormat, description,
464464
extraClassDeclaration> {
465+
let traits = [
466+
BlockArgOpenMPOpInterface
467+
];
468+
465469
let arguments = (ins
466470
Variadic<OpenMP_PointerLikeType>:$has_device_addr_vars
467471
);
468472

469-
let optAssemblyFormat = [{
470-
`has_device_addr` `(` $has_device_addr_vars `:` type($has_device_addr_vars)
471-
`)`
473+
let extraClassDeclaration = [{
474+
unsigned numHasDeviceAddrBlockArgs() {
475+
return getHasDeviceAddrVars().size();
476+
}
472477
}];
473478

474479
let description = [{

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,8 +1326,9 @@ def TargetOp : OpenMP_Op<"target", traits = [
13261326
}] # clausesExtraClassDeclaration;
13271327

13281328
let assemblyFormat = clausesAssemblyFormat # [{
1329-
custom<HostEvalInReductionMapPrivateRegion>(
1330-
$region, $host_eval_vars, type($host_eval_vars), $in_reduction_vars,
1329+
custom<TargetOpRegion>(
1330+
$region, $has_device_addr_vars, type($has_device_addr_vars),
1331+
$host_eval_vars, type($host_eval_vars), $in_reduction_vars,
13311332
type($in_reduction_vars), $in_reduction_byref, $in_reduction_syms,
13321333
$map_vars, type($map_vars), $private_vars, type($private_vars),
13331334
$private_syms, $private_maps) attr-dict

mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ class BlockArgOpenMPClause<string clauseNameSnake, string clauseNameCamel,
7676
>;
7777
}
7878

79-
def BlockArgHostEvalClause : BlockArgOpenMPClause<"host_eval", "HostEval", ?>;
79+
def BlockArgHasDeviceAddrClause : BlockArgOpenMPClause<
80+
"has_device_addr", "HasDeviceAddr", ?>;
81+
def BlockArgHostEvalClause : BlockArgOpenMPClause<
82+
"host_eval", "HostEval", BlockArgHasDeviceAddrClause>;
8083
def BlockArgInReductionClause : BlockArgOpenMPClause<
8184
"in_reduction", "InReduction", BlockArgHostEvalClause>;
8285
def BlockArgMapClause : BlockArgOpenMPClause<
@@ -100,10 +103,10 @@ def BlockArgOpenMPOpInterface : OpInterface<"BlockArgOpenMPOpInterface"> {
100103

101104
let cppNamespace = "::mlir::omp";
102105

103-
defvar clauses = [ BlockArgHostEvalClause, BlockArgInReductionClause,
104-
BlockArgMapClause, BlockArgPrivateClause, BlockArgReductionClause,
105-
BlockArgTaskReductionClause, BlockArgUseDeviceAddrClause,
106-
BlockArgUseDevicePtrClause ];
106+
defvar clauses = [ BlockArgHasDeviceAddrClause, BlockArgHostEvalClause,
107+
BlockArgInReductionClause, BlockArgMapClause, BlockArgPrivateClause,
108+
BlockArgReductionClause, BlockArgTaskReductionClause,
109+
BlockArgUseDeviceAddrClause, BlockArgUseDevicePtrClause ];
107110

108111
let methods = !listconcat(
109112
!foreach(clause, clauses, clause.numArgsMethod),

0 commit comments

Comments
 (0)