Skip to content

Commit

Permalink
[flang][runtime] Workaround cuda-11.8 compilation issue. (#68459)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vzakhari committed Oct 9, 2023
1 parent d4feffb commit f92309a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flang/runtime/assign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit f92309a

Please sign in to comment.