[Mlir-commits] [mlir] [MLIR][OpenMP] Skip host omp ops when compiling for the target device (PR #85239)
Sergio Afonso
llvmlistbot at llvm.org
Mon Mar 25 04:40:14 PDT 2024
================
@@ -3043,116 +3199,15 @@ LogicalResult OpenMPDialectLLVMIRTranslationInterface::convertOperation(
LLVM::ModuleTranslation &moduleTranslation) const {
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder();
+ if (ompBuilder->Config.isTargetDevice()) {
+ if (isInternalTargetDeviceOp(op)) {
+ return convertInternalTargetOp(op, builder, moduleTranslation);
----------------
skatrak wrote:
I don't quite have the full picture in my head at the moment, but I think we can leave it as you proposed. When that patch comes maybe I'll be convinced that it is the right way to go, or we could discuss further at that time.
One thing I'm still struggling to understand is the use of "internal" and "common" in function names. If these are used to identify device-only vs host+device conversions, maybe it would make sense that names would reflect that difference. So `convertInternalTargetOp` would be `convertDeviceTargetOp` and `convertCommonOperation` would be `convertHostOrDeviceOperation` or similar. Maybe I misunderstood their meaning, in which case maybe a name change or additional documentation might still be good to have.
https://github.com/llvm/llvm-project/pull/85239
More information about the Mlir-commits
mailing list