[flang-commits] [flang] f92309a - [flang][runtime] Workaround cuda-11.8 compilation issue. (#68459)
via flang-commits
flang-commits at lists.llvm.org
Mon Oct 9 16:26:11 PDT 2023
Author: Slava Zakharin
Date: 2023-10-09T16:26:06-07:00
New Revision: f92309a3a5c57403deec32e6bbb88c3f5beb65d5
URL: https://github.com/llvm/llvm-project/commit/f92309a3a5c57403deec32e6bbb88c3f5beb65d5
DIFF: https://github.com/llvm/llvm-project/commit/f92309a3a5c57403deec32e6bbb88c3f5beb65d5.diff
LOG: [flang][runtime] Workaround cuda-11.8 compilation issue. (#68459)
cuda-11.8 nvcc cannot handle brace initialization of the lambda
object. 12.1 works okay, but I would like to have an option
to use 11.8.
Added:
Modified:
flang/runtime/assign.cpp
Removed:
################################################################################
diff --git a/flang/runtime/assign.cpp b/flang/runtime/assign.cpp
index 458a1ba006b690e..237acb0c89fc2e3 100644
--- a/flang/runtime/assign.cpp
+++ b/flang/runtime/assign.cpp
@@ -263,10 +263,12 @@ RT_API_ATTRS static void Assign(
}
std::size_t toElementBytes{to.ElementBytes()};
std::size_t fromElementBytes{from.ElementBytes()};
- auto isSimpleMemmove{[&]() {
+ // The following lambda definition violates the conding style,
+ // but cuda-11.8 nvcc hits an internal error with the brace initialization.
+ auto isSimpleMemmove = [&]() {
return !toDerived && to.rank() == from.rank() && to.IsContiguous() &&
from.IsContiguous() && toElementBytes == fromElementBytes;
- }};
+ };
StaticDescriptor<maxRank, true, 10 /*?*/> deferredDeallocStatDesc;
Descriptor *deferDeallocation{nullptr};
if (MayAlias(to, from)) {
More information about the flang-commits
mailing list