[all-commits] [llvm/llvm-project] b15fdf: [flang][cuda] Exclude non-variable actuals from un...
Zhen Wang via All-commits
all-commits at lists.llvm.org
Fri Jun 26 15:41:32 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b15fdf4834cfe79f8a5ac04fabd003f876626187
https://github.com/llvm/llvm-project/commit/b15fdf4834cfe79f8a5ac04fabd003f876626187
Author: Zhen Wang <zhenw at nvidia.com>
Date: 2026-06-26 (Fri, 26 Jun 2026)
Changed paths:
M flang/include/flang/Support/Fortran.h
M flang/lib/Semantics/check-call.cpp
M flang/lib/Semantics/expression.cpp
M flang/lib/Support/Fortran.cpp
A flang/test/Semantics/CUDA/cuf-generic-nonvar-unified.cuf
Log Message:
-----------
[flang][cuda] Exclude non-variable actuals from unified-memory CUDA data attribute relaxation (#206121)
Under -gpu=mem:unified, the CUDA data attribute compatibility check
(AreCompatibleCUDADataAttrs) allows an unattributed actual argument to
bind to a Device/Managed/Unified dummy. This relaxation is correct for
variables whose storage is accessible from device code under unified
memory, but not for non-variable expression results (e.g. intrinsic call
results like RESHAPE(...)), which are host temporaries.
Without this fix, a generic SUM call like sum(reshape(hostArray, ...),
dim=2) could resolve to a device-specific overload instead of the
intrinsic, because the RESHAPE result was incorrectly considered
compatible with a DEVICE-attributed dummy.
This patch:
- Adds an actualIsVariable parameter to AreCompatibleCUDADataAttrs
(defaulting to true for backward compatibility) and gates the
unified-memory relaxation for Device/Managed/Unified dummies on it.
- Passes actualIsVariable from CheckExplicitDataArg in check-call.
- Stops setting actualCanUseImplicitCudaMemoryMode for non-variable
expressions in GetMatchingDistance, so the CUDA matching distance
ranking is also correct.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list