@@ -332,7 +332,6 @@ static LogicalResult checkImplementationStatus(Operation &op) {
332332 op.getInReductionSyms ())
333333 result = todo (" in_reduction" );
334334 };
335- auto checkIsDevicePtr = [](auto , LogicalResult &) {};
336335 auto checkLinear = [&todo](auto op, LogicalResult &result) {
337336 if (!op.getLinearVars ().empty () || !op.getLinearStepVars ().empty ())
338337 result = todo (" linear" );
@@ -441,7 +440,6 @@ static LogicalResult checkImplementationStatus(Operation &op) {
441440 checkBare (op, result);
442441 checkDevice (op, result);
443442 checkInReduction (op, result);
444- checkIsDevicePtr (op, result);
445443 })
446444 .Default ([](Operation &) {
447445 // Assume all clauses for an operation can be translated unless they are
@@ -3872,6 +3870,10 @@ convertClauseMapFlags(omp::ClauseMapFlags mlirFlags) {
38723870 if (mapTypeToBool (omp::ClauseMapFlags::attach))
38733871 mapType |= llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_ATTACH;
38743872
3873+ // No dedicated LLVM runtime flag for is_device_ptr; handled separately.
3874+ if (mapTypeToBool (omp::ClauseMapFlags::is_device_ptr))
3875+ mapType |= llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_RETURN_PARAM;
3876+
38753877 return mapType;
38763878}
38773879
@@ -3993,8 +3995,9 @@ static void collectMapDataFromMapOperands(
39933995 llvm::Value *origValue = moduleTranslation.lookupValue (offloadPtr);
39943996 auto mapType = convertClauseMapFlags (mapOp.getMapType ());
39953997 auto mapTypeAlways = llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_ALWAYS;
3996- bool isDevicePtr = (mapOp.getMapType () & omp::ClauseMapFlags::storage) ==
3997- omp::ClauseMapFlags::storage;
3998+ bool isDevicePtr =
3999+ (mapOp.getMapType () & omp::ClauseMapFlags::is_device_ptr) !=
4000+ omp::ClauseMapFlags::none;
39984001
39994002 mapData.OriginalValue .push_back (origValue);
40004003 mapData.BasePointers .push_back (origValue);
0 commit comments